@lukso/lsp-smart-contracts 0.8.1 → 0.9.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 (72) hide show
  1. package/README.md +14 -1
  2. package/artifacts/LSP0ERC725Account.json +51 -5
  3. package/artifacts/LSP0ERC725AccountInit.json +51 -5
  4. package/artifacts/LSP11BasicSocialRecovery.json +2 -2
  5. package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
  6. package/artifacts/LSP16UniversalFactory.json +31 -2
  7. package/artifacts/LSP1UniversalReceiverDelegateUP.json +19 -35
  8. package/artifacts/LSP1UniversalReceiverDelegateVault.json +13 -13
  9. package/artifacts/LSP4Compatibility.json +7 -2
  10. package/artifacts/LSP4DigitalAssetMetadata.json +7 -2
  11. package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +7 -2
  12. package/artifacts/LSP6KeyManager.json +91 -6
  13. package/artifacts/LSP6KeyManagerInit.json +103 -18
  14. package/artifacts/LSP7CappedSupply.json +7 -2
  15. package/artifacts/LSP7CappedSupplyInitAbstract.json +7 -2
  16. package/artifacts/LSP7CompatibleERC20.json +7 -2
  17. package/artifacts/LSP7CompatibleERC20InitAbstract.json +7 -2
  18. package/artifacts/LSP7CompatibleERC20Mintable.json +9 -4
  19. package/artifacts/LSP7CompatibleERC20MintableInit.json +9 -4
  20. package/artifacts/LSP7DigitalAsset.json +7 -2
  21. package/artifacts/LSP7DigitalAssetInitAbstract.json +7 -2
  22. package/artifacts/LSP7Mintable.json +9 -4
  23. package/artifacts/LSP7MintableInit.json +9 -4
  24. package/artifacts/LSP8CappedSupply.json +7 -2
  25. package/artifacts/LSP8CappedSupplyInitAbstract.json +7 -2
  26. package/artifacts/LSP8CompatibleERC721.json +7 -2
  27. package/artifacts/LSP8CompatibleERC721InitAbstract.json +7 -2
  28. package/artifacts/LSP8CompatibleERC721Mintable.json +9 -4
  29. package/artifacts/LSP8CompatibleERC721MintableInit.json +9 -4
  30. package/artifacts/LSP8IdentifiableDigitalAsset.json +7 -2
  31. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +7 -2
  32. package/artifacts/LSP8Mintable.json +9 -4
  33. package/artifacts/LSP8MintableInit.json +9 -4
  34. package/artifacts/LSP9Vault.json +29 -5
  35. package/artifacts/LSP9VaultInit.json +29 -5
  36. package/artifacts/UniversalProfile.json +51 -5
  37. package/artifacts/UniversalProfileInit.json +51 -5
  38. package/common/constants.d.ts +50 -327
  39. package/common/constants.js +21 -17
  40. package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +27 -0
  41. package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
  42. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +344 -195
  43. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +1 -1
  44. package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +47 -51
  45. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +5 -6
  46. package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +27 -4
  47. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +36 -77
  48. package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +8 -8
  49. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +50 -55
  50. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +18 -8
  51. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +12 -0
  52. package/contracts/LSP20CallVerification/ILSP20CallVerification.sol +30 -0
  53. package/contracts/LSP20CallVerification/LSP20CallVerification.sol +74 -0
  54. package/contracts/LSP20CallVerification/LSP20Errors.sol +15 -0
  55. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +50 -56
  56. package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +1 -1
  57. package/contracts/LSP6KeyManager/LSP6Constants.sol +8 -2
  58. package/contracts/LSP6KeyManager/LSP6Errors.sol +18 -1
  59. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +83 -12
  60. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +277 -99
  61. package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +36 -9
  62. package/contracts/LSP6KeyManager/LSP6Utils.sol +30 -15
  63. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +12 -17
  64. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +12 -17
  65. package/contracts/LSP9Vault/ILSP9Vault.sol +19 -0
  66. package/contracts/LSP9Vault/LSP9Constants.sol +1 -1
  67. package/contracts/LSP9Vault/LSP9Vault.sol +11 -2
  68. package/contracts/LSP9Vault/LSP9VaultCore.sol +81 -58
  69. package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +11 -2
  70. package/module/constants.d.ts +50 -327
  71. package/module/constants.js +20 -16
  72. package/package.json +6 -4
@@ -226,7 +226,8 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
226
226
 
227
227
  emit Transfer(operator, address(0), to, amount, allowNonLSP1Recipient, data);
228
228
 
229
- _notifyTokenReceiver(address(0), to, amount, allowNonLSP1Recipient, data);
229
+ bytes memory lsp1Data = abi.encodePacked(address(0), to, amount, data);
230
+ _notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
230
231
  }
231
232
 
232
233
  /**
@@ -273,7 +274,8 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
273
274
 
274
275
  emit Transfer(operator, from, address(0), amount, false, data);
275
276
 
276
- _notifyTokenSender(from, address(0), amount, data);
277
+ bytes memory lsp1Data = abi.encodePacked(from, address(0), amount, data);
278
+ _notifyTokenSender(from, lsp1Data);
277
279
  }
278
280
 
279
281
  /**
@@ -314,8 +316,10 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
314
316
 
315
317
  emit Transfer(operator, from, to, amount, allowNonLSP1Recipient, data);
316
318
 
317
- _notifyTokenSender(from, to, amount, data);
318
- _notifyTokenReceiver(from, to, amount, allowNonLSP1Recipient, data);
319
+ bytes memory lsp1Data = abi.encodePacked(from, to, amount, data);
320
+
321
+ _notifyTokenSender(from, lsp1Data);
322
+ _notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
319
323
  }
320
324
 
321
325
  /**
@@ -340,15 +344,9 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
340
344
  * @dev An attempt is made to notify the token sender about the `amount` tokens changing owners using
341
345
  * LSP1 interface.
342
346
  */
343
- function _notifyTokenSender(
344
- address from,
345
- address to,
346
- uint256 amount,
347
- bytes memory data
348
- ) internal virtual {
347
+ function _notifyTokenSender(address from, bytes memory lsp1Data) internal virtual {
349
348
  if (ERC165Checker.supportsERC165InterfaceUnchecked(from, _INTERFACEID_LSP1)) {
350
- bytes memory packedData = abi.encodePacked(from, to, amount, data);
351
- ILSP1UniversalReceiver(from).universalReceiver(_TYPEID_LSP7_TOKENSSENDER, packedData);
349
+ ILSP1UniversalReceiver(from).universalReceiver(_TYPEID_LSP7_TOKENSSENDER, lsp1Data);
352
350
  }
353
351
  }
354
352
 
@@ -359,15 +357,12 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
359
357
  * The receiver may revert when the token being sent is not wanted.
360
358
  */
361
359
  function _notifyTokenReceiver(
362
- address from,
363
360
  address to,
364
- uint256 amount,
365
361
  bool allowNonLSP1Recipient,
366
- bytes memory data
362
+ bytes memory lsp1Data
367
363
  ) internal virtual {
368
364
  if (ERC165Checker.supportsERC165InterfaceUnchecked(to, _INTERFACEID_LSP1)) {
369
- bytes memory packedData = abi.encodePacked(from, to, amount, data);
370
- ILSP1UniversalReceiver(to).universalReceiver(_TYPEID_LSP7_TOKENSRECIPIENT, packedData);
365
+ ILSP1UniversalReceiver(to).universalReceiver(_TYPEID_LSP7_TOKENSRECIPIENT, lsp1Data);
371
366
  } else if (!allowNonLSP1Recipient) {
372
367
  if (to.code.length > 0) {
373
368
  revert LSP7NotifyTokenReceiverContractMissingLSP1Interface(to);
@@ -297,7 +297,8 @@ abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAs
297
297
 
298
298
  emit Transfer(operator, address(0), to, tokenId, allowNonLSP1Recipient, data);
299
299
 
300
- _notifyTokenReceiver(address(0), to, tokenId, allowNonLSP1Recipient, data);
300
+ bytes memory lsp1Data = abi.encodePacked(address(0), to, tokenId, data);
301
+ _notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
301
302
  }
302
303
 
303
304
  /**
@@ -325,7 +326,8 @@ abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAs
325
326
 
326
327
  emit Transfer(operator, tokenOwner, address(0), tokenId, false, data);
327
328
 
328
- _notifyTokenSender(tokenOwner, address(0), tokenId, data);
329
+ bytes memory lsp1Data = abi.encodePacked(tokenOwner, address(0), tokenId, data);
330
+ _notifyTokenSender(tokenOwner, lsp1Data);
329
331
  }
330
332
 
331
333
  /**
@@ -370,8 +372,10 @@ abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAs
370
372
 
371
373
  emit Transfer(operator, from, to, tokenId, allowNonLSP1Recipient, data);
372
374
 
373
- _notifyTokenSender(from, to, tokenId, data);
374
- _notifyTokenReceiver(from, to, tokenId, allowNonLSP1Recipient, data);
375
+ bytes memory lsp1Data = abi.encodePacked(from, to, tokenId, data);
376
+
377
+ _notifyTokenSender(from, lsp1Data);
378
+ _notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
375
379
  }
376
380
 
377
381
  /**
@@ -396,15 +400,9 @@ abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAs
396
400
  * @dev An attempt is made to notify the token sender about the `tokenId` changing owners using
397
401
  * LSP1 interface.
398
402
  */
399
- function _notifyTokenSender(
400
- address from,
401
- address to,
402
- bytes32 tokenId,
403
- bytes memory data
404
- ) internal virtual {
403
+ function _notifyTokenSender(address from, bytes memory lsp1Data) internal virtual {
405
404
  if (ERC165Checker.supportsERC165InterfaceUnchecked(from, _INTERFACEID_LSP1)) {
406
- bytes memory packedData = abi.encodePacked(from, to, tokenId, data);
407
- ILSP1UniversalReceiver(from).universalReceiver(_TYPEID_LSP8_TOKENSSENDER, packedData);
405
+ ILSP1UniversalReceiver(from).universalReceiver(_TYPEID_LSP8_TOKENSSENDER, lsp1Data);
408
406
  }
409
407
  }
410
408
 
@@ -415,15 +413,12 @@ abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAs
415
413
  * The receiver may revert when the token being sent is not wanted.
416
414
  */
417
415
  function _notifyTokenReceiver(
418
- address from,
419
416
  address to,
420
- bytes32 tokenId,
421
417
  bool allowNonLSP1Recipient,
422
- bytes memory data
418
+ bytes memory lsp1Data
423
419
  ) internal virtual {
424
420
  if (ERC165Checker.supportsERC165InterfaceUnchecked(to, _INTERFACEID_LSP1)) {
425
- bytes memory packedData = abi.encodePacked(from, to, tokenId, data);
426
- ILSP1UniversalReceiver(to).universalReceiver(_TYPEID_LSP8_TOKENSRECIPIENT, packedData);
421
+ ILSP1UniversalReceiver(to).universalReceiver(_TYPEID_LSP8_TOKENSRECIPIENT, lsp1Data);
427
422
  } else if (!allowNonLSP1Recipient) {
428
423
  if (to.code.length > 0) {
429
424
  revert LSP8NotifyTokenReceiverContractMissingLSP1Interface(to);
@@ -0,0 +1,19 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.4;
3
+
4
+ // interfaces
5
+ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
6
+ import {IERC725X} from "@erc725/smart-contracts/contracts/interfaces/IERC725X.sol";
7
+ import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
8
+ import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
9
+ import {ILSP14Ownable2Step} from "../LSP14Ownable2Step/ILSP14Ownable2Step.sol";
10
+
11
+ /**
12
+ * @title Interface of LSP9Vault built on top of ERC725, LSP1UniversalReceiver
13
+ */
14
+ interface ILSP9Vault is IERC165, IERC725X, IERC725Y, ILSP1UniversalReceiver, ILSP14Ownable2Step {
15
+ /**
16
+ * @dev Receives and executes a batch of function calls on this contract.
17
+ */
18
+ function batchCalls(bytes[] calldata data) external returns (bytes[] memory results);
19
+ }
@@ -2,7 +2,7 @@
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  // --- ERC165 interface ids
5
- bytes4 constant _INTERFACEID_LSP9 = 0x7050cee9;
5
+ bytes4 constant _INTERFACEID_LSP9 = 0x19331ad1;
6
6
 
7
7
  // --- ERC725Y Data Keys
8
8
 
@@ -9,12 +9,16 @@ import {OwnableUnset} from "@erc725/smart-contracts/contracts/custom/OwnableUnse
9
9
  import {ERC725} from "@erc725/smart-contracts/contracts/ERC725.sol";
10
10
  import {LSP9VaultCore} from "./LSP9VaultCore.sol";
11
11
 
12
+ // libraries
13
+ import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
14
+
12
15
  // constants
13
16
  import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
14
17
  import {
15
18
  _INTERFACEID_LSP9,
16
19
  _LSP9_SUPPORTED_STANDARDS_KEY,
17
- _LSP9_SUPPORTED_STANDARDS_VALUE
20
+ _LSP9_SUPPORTED_STANDARDS_VALUE,
21
+ _TYPEID_LSP9_OwnershipTransferred_RecipientNotification
18
22
  } from "../LSP9Vault/LSP9Constants.sol";
19
23
 
20
24
  /**
@@ -23,6 +27,8 @@ import {
23
27
  * @dev Could be owned by a UniversalProfile and able to register received asset with UniversalReceiverDelegateVault
24
28
  */
25
29
  contract LSP9Vault is LSP9VaultCore {
30
+ using LSP1Utils for address;
31
+
26
32
  /**
27
33
  * @notice Sets the owner of the contract and sets the SupportedStandards:LSP9Vault key
28
34
  * @param newOwner the owner of the contract
@@ -35,6 +41,9 @@ contract LSP9Vault is LSP9VaultCore {
35
41
  // set key SupportedStandards:LSP9Vault
36
42
  _setData(_LSP9_SUPPORTED_STANDARDS_KEY, _LSP9_SUPPORTED_STANDARDS_VALUE);
37
43
 
38
- _notifyLSP1RecipientOnOwnershipTransferCompletion(newOwner, "");
44
+ newOwner.tryNotifyUniversalReceiver(
45
+ _TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
46
+ ""
47
+ );
39
48
  }
40
49
  }
@@ -211,6 +211,33 @@ contract LSP9VaultCore is
211
211
  _supportsInterfaceInERC165Extension(interfaceId);
212
212
  }
213
213
 
214
+ /**
215
+ * @dev Receives and executes a batch of function calls on this contract.
216
+ */
217
+ function batchCalls(bytes[] calldata data) public returns (bytes[] memory results) {
218
+ results = new bytes[](data.length);
219
+ for (uint256 i; i < data.length; i = GasLib.uncheckedIncrement(i)) {
220
+ (bool success, bytes memory result) = address(this).delegatecall(data[i]);
221
+
222
+ if (!success) {
223
+ // Look for revert reason and bubble it up if present
224
+ if (result.length > 0) {
225
+ // The easiest way to bubble the revert reason is using memory via assembly
226
+ // solhint-disable no-inline-assembly
227
+ /// @solidity memory-safe-assembly
228
+ assembly {
229
+ let returndata_size := mload(result)
230
+ revert(add(32, result), returndata_size)
231
+ }
232
+ } else {
233
+ revert("LSP9: batchCalls reverted");
234
+ }
235
+ }
236
+
237
+ results[i] = result;
238
+ }
239
+ }
240
+
214
241
  /**
215
242
  * @inheritdoc IERC725X
216
243
  * @param operationType The operation to execute: CALL = 0 CREATE = 1 CREATE2 = 2 STATICCALL = 3
@@ -254,7 +281,9 @@ contract LSP9VaultCore is
254
281
  *
255
282
  * Emits a {DataChanged} event.
256
283
  */
257
- function setData(bytes32 dataKey, bytes memory dataValue) public virtual override {
284
+ function setData(bytes32 dataKey, bytes memory dataValue) public payable virtual override {
285
+ if (msg.value != 0) revert ERC725Y_MsgValueDisallowed();
286
+
258
287
  bool isURD = _validateAndIdentifyCaller();
259
288
  if (isURD) {
260
289
  if (
@@ -276,12 +305,19 @@ contract LSP9VaultCore is
276
305
  *
277
306
  * Emits a {DataChanged} event.
278
307
  */
279
- function setData(bytes32[] memory dataKeys, bytes[] memory dataValues) public virtual override {
308
+ function setData(bytes32[] memory dataKeys, bytes[] memory dataValues)
309
+ public
310
+ payable
311
+ virtual
312
+ override
313
+ {
280
314
  bool isURD = _validateAndIdentifyCaller();
281
315
  if (dataKeys.length != dataValues.length) {
282
316
  revert ERC725Y_DataKeysValuesLengthMismatch(dataKeys.length, dataValues.length);
283
317
  }
284
318
 
319
+ if (msg.value != 0) revert ERC725Y_MsgValueDisallowed();
320
+
285
321
  for (uint256 i = 0; i < dataKeys.length; i = GasLib.uncheckedIncrement(i)) {
286
322
  if (isURD) {
287
323
  if (
@@ -373,21 +409,59 @@ contract LSP9VaultCore is
373
409
  }
374
410
 
375
411
  /**
376
- * @dev Sets the pending owner and notify the pending owner
412
+ * @inheritdoc LSP14Ownable2Step
413
+ *
414
+ * @dev same as ILSP14.transferOwnership with the additional requirement:
377
415
  *
378
- * @param _newOwner The address nofied and set as `pendingOwner`
416
+ * Requirements:
417
+ * - when notifying the new owner via LSP1, the typeId used MUST be keccak256('LSP9OwnershipTransferStarted')
379
418
  */
380
- function transferOwnership(address _newOwner)
419
+ function transferOwnership(address newOwner)
381
420
  public
382
421
  virtual
383
422
  override(LSP14Ownable2Step, OwnableUnset)
384
423
  onlyOwner
385
424
  {
386
- LSP14Ownable2Step._transferOwnership(_newOwner);
425
+ LSP14Ownable2Step._transferOwnership(newOwner);
426
+
427
+ address currentOwner = owner();
428
+ emit OwnershipTransferStarted(currentOwner, newOwner);
429
+
430
+ newOwner.tryNotifyUniversalReceiver(_TYPEID_LSP9_OwnershipTransferStarted, "");
431
+
432
+ require(
433
+ currentOwner == owner(),
434
+ "LSP14: newOwner MUST accept ownership in a separate transaction"
435
+ );
436
+ }
437
+
438
+ /**
439
+ * @inheritdoc LSP14Ownable2Step
440
+ *
441
+ * @dev same as ILSP14.acceptOwnership with the additional requirement:
442
+ *
443
+ * Requirements:
444
+ * - when notifying the previous owner via LSP1, the typeId used MUST be keccak256('LSP9OwnershipTransferred_SenderNotification')
445
+ * - when notifying the new owner via LSP1, the typeId used MUST be keccak256('LSP9OwnershipTransferred_RecipientNotification')
446
+ */
447
+ function acceptOwnership() public virtual override {
448
+ address previousOwner = owner();
449
+
450
+ _acceptOwnership();
451
+
452
+ previousOwner.tryNotifyUniversalReceiver(
453
+ _TYPEID_LSP9_OwnershipTransferred_SenderNotification,
454
+ ""
455
+ );
456
+
457
+ msg.sender.tryNotifyUniversalReceiver(
458
+ _TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
459
+ ""
460
+ );
387
461
  }
388
462
 
389
463
  /**
390
- * @dev Renounce ownership of the contract in a 2-step process
464
+ * @inheritdoc LSP14Ownable2Step
391
465
  */
392
466
  function renounceOwnership()
393
467
  public
@@ -445,55 +519,4 @@ contract LSP9VaultCore is
445
519
 
446
520
  revert ERC725X_UnknownOperationType(operationType);
447
521
  }
448
-
449
- // --- LSP14 URD Hooks
450
-
451
- /**
452
- * @dev Calls the universalReceiver function of the sender when ownerhsip transfer starts
453
- * if supports LSP1 InterfaceId
454
- */
455
- function _notifyLSP1SenderOnOwnershipTransferStart(address notifiedContract, bytes memory data)
456
- internal
457
- virtual
458
- override
459
- {
460
- if (ERC165Checker.supportsERC165InterfaceUnchecked(notifiedContract, _INTERFACEID_LSP1)) {
461
- ILSP1UniversalReceiver(notifiedContract).universalReceiver(
462
- _TYPEID_LSP9_OwnershipTransferStarted,
463
- data
464
- );
465
- }
466
- }
467
-
468
- /**
469
- * @dev Calls the universalReceiver function of the sender when ownerhsip transfer is complete
470
- * if supports LSP1 InterfaceId
471
- */
472
- function _notifyLSP1SenderOnOwnershipTransferCompletion(
473
- address notifiedContract,
474
- bytes memory data
475
- ) internal virtual override {
476
- if (ERC165Checker.supportsERC165InterfaceUnchecked(notifiedContract, _INTERFACEID_LSP1)) {
477
- ILSP1UniversalReceiver(notifiedContract).universalReceiver(
478
- _TYPEID_LSP9_OwnershipTransferred_SenderNotification,
479
- data
480
- );
481
- }
482
- }
483
-
484
- /**
485
- * @dev Calls the universalReceiver function of the recipient when ownerhsip transfer is complete
486
- * if supports LSP1 InterfaceId
487
- */
488
- function _notifyLSP1RecipientOnOwnershipTransferCompletion(
489
- address notifiedContract,
490
- bytes memory data
491
- ) internal virtual override {
492
- if (ERC165Checker.supportsERC165InterfaceUnchecked(notifiedContract, _INTERFACEID_LSP1)) {
493
- ILSP1UniversalReceiver(notifiedContract).universalReceiver(
494
- _TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
495
- data
496
- );
497
- }
498
- }
499
522
  }
@@ -9,12 +9,16 @@ import {OwnableUnset} from "@erc725/smart-contracts/contracts/custom/OwnableUnse
9
9
  import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
10
10
  import {LSP9VaultCore} from "./LSP9VaultCore.sol";
11
11
 
12
+ // libraries
13
+ import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
14
+
12
15
  // constants
13
16
  import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
14
17
  import {
15
18
  _INTERFACEID_LSP9,
16
19
  _LSP9_SUPPORTED_STANDARDS_KEY,
17
- _LSP9_SUPPORTED_STANDARDS_VALUE
20
+ _LSP9_SUPPORTED_STANDARDS_VALUE,
21
+ _TYPEID_LSP9_OwnershipTransferred_RecipientNotification
18
22
  } from "../LSP9Vault/LSP9Constants.sol";
19
23
 
20
24
  /**
@@ -23,6 +27,8 @@ import {
23
27
  * @dev Could be owned by a UniversalProfile and able to register received asset with UniversalReceiverDelegateVault
24
28
  */
25
29
  abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
30
+ using LSP1Utils for address;
31
+
26
32
  function _initialize(address newOwner) internal virtual onlyInitializing {
27
33
  if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
28
34
  OwnableUnset._setOwner(newOwner);
@@ -30,6 +36,9 @@ abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
30
36
  // set key SupportedStandards:LSP9Vault
31
37
  _setData(_LSP9_SUPPORTED_STANDARDS_KEY, _LSP9_SUPPORTED_STANDARDS_VALUE);
32
38
 
33
- _notifyLSP1RecipientOnOwnershipTransferCompletion(newOwner, "");
39
+ newOwner.tryNotifyUniversalReceiver(
40
+ _TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
41
+ ""
42
+ );
34
43
  }
35
44
  }