@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,731 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // interfaces
5
- import {
6
- ILSP1UniversalReceiver as ILSP1
7
- } from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
8
- import {ILSP7DigitalAsset} from "./ILSP7DigitalAsset.sol";
9
-
10
- // modules
11
-
12
- // libraries
13
- import {
14
- EnumerableSet
15
- } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
16
- import {
17
- ERC165Checker
18
- } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
19
- import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
20
-
21
- // errors
22
- import {
23
- LSP7CannotSendToSelf,
24
- LSP7AmountExceedsAuthorizedAmount,
25
- LSP7InvalidTransferBatch,
26
- LSP7AmountExceedsBalance,
27
- LSP7DecreasedAllowanceBelowZero,
28
- LSP7CannotUseAddressZeroAsOperator,
29
- LSP7TokenOwnerCannotBeOperator,
30
- LSP7CannotSendWithAddressZero,
31
- LSP7NotifyTokenReceiverContractMissingLSP1Interface,
32
- LSP7NotifyTokenReceiverIsEOA,
33
- OperatorAllowanceCannotBeIncreasedFromZero,
34
- LSP7BatchCallFailed
35
- } from "./LSP7Errors.sol";
36
-
37
- // constants
38
- import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
39
- import {
40
- _TYPEID_LSP7_TOKENOPERATOR,
41
- _TYPEID_LSP7_TOKENSSENDER,
42
- _TYPEID_LSP7_TOKENSRECIPIENT
43
- } from "./LSP7Constants.sol";
44
-
45
- /**
46
- * @title LSP7DigitalAsset contract
47
- * @author Matthew Stevens
48
- * @dev Core Implementation of a LSP7 compliant contract.
49
- *
50
- * This contract implement the core logic of the functions for the {ILSP7DigitalAsset} interface.
51
- *
52
- * Similar to ERC20, the non-standard {increaseAllowance} and {decreaseAllowance} functions
53
- * have been added to mitigate the well-known issues around setting allowances.
54
- */
55
- abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
56
- using EnumerableSet for EnumerableSet.AddressSet;
57
-
58
- // --- Storage
59
-
60
- bool internal _isNonDivisible;
61
-
62
- uint256 internal _existingTokens;
63
-
64
- // Mapping from `tokenOwner` to an `amount` of tokens
65
- mapping(address => uint256) internal _tokenOwnerBalances;
66
-
67
- // Mapping an `address` to its authorized operator addresses.
68
- mapping(address => EnumerableSet.AddressSet) internal _operators;
69
-
70
- // Mapping a `tokenOwner` to an `operator` to `amount` of tokens.
71
- mapping(address => mapping(address => uint256))
72
- internal _operatorAuthorizedAmount;
73
-
74
- // --- Token queries
75
-
76
- /**
77
- * @inheritdoc ILSP7DigitalAsset
78
- */
79
- function decimals() public view virtual override returns (uint8) {
80
- return _isNonDivisible ? 0 : 18;
81
- }
82
-
83
- /**
84
- * @inheritdoc ILSP7DigitalAsset
85
- */
86
- function totalSupply() public view virtual override returns (uint256) {
87
- return _existingTokens;
88
- }
89
-
90
- // --- Token owner queries
91
-
92
- /**
93
- * @inheritdoc ILSP7DigitalAsset
94
- */
95
- function balanceOf(
96
- address tokenOwner
97
- ) public view virtual override returns (uint256) {
98
- return _tokenOwnerBalances[tokenOwner];
99
- }
100
-
101
- // --- General functionality
102
-
103
- /**
104
- * @inheritdoc ILSP7DigitalAsset
105
- *
106
- * @custom:info It's not possible to send value along the functions call due to the use of `delegatecall`.
107
- */
108
- function batchCalls(
109
- bytes[] calldata data
110
- ) public virtual override returns (bytes[] memory results) {
111
- results = new bytes[](data.length);
112
- for (uint256 i; i < data.length; ) {
113
- (bool success, bytes memory result) = address(this).delegatecall(
114
- data[i]
115
- );
116
-
117
- if (!success) {
118
- // Look for revert reason and bubble it up if present
119
- if (result.length != 0) {
120
- // The easiest way to bubble the revert reason is using memory via assembly
121
- // solhint-disable no-inline-assembly
122
- /// @solidity memory-safe-assembly
123
- assembly {
124
- let returndata_size := mload(result)
125
- revert(add(32, result), returndata_size)
126
- }
127
- } else {
128
- revert LSP7BatchCallFailed({callIndex: i});
129
- }
130
- }
131
-
132
- results[i] = result;
133
-
134
- unchecked {
135
- ++i;
136
- }
137
- }
138
- }
139
-
140
- // --- Operator functionality
141
-
142
- /**
143
- * @inheritdoc ILSP7DigitalAsset
144
- *
145
- * @custom:danger To avoid front-running and Allowance Double-Spend Exploit when
146
- * increasing or decreasing the authorized amount of an operator, it is advised to:
147
- *
148
- * 1. either call {revokeOperator} first, and then re-call {authorizeOperator} with the new amount.
149
- * 2. or use the non-standard functions {increaseAllowance} or {decreaseAllowance}.
150
- *
151
- * For more information, see:
152
- * https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/
153
- */
154
- function authorizeOperator(
155
- address operator,
156
- uint256 amount,
157
- bytes memory operatorNotificationData
158
- ) public virtual override {
159
- _updateOperator(
160
- msg.sender,
161
- operator,
162
- amount,
163
- true,
164
- operatorNotificationData
165
- );
166
-
167
- bytes memory lsp1Data = abi.encode(
168
- msg.sender,
169
- amount,
170
- operatorNotificationData
171
- );
172
-
173
- _notifyTokenOperator(operator, lsp1Data);
174
- }
175
-
176
- /**
177
- * @inheritdoc ILSP7DigitalAsset
178
- */
179
- function revokeOperator(
180
- address operator,
181
- bool notify,
182
- bytes memory operatorNotificationData
183
- ) public virtual override {
184
- _updateOperator(
185
- msg.sender,
186
- operator,
187
- 0,
188
- notify,
189
- operatorNotificationData
190
- );
191
-
192
- if (notify) {
193
- bytes memory lsp1Data = abi.encode(
194
- msg.sender,
195
- 0,
196
- operatorNotificationData
197
- );
198
-
199
- _notifyTokenOperator(operator, lsp1Data);
200
- }
201
- }
202
-
203
- /**
204
- * @inheritdoc ILSP7DigitalAsset
205
- */
206
- function authorizedAmountFor(
207
- address operator,
208
- address tokenOwner
209
- ) public view virtual override returns (uint256) {
210
- if (tokenOwner == operator) {
211
- return _tokenOwnerBalances[tokenOwner];
212
- } else {
213
- return _operatorAuthorizedAmount[tokenOwner][operator];
214
- }
215
- }
216
-
217
- /**
218
- * @inheritdoc ILSP7DigitalAsset
219
- */
220
- function getOperatorsOf(
221
- address tokenOwner
222
- ) public view virtual override returns (address[] memory) {
223
- return _operators[tokenOwner].values();
224
- }
225
-
226
- /**
227
- * @inheritdoc ILSP7DigitalAsset
228
- */
229
- function increaseAllowance(
230
- address operator,
231
- uint256 addedAmount,
232
- bytes memory operatorNotificationData
233
- ) public virtual override {
234
- uint256 oldAllowance = authorizedAmountFor(operator, msg.sender);
235
- if (oldAllowance == 0)
236
- revert OperatorAllowanceCannotBeIncreasedFromZero(operator);
237
-
238
- uint256 newAllowance = oldAllowance + addedAmount;
239
-
240
- _updateOperator(
241
- msg.sender,
242
- operator,
243
- newAllowance,
244
- true,
245
- operatorNotificationData
246
- );
247
-
248
- bytes memory lsp1Data = abi.encode(
249
- msg.sender,
250
- newAllowance,
251
- operatorNotificationData
252
- );
253
-
254
- _notifyTokenOperator(operator, lsp1Data);
255
- }
256
-
257
- /**
258
- * @inheritdoc ILSP7DigitalAsset
259
- */
260
- function decreaseAllowance(
261
- address operator,
262
- uint256 subtractedAmount,
263
- bytes memory operatorNotificationData
264
- ) public virtual override {
265
- uint256 currentAllowance = authorizedAmountFor(operator, msg.sender);
266
- if (currentAllowance < subtractedAmount) {
267
- revert LSP7DecreasedAllowanceBelowZero();
268
- }
269
-
270
- uint256 newAllowance;
271
- unchecked {
272
- newAllowance = currentAllowance - subtractedAmount;
273
- _updateOperator(
274
- msg.sender,
275
- operator,
276
- newAllowance,
277
- true,
278
- operatorNotificationData
279
- );
280
- }
281
-
282
- bytes memory lsp1Data = abi.encode(
283
- msg.sender,
284
- newAllowance,
285
- operatorNotificationData
286
- );
287
-
288
- _notifyTokenOperator(operator, lsp1Data);
289
- }
290
-
291
- // --- Transfer functionality
292
-
293
- /**
294
- * @inheritdoc ILSP7DigitalAsset
295
- */
296
- function transfer(
297
- address from,
298
- address to,
299
- uint256 amount,
300
- bool force,
301
- bytes memory data
302
- ) public virtual override {
303
- if (from == to) revert LSP7CannotSendToSelf();
304
-
305
- if (msg.sender != from) {
306
- _spendAllowance({
307
- operator: msg.sender,
308
- tokenOwner: from,
309
- amountToSpend: amount
310
- });
311
- }
312
-
313
- _transfer(from, to, amount, force, data);
314
- }
315
-
316
- /**
317
- * @inheritdoc ILSP7DigitalAsset
318
- */
319
- function transferBatch(
320
- address[] memory from,
321
- address[] memory to,
322
- uint256[] memory amount,
323
- bool[] memory force,
324
- bytes[] memory data
325
- ) public virtual override {
326
- uint256 fromLength = from.length;
327
- if (
328
- fromLength != to.length ||
329
- fromLength != amount.length ||
330
- fromLength != force.length ||
331
- fromLength != data.length
332
- ) {
333
- revert LSP7InvalidTransferBatch();
334
- }
335
-
336
- for (uint256 i; i < fromLength; ) {
337
- // using the public transfer function to handle updates to operator authorized amounts
338
- transfer(from[i], to[i], amount[i], force[i], data[i]);
339
-
340
- unchecked {
341
- ++i;
342
- }
343
- }
344
- }
345
-
346
- /**
347
- * @dev Changes token `amount` the `operator` has access to from `tokenOwner` tokens.
348
- * If the amount is zero the operator is removed from the list of operators, otherwise he is added to the list of operators.
349
- * If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified.
350
- *
351
- * @param tokenOwner The address that will give `operator` an allowance for on its balance.
352
- * @param operator The address to grant an allowance to spend.
353
- * @param allowance The maximum amount of token that `operator` can spend from the `tokenOwner`'s balance.
354
- * @param notified Boolean indicating whether the operator has been notified about the change of allowance
355
- * @param operatorNotificationData The data to send to the universalReceiver function of the operator in case of notifying
356
- *
357
- * @custom:events
358
- * - {OperatorRevoked} event when operator's allowance is set to `0`.
359
- * - {OperatorAuthorizationChanged} event when operator's allowance is set to any other amount.
360
- *
361
- * @custom:requirements
362
- * - `operator` cannot be the zero address.
363
- * - `operator` cannot be the same address as `tokenOwner`.
364
- */
365
- function _updateOperator(
366
- address tokenOwner,
367
- address operator,
368
- uint256 allowance,
369
- bool notified,
370
- bytes memory operatorNotificationData
371
- ) internal virtual {
372
- if (operator == address(0)) {
373
- revert LSP7CannotUseAddressZeroAsOperator();
374
- }
375
-
376
- if (operator == tokenOwner) {
377
- revert LSP7TokenOwnerCannotBeOperator();
378
- }
379
-
380
- _operatorAuthorizedAmount[tokenOwner][operator] = allowance;
381
-
382
- if (allowance != 0) {
383
- _operators[tokenOwner].add(operator);
384
- emit OperatorAuthorizationChanged(
385
- operator,
386
- tokenOwner,
387
- allowance,
388
- operatorNotificationData
389
- );
390
- } else {
391
- _operators[tokenOwner].remove(operator);
392
- emit OperatorRevoked(
393
- operator,
394
- tokenOwner,
395
- notified,
396
- operatorNotificationData
397
- );
398
- }
399
- }
400
-
401
- /**
402
- * @dev Mints `amount` of tokens and transfers it to `to`.
403
- *
404
- * @custom:info Any logic in the:
405
- * - {_beforeTokenTransfer} function will run before updating the balances.
406
- * - {_afterTokenTransfer} function will run after updating the balances, **but before notifying the recipient via LSP1**.
407
- *
408
- * @param to The address to mint tokens for.
409
- * @param amount The amount of tokens to mint.
410
- * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not.
411
- * @param data Additional data the caller wants included in the emitted {Transfer} event, and sent in the LSP1 hook to the `to` address.
412
- *
413
- * @custom:requirements
414
- * - `to` cannot be the zero address.
415
- *
416
- * @custom:events {Transfer} event with `address(0)` as `from`.
417
- */
418
- function _mint(
419
- address to,
420
- uint256 amount,
421
- bool force,
422
- bytes memory data
423
- ) internal virtual {
424
- if (to == address(0)) {
425
- revert LSP7CannotSendWithAddressZero();
426
- }
427
-
428
- _beforeTokenTransfer(address(0), to, amount, data);
429
-
430
- // tokens being minted
431
- _existingTokens += amount;
432
-
433
- _tokenOwnerBalances[to] += amount;
434
-
435
- emit Transfer({
436
- operator: msg.sender,
437
- from: address(0),
438
- to: to,
439
- amount: amount,
440
- force: force,
441
- data: data
442
- });
443
-
444
- _afterTokenTransfer(address(0), to, amount, data);
445
-
446
- bytes memory lsp1Data = abi.encode(
447
- msg.sender,
448
- address(0),
449
- to,
450
- amount,
451
- data
452
- );
453
- _notifyTokenReceiver(to, force, lsp1Data);
454
- }
455
-
456
- /**
457
- * @dev Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address.
458
- *
459
- * Both the sender and recipient will be notified of the token transfer through the LSP1 {universalReceiver}
460
- * function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
461
- * all the parameters in the calldata packed encoded.
462
- *
463
- * @custom:info Any logic in the:
464
- * - {_beforeTokenTransfer} function will run before updating the balances.
465
- * - {_afterTokenTransfer} function will run after updating the balances, **but before notifying the sender via LSP1**.
466
- *
467
- * @param from The address to burn tokens from its balance.
468
- * @param amount The amount of tokens to burn.
469
- * @param data Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address.
470
- *
471
- * @custom:hint In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
472
- *
473
- * @custom:requirements
474
- * - `from` cannot be the zero address.
475
- * - `from` must have at least `amount` tokens.
476
- * - If the caller is not `from`, it must be an operator for `from` with access to at least
477
- * `amount` tokens.
478
- *
479
- * @custom:events {Transfer} event with `address(0)` as the `to` address
480
- */
481
- function _burn(
482
- address from,
483
- uint256 amount,
484
- bytes memory data
485
- ) internal virtual {
486
- if (from == address(0)) {
487
- revert LSP7CannotSendWithAddressZero();
488
- }
489
-
490
- uint256 balance = _tokenOwnerBalances[from];
491
- if (amount > balance) {
492
- revert LSP7AmountExceedsBalance(balance, from, amount);
493
- }
494
-
495
- _beforeTokenTransfer(from, address(0), amount, data);
496
-
497
- // tokens being burnt
498
- _existingTokens -= amount;
499
-
500
- _tokenOwnerBalances[from] -= amount;
501
-
502
- emit Transfer({
503
- operator: msg.sender,
504
- from: from,
505
- to: address(0),
506
- amount: amount,
507
- force: false,
508
- data: data
509
- });
510
-
511
- _afterTokenTransfer(from, address(0), amount, data);
512
-
513
- bytes memory lsp1Data = abi.encode(
514
- msg.sender,
515
- from,
516
- address(0),
517
- amount,
518
- data
519
- );
520
- _notifyTokenSender(from, lsp1Data);
521
- }
522
-
523
- /**
524
- * @dev Spend `amountToSpend` from the `operator`'s authorized on behalf of the `tokenOwner`.
525
- *
526
- * @param operator The address of the operator to decrease the allowance of.
527
- * @param tokenOwner The address that granted an allowance on its balance to `operator`.
528
- * @param amountToSpend The amount of tokens to substract in allowance of `operator`.
529
- *
530
- * @custom:events
531
- * - {OperatorRevoked} event when operator's allowance is set to `0`.
532
- * - {OperatorAuthorizationChanged} event when operator's allowance is set to any other amount.
533
- *
534
- * @custom:requirements
535
- * - The `amountToSpend` MUST be at least the allowance granted to `operator` (accessible via {`authorizedAmountFor}`)
536
- * - `operator` cannot be the zero address.
537
- * - `operator` cannot be the same address as `tokenOwner`.
538
- */
539
- function _spendAllowance(
540
- address operator,
541
- address tokenOwner,
542
- uint256 amountToSpend
543
- ) internal virtual {
544
- uint256 authorizedAmount = _operatorAuthorizedAmount[tokenOwner][
545
- operator
546
- ];
547
-
548
- if (amountToSpend > authorizedAmount) {
549
- revert LSP7AmountExceedsAuthorizedAmount(
550
- tokenOwner,
551
- authorizedAmount,
552
- operator,
553
- amountToSpend
554
- );
555
- }
556
-
557
- _updateOperator({
558
- tokenOwner: tokenOwner,
559
- operator: operator,
560
- allowance: authorizedAmount - amountToSpend,
561
- notified: false,
562
- operatorNotificationData: ""
563
- });
564
- }
565
-
566
- /**
567
- * @dev Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance
568
- * of `to` by `+amount`.
569
- *
570
- * Both the sender and recipient will be notified of the token transfer through the LSP1 {universalReceiver}
571
- * function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
572
- * all the parameters in the calldata packed encoded.
573
- *
574
- * @custom:info Any logic in the:
575
- * - {_beforeTokenTransfer} function will run before updating the balances.
576
- * - {_afterTokenTransfer} function will run after updating the balances, **but before notifying the sender/recipient via LSP1**.
577
- *
578
- * @param from The address to decrease the balance.
579
- * @param to The address to increase the balance.
580
- * @param amount The amount of tokens to transfer from `from` to `to`.
581
- * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not.
582
- * @param data Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address.
583
- *
584
- * @custom:requirements
585
- * - `from` cannot be the zero address.
586
- * - `to` cannot be the zero address.
587
- * - `from` must have at least `amount` of tokens.
588
- *
589
- * @custom:events {Transfer} event.
590
- */
591
- function _transfer(
592
- address from,
593
- address to,
594
- uint256 amount,
595
- bool force,
596
- bytes memory data
597
- ) internal virtual {
598
- if (from == address(0) || to == address(0)) {
599
- revert LSP7CannotSendWithAddressZero();
600
- }
601
-
602
- uint256 balance = _tokenOwnerBalances[from];
603
- if (amount > balance) {
604
- revert LSP7AmountExceedsBalance(balance, from, amount);
605
- }
606
-
607
- _beforeTokenTransfer(from, to, amount, data);
608
-
609
- _tokenOwnerBalances[from] -= amount;
610
- _tokenOwnerBalances[to] += amount;
611
-
612
- emit Transfer({
613
- operator: msg.sender,
614
- from: from,
615
- to: to,
616
- amount: amount,
617
- force: force,
618
- data: data
619
- });
620
-
621
- _afterTokenTransfer(from, to, amount, data);
622
-
623
- bytes memory lsp1Data = abi.encode(msg.sender, from, to, amount, data);
624
-
625
- _notifyTokenSender(from, lsp1Data);
626
- _notifyTokenReceiver(to, force, lsp1Data);
627
- }
628
-
629
- /**
630
- * @dev Hook that is called before any token transfer, including minting and burning.
631
- * Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function.
632
- *
633
- * @param from The sender address
634
- * @param to The recipient address
635
- * @param amount The amount of token to transfer
636
- * @param data The data sent alongside the transfer
637
- */
638
- function _beforeTokenTransfer(
639
- address from,
640
- address to,
641
- uint256 amount,
642
- bytes memory data // solhint-disable-next-line no-empty-blocks
643
- ) internal virtual {}
644
-
645
- /**
646
- * @dev Hook that is called after any token transfer, including minting and burning.
647
- * Allows to run custom logic after updating balances, but **before notifiying sender/recipient** by overriding this function.
648
- *
649
- * @param from The sender address
650
- * @param to The recipient address
651
- * @param amount The amount of token to transfer
652
- * @param data The data sent alongside the transfer
653
- */
654
- function _afterTokenTransfer(
655
- address from,
656
- address to,
657
- uint256 amount,
658
- bytes memory data // solhint-disable-next-line no-empty-blocks
659
- ) internal virtual {}
660
-
661
- /**
662
- * @dev Attempt to notify the operator `operator` about the `amount` tokens being authorized with.
663
- * This is done by calling its {universalReceiver} function with the `_TYPEID_LSP7_TOKENOPERATOR` as typeId, if `operator` is a contract that supports the LSP1 interface.
664
- * If `operator` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent.
665
-
666
- * @param operator The address to call the {universalReceiver} function on.
667
- * @param lsp1Data the data to be sent to the `operator` address in the `universalReceiver` call.
668
- */
669
- function _notifyTokenOperator(
670
- address operator,
671
- bytes memory lsp1Data
672
- ) internal virtual {
673
- LSP1Utils.notifyUniversalReceiver(
674
- operator,
675
- _TYPEID_LSP7_TOKENOPERATOR,
676
- lsp1Data
677
- );
678
- }
679
-
680
- /**
681
- * @dev Attempt to notify the token sender `from` about the `amount` of tokens being transferred.
682
- * This is done by calling its {universalReceiver} function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface.
683
- * If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent.
684
-
685
- * @param from The address to call the {universalReceiver} function on.
686
- * @param lsp1Data the data to be sent to the `from` address in the `universalReceiver` call.
687
- */
688
- function _notifyTokenSender(
689
- address from,
690
- bytes memory lsp1Data
691
- ) internal virtual {
692
- LSP1Utils.notifyUniversalReceiver(
693
- from,
694
- _TYPEID_LSP7_TOKENSSENDER,
695
- lsp1Data
696
- );
697
- }
698
-
699
- /**
700
- * @dev Attempt to notify the token receiver `to` about the `amount` tokens being received.
701
- * This is done by calling its {universalReceiver} function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface.
702
- *
703
- * If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `force` boolean flag.
704
- * - if `force` is set to `true`, nothing will happen and no notification will be sent.
705
- * - if `force` is set to `false, the transaction will revert.
706
- *
707
- * @param to The address to call the {universalReceiver} function on.
708
- * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not.
709
- * @param lsp1Data The data to be sent to the `to` address in the `universalReceiver(...)` call.
710
- */
711
- function _notifyTokenReceiver(
712
- address to,
713
- bool force,
714
- bytes memory lsp1Data
715
- ) internal virtual {
716
- if (
717
- ERC165Checker.supportsERC165InterfaceUnchecked(
718
- to,
719
- _INTERFACEID_LSP1
720
- )
721
- ) {
722
- ILSP1(to).universalReceiver(_TYPEID_LSP7_TOKENSRECIPIENT, lsp1Data);
723
- } else if (!force) {
724
- if (to.code.length != 0) {
725
- revert LSP7NotifyTokenReceiverContractMissingLSP1Interface(to);
726
- } else {
727
- revert LSP7NotifyTokenReceiverIsEOA(to);
728
- }
729
- }
730
- }
731
- }
4
+ import "@lukso/lsp7-contracts/contracts/LSP7DigitalAssetCore.sol";