@lukso/lsp-smart-contracts 0.12.0-rc.0 → 0.12.1

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 (119) hide show
  1. package/artifacts/LSP0ERC725Account.json +18 -24
  2. package/artifacts/LSP0ERC725AccountInit.json +18 -24
  3. package/artifacts/LSP1UniversalReceiverDelegateUP.json +15 -2
  4. package/artifacts/LSP1UniversalReceiverDelegateVault.json +15 -2
  5. package/artifacts/LSP6KeyManager.json +25 -2
  6. package/artifacts/LSP6KeyManagerInit.json +25 -2
  7. package/artifacts/LSP7CappedSupply.json +22 -0
  8. package/artifacts/LSP7CappedSupplyInitAbstract.json +22 -0
  9. package/artifacts/LSP7CompatibleERC20.json +22 -0
  10. package/artifacts/LSP7CompatibleERC20InitAbstract.json +22 -0
  11. package/artifacts/LSP7CompatibleERC20Mintable.json +24 -2
  12. package/artifacts/LSP7CompatibleERC20MintableInit.json +24 -2
  13. package/artifacts/LSP7DigitalAsset.json +22 -0
  14. package/artifacts/LSP7DigitalAssetInitAbstract.json +22 -0
  15. package/artifacts/LSP7Mintable.json +24 -2
  16. package/artifacts/LSP7MintableInit.json +24 -2
  17. package/artifacts/LSP8CappedSupply.json +11 -0
  18. package/artifacts/LSP8CappedSupplyInitAbstract.json +11 -0
  19. package/artifacts/LSP8CompatibleERC721.json +11 -0
  20. package/artifacts/LSP8CompatibleERC721InitAbstract.json +11 -0
  21. package/artifacts/LSP8CompatibleERC721Mintable.json +13 -2
  22. package/artifacts/LSP8CompatibleERC721MintableInit.json +13 -2
  23. package/artifacts/LSP8IdentifiableDigitalAsset.json +11 -0
  24. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +11 -0
  25. package/artifacts/LSP8Mintable.json +13 -2
  26. package/artifacts/LSP8MintableInit.json +13 -2
  27. package/artifacts/LSP9Vault.json +15 -21
  28. package/artifacts/LSP9VaultInit.json +15 -21
  29. package/artifacts/UniversalProfile.json +18 -24
  30. package/artifacts/UniversalProfileInit.json +18 -24
  31. package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +0 -8
  32. package/contracts/LSP0ERC725Account/LSP0Constants.sol +6 -1
  33. package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +18 -4
  34. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +132 -66
  35. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +3 -2
  36. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +14 -3
  37. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +11 -10
  38. package/contracts/LSP17ContractExtension/LSP17Extendable.sol +12 -8
  39. package/contracts/LSP17ContractExtension/LSP17Extension.sol +2 -1
  40. package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +2 -1
  41. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +32 -11
  42. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +25 -9
  43. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +4 -3
  44. package/contracts/LSP20CallVerification/LSP20CallVerification.sol +43 -49
  45. package/contracts/LSP20CallVerification/LSP20Errors.sol +2 -2
  46. package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +1 -5
  47. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +2 -1
  48. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +54 -8
  49. package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +2 -1
  50. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +14 -16
  51. package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +9 -5
  52. package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +60 -0
  53. package/contracts/LSP7DigitalAsset/LSP7Constants.sol +1 -1
  54. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +7 -5
  55. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +111 -175
  56. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +7 -5
  57. package/contracts/LSP7DigitalAsset/LSP7Errors.sol +5 -0
  58. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +8 -1
  59. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +7 -1
  60. package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +5 -0
  61. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +8 -5
  62. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +6 -5
  63. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +30 -73
  64. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +6 -5
  65. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +7 -7
  66. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +7 -7
  67. package/contracts/LSP9Vault/ILSP9Vault.sol +0 -8
  68. package/contracts/LSP9Vault/LSP9Constants.sol +6 -1
  69. package/contracts/LSP9Vault/LSP9Vault.sol +14 -4
  70. package/contracts/LSP9Vault/LSP9VaultCore.sol +80 -37
  71. package/contracts/LSP9Vault/LSP9VaultInit.sol +3 -2
  72. package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +12 -3
  73. package/contracts/UniversalProfile.sol +5 -3
  74. package/contracts/UniversalProfileInit.sol +9 -6
  75. package/contracts/UniversalProfileInitAbstract.sol +5 -3
  76. package/contracts/Version.sol +17 -0
  77. package/devdocs/LSP0ERC725Account.json +11 -10
  78. package/devdocs/LSP0ERC725AccountInit.json +10 -9
  79. package/devdocs/LSP6KeyManager.json +11 -0
  80. package/devdocs/LSP6KeyManagerInit.json +11 -0
  81. package/devdocs/LSP7CappedSupply.json +10 -10
  82. package/devdocs/LSP7CappedSupplyInitAbstract.json +10 -10
  83. package/devdocs/LSP7CompatibleERC20.json +10 -10
  84. package/devdocs/LSP7CompatibleERC20InitAbstract.json +10 -10
  85. package/devdocs/LSP7CompatibleERC20Mintable.json +10 -10
  86. package/devdocs/LSP7CompatibleERC20MintableInit.json +10 -10
  87. package/devdocs/LSP7DigitalAsset.json +10 -10
  88. package/devdocs/LSP7DigitalAssetInitAbstract.json +10 -10
  89. package/devdocs/LSP7Mintable.json +10 -10
  90. package/devdocs/LSP7MintableInit.json +10 -10
  91. package/devdocs/LSP8CappedSupply.json +3 -2
  92. package/devdocs/LSP8CappedSupplyInitAbstract.json +3 -2
  93. package/devdocs/LSP8CompatibleERC721.json +3 -2
  94. package/devdocs/LSP8CompatibleERC721InitAbstract.json +3 -2
  95. package/devdocs/LSP8CompatibleERC721Mintable.json +3 -2
  96. package/devdocs/LSP8CompatibleERC721MintableInit.json +3 -2
  97. package/devdocs/LSP8IdentifiableDigitalAsset.json +3 -2
  98. package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +3 -2
  99. package/devdocs/LSP8Mintable.json +3 -2
  100. package/devdocs/LSP8MintableInit.json +3 -2
  101. package/devdocs/LSP9Vault.json +6 -6
  102. package/devdocs/LSP9VaultInit.json +6 -6
  103. package/devdocs/UniversalProfile.json +11 -10
  104. package/devdocs/UniversalProfileInit.json +11 -10
  105. package/dist/constants.cjs.js +822 -459
  106. package/dist/constants.d.ts +633 -298
  107. package/dist/constants.es.js +822 -459
  108. package/package.json +1 -3
  109. package/userdocs/LSP0ERC725Account.json +3 -3
  110. package/userdocs/LSP0ERC725AccountInit.json +3 -3
  111. package/userdocs/LSP1UniversalReceiverDelegateUP.json +3 -0
  112. package/userdocs/LSP1UniversalReceiverDelegateVault.json +3 -0
  113. package/userdocs/LSP6KeyManager.json +3 -0
  114. package/userdocs/LSP6KeyManagerInit.json +3 -0
  115. package/userdocs/LSP9Vault.json +3 -3
  116. package/userdocs/LSP9VaultInit.json +3 -3
  117. package/userdocs/UniversalProfile.json +3 -3
  118. package/userdocs/UniversalProfileInit.json +3 -3
  119. package/CONTRIBUTING.md +0 -188
@@ -55,6 +55,7 @@ import {
55
55
  } from "../LSP6KeyManager/LSP6Constants.sol";
56
56
  import {
57
57
  _INTERFACEID_LSP9,
58
+ _TYPEID_LSP9_VALUE_RECEIVED,
58
59
  _TYPEID_LSP9_OwnershipTransferStarted,
59
60
  _TYPEID_LSP9_OwnershipTransferred_SenderNotification,
60
61
  _TYPEID_LSP9_OwnershipTransferred_RecipientNotification
@@ -94,10 +95,12 @@ contract LSP9VaultCore is
94
95
  * - When receiving some native tokens without any additional data.
95
96
  * - On empty calls to the contract.
96
97
  *
97
- * @custom:events {ValueReceived} when receiving native tokens.
98
+ * @custom:events {UniversalReceiver} when receiving native tokens.
98
99
  */
99
100
  receive() external payable virtual {
100
- if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
101
+ if (msg.value != 0) {
102
+ universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, "");
103
+ }
101
104
  }
102
105
 
103
106
  /**
@@ -119,17 +122,16 @@ contract LSP9VaultCore is
119
122
  *
120
123
  * 2. If the data sent to this function is of length less than 4 bytes (not a function selector), return.
121
124
  *
122
- * @custom:events {ValueReceived} event when receiving native tokens.
125
+ * @custom:events {UniversalReceiver} event when receiving native tokens and extension function selector is not found or not payable.
123
126
  */
124
127
  // solhint-disable-next-line no-complex-fallback
125
128
  fallback(
126
129
  bytes calldata callData
127
130
  ) external payable virtual returns (bytes memory) {
128
- if (msg.value != 0) {
129
- emit ValueReceived(msg.sender, msg.value);
130
- }
131
-
132
131
  if (msg.data.length < 4) {
132
+ // if value is associated with the extension call, use the universalReceiver
133
+ if (msg.value != 0)
134
+ universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, callData);
133
135
  return "";
134
136
  }
135
137
 
@@ -185,7 +187,7 @@ contract LSP9VaultCore is
185
187
  * @custom:events
186
188
  * - {Executed} event for each call that uses under `operationType`: `CALL` (0) and `STATICCALL` (3).
187
189
  * - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2).
188
- * - {ValueReceived} event when receiving native tokens.
190
+ * - {UniversalReceiver} event when receiving native tokens.
189
191
  *
190
192
  * @custom:info The `operationType` 4 `DELEGATECALL` is disabled by default in the LSP9 Vault.
191
193
  */
@@ -195,7 +197,15 @@ contract LSP9VaultCore is
195
197
  uint256 value,
196
198
  bytes memory data
197
199
  ) public payable virtual override onlyOwner returns (bytes memory) {
198
- if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
200
+ if (msg.value != 0) {
201
+ emit UniversalReceiver(
202
+ msg.sender,
203
+ msg.value,
204
+ _TYPEID_LSP9_VALUE_RECEIVED,
205
+ abi.encodePacked(msg.sig),
206
+ ""
207
+ );
208
+ }
199
209
  return _execute(operationType, target, value, data);
200
210
  }
201
211
 
@@ -212,7 +222,7 @@ contract LSP9VaultCore is
212
222
  * @custom:events
213
223
  * - {Executed} event for each call that uses under `operationType`: `CALL` (0) and `STATICCALL` (3). (each iteration)
214
224
  * - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). (each iteration)
215
- * - {ValueReceived} event when receiving native tokens.
225
+ * - {UniversalReceiver} event when receiving native tokens.
216
226
  *
217
227
  * @custom:info The `operationType` 4 `DELEGATECALL` is disabled by default in the LSP9 Vault.
218
228
  */
@@ -222,7 +232,15 @@ contract LSP9VaultCore is
222
232
  uint256[] memory values,
223
233
  bytes[] memory datas
224
234
  ) public payable virtual override onlyOwner returns (bytes[] memory) {
225
- if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
235
+ if (msg.value != 0) {
236
+ emit UniversalReceiver(
237
+ msg.sender,
238
+ msg.value,
239
+ _TYPEID_LSP9_VALUE_RECEIVED,
240
+ abi.encodePacked(msg.sig),
241
+ ""
242
+ );
243
+ }
226
244
  return _executeBatch(operationsType, targets, values, datas);
227
245
  }
228
246
 
@@ -232,7 +250,6 @@ contract LSP9VaultCore is
232
250
  * @custom:requirements Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
233
251
  *
234
252
  * @custom:events
235
- * - {ValueReceived} event when receiving native tokens.
236
253
  * - {DataChanged} event.
237
254
  */
238
255
  function setData(
@@ -260,7 +277,6 @@ contract LSP9VaultCore is
260
277
  * @custom:requirements Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
261
278
  *
262
279
  * @custom:events
263
- * - {ValueReceived} event when receiving native tokens.
264
280
  * - {DataChanged} event. (on each iteration of setting data)
265
281
  */
266
282
  function setDataBatch(
@@ -320,15 +336,14 @@ contract LSP9VaultCore is
320
336
  * @return returnedValues The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call.
321
337
  *
322
338
  * @custom:events
323
- * - {ValueReceived} when receiving native tokens.
324
339
  * - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.
325
340
  */
326
341
  function universalReceiver(
327
342
  bytes32 typeId,
328
- bytes calldata receivedData
343
+ bytes memory receivedData
329
344
  ) public payable virtual override returns (bytes memory returnedValues) {
330
- if (msg.value != 0) {
331
- emit ValueReceived(msg.sender, msg.value);
345
+ if (msg.value != 0 && (typeId != _TYPEID_LSP9_VALUE_RECEIVED)) {
346
+ universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, msg.data);
332
347
  }
333
348
 
334
349
  bytes memory lsp1DelegateValue = _getData(
@@ -421,9 +436,9 @@ contract LSP9VaultCore is
421
436
  address currentOwner = owner();
422
437
  emit OwnershipTransferStarted(currentOwner, newOwner);
423
438
 
424
- newOwner.tryNotifyUniversalReceiver(
439
+ newOwner.notifyUniversalReceiver(
425
440
  _TYPEID_LSP9_OwnershipTransferStarted,
426
- ""
441
+ abi.encode(currentOwner, newOwner)
427
442
  );
428
443
 
429
444
  // reset the transfer ownership lock
@@ -438,19 +453,19 @@ contract LSP9VaultCore is
438
453
  * - When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification].
439
454
  * - When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].
440
455
  */
441
- function acceptOwnership() public virtual override NotInTransferOwnership {
456
+ function acceptOwnership() public virtual override notInTransferOwnership {
442
457
  address previousOwner = owner();
443
458
 
444
459
  _acceptOwnership();
445
460
 
446
- previousOwner.tryNotifyUniversalReceiver(
461
+ previousOwner.notifyUniversalReceiver(
447
462
  _TYPEID_LSP9_OwnershipTransferred_SenderNotification,
448
- ""
463
+ abi.encode(previousOwner, msg.sender)
449
464
  );
450
465
 
451
- msg.sender.tryNotifyUniversalReceiver(
466
+ msg.sender.notifyUniversalReceiver(
452
467
  _TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
453
- ""
468
+ abi.encode(previousOwner, msg.sender)
454
469
  );
455
470
  }
456
471
 
@@ -471,9 +486,9 @@ contract LSP9VaultCore is
471
486
  LSP14Ownable2Step._renounceOwnership();
472
487
 
473
488
  if (owner() == address(0)) {
474
- previousOwner.tryNotifyUniversalReceiver(
489
+ previousOwner.notifyUniversalReceiver(
475
490
  _TYPEID_LSP9_OwnershipTransferred_SenderNotification,
476
- ""
491
+ abi.encode(previousOwner, address(0))
477
492
  );
478
493
  }
479
494
  }
@@ -512,8 +527,9 @@ contract LSP9VaultCore is
512
527
  /**
513
528
  * @dev Forwards the call to an extension mapped to a function selector.
514
529
  *
515
- * Calls {_getExtension} to get the address of the extension mapped to the function selector being
530
+ * Calls {_getExtensionAndForwardValue} to get the address of the extension mapped to the function selector being
516
531
  * called on the account. If there is no extension, the `address(0)` will be returned.
532
+ * Forwards the value if the extension is payable.
517
533
  *
518
534
  * Reverts if there is no extension for the function being called, except for the `bytes4(0)` function selector, which passes even if there is no extension for it.
519
535
  *
@@ -533,7 +549,14 @@ contract LSP9VaultCore is
533
549
  bytes calldata callData
534
550
  ) internal virtual override returns (bytes memory) {
535
551
  // If there is a function selector
536
- address extension = _getExtension(msg.sig);
552
+ (
553
+ address extension,
554
+ bool isForwardingValue
555
+ ) = _getExtensionAndForwardValue(msg.sig);
556
+
557
+ // if value is associated with the extension call and function selector is not payable, use the universalReceiver
558
+ if (msg.value != 0 && !isForwardingValue)
559
+ universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, callData);
537
560
 
538
561
  // if no extension was found for bytes4(0) return don't revert
539
562
  if (msg.sig == bytes4(0) && extension == address(0)) return "";
@@ -542,9 +565,9 @@ contract LSP9VaultCore is
542
565
  if (extension == address(0))
543
566
  revert NoExtensionFoundForFunctionSelector(msg.sig);
544
567
 
545
- (bool success, bytes memory result) = extension.call(
546
- abi.encodePacked(callData, msg.sender, msg.value)
547
- );
568
+ (bool success, bytes memory result) = extension.call{
569
+ value: isForwardingValue ? msg.value : 0
570
+ }(abi.encodePacked(callData, msg.sender, msg.value));
548
571
 
549
572
  if (success) {
550
573
  return result;
@@ -565,22 +588,42 @@ contract LSP9VaultCore is
565
588
  * - {_LSP17_EXTENSION_PREFIX} + `<bytes4>` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
566
589
  * - If no extension is stored, returns the address(0).
567
590
  */
568
- function _getExtension(
591
+ function _getExtensionAndForwardValue(
569
592
  bytes4 functionSelector
570
- ) internal view virtual override returns (address) {
593
+ ) internal view virtual override returns (address, bool) {
594
+ // Generate the data key relevant for the functionSelector being called
571
595
  bytes32 mappedExtensionDataKey = LSP2Utils.generateMappingKey(
572
596
  _LSP17_EXTENSION_PREFIX,
573
597
  functionSelector
574
598
  );
575
599
 
576
- // Check if there is an extension for the function selector provided
577
- address extension = address(bytes20(_getData(mappedExtensionDataKey)));
600
+ bytes memory extensionData = ERC725YCore._getData(
601
+ mappedExtensionDataKey
602
+ );
603
+
604
+ // Prevent casting data shorter than 20 bytes to an address to avoid
605
+ // unintentionally calling a different extension, return address(0) instead.
606
+ if (extensionData.length < 20) {
607
+ return (address(0), false);
608
+ }
609
+
610
+ // CHECK if the `extensionData` is 21 bytes long
611
+ // - 20 bytes = extension's address
612
+ // - 1 byte `0x01` as a boolean indicating if the contract should forward the value to the extension or not
613
+ if (extensionData.length == 21) {
614
+ // If the last byte is set to `0x01` (`true`)
615
+ // this indicates that the contract should forward the value to the extension
616
+ if (extensionData[20] == 0x01) {
617
+ // Return the address of the extension
618
+ return (address(bytes20(extensionData)), true);
619
+ }
620
+ }
578
621
 
579
- return extension;
622
+ return (address(bytes20(extensionData)), false);
580
623
  }
581
624
 
582
625
  /**
583
- * @dev Modifier restricting the call to the owner of the contract and the UniversalReceiverDelegate
626
+ * @dev Internal method restricting the call to the owner of the contract and the UniversalReceiverDelegate
584
627
  */
585
628
  function _validateAndIdentifyCaller()
586
629
  internal
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  // modules
5
+ import {Version} from "../Version.sol";
5
6
  import {LSP9VaultInitAbstract} from "./LSP9VaultInitAbstract.sol";
6
7
 
7
8
  /**
@@ -9,7 +10,7 @@ import {LSP9VaultInitAbstract} from "./LSP9VaultInitAbstract.sol";
9
10
  * @author Fabian Vogelsteller, Yamen Merhi, Jean Cavallera
10
11
  * @dev Could be owned by a UniversalProfile and able to register received asset with UniversalReceiverDelegateVault
11
12
  */
12
- contract LSP9VaultInit is LSP9VaultInitAbstract {
13
+ contract LSP9VaultInit is LSP9VaultInitAbstract, Version {
13
14
  /**
14
15
  * @dev initialize (= lock) base implementation contract on deployment
15
16
  */
@@ -24,7 +25,7 @@ contract LSP9VaultInit is LSP9VaultInitAbstract {
24
25
  * @param newOwner The new owner of the contract.
25
26
  *
26
27
  * @custom:events
27
- * - {ValueReceived} event when funding the contract on deployment.
28
+ * - {UniversalReceiver} event when funding the contract on deployment.
28
29
  * - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
29
30
  * - {DataChanged} event when updating the {_LSP9_SUPPORTED_STANDARDS_KEY}.
30
31
  * - {UniversalReceiver} event when notifying the `initialOwner`.
@@ -17,6 +17,7 @@ import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
17
17
  import {
18
18
  _LSP9_SUPPORTED_STANDARDS_KEY,
19
19
  _LSP9_SUPPORTED_STANDARDS_VALUE,
20
+ _TYPEID_LSP9_VALUE_RECEIVED,
20
21
  _TYPEID_LSP9_OwnershipTransferred_RecipientNotification
21
22
  } from "../LSP9Vault/LSP9Constants.sol";
22
23
 
@@ -36,13 +37,21 @@ abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
36
37
  * @custom:warning ERC725X & ERC725Y parent contracts are not initialised as they don't have non-zero initial state. If you decide to add non-zero initial state to any of those contracts, you must initialize them here.
37
38
  *
38
39
  * @custom:events
39
- * - {ValueReceived} event when funding the contract on deployment.
40
+ * - {UniversalReceiver} event when funding the contract on deployment.
40
41
  * - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
41
42
  * - {DataChanged} event when updating the {_LSP9_SUPPORTED_STANDARDS_KEY}.
42
43
  * - {UniversalReceiver} event when notifying the `initialOwner`.
43
44
  */
44
45
  function _initialize(address newOwner) internal virtual onlyInitializing {
45
- if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
46
+ if (msg.value != 0) {
47
+ emit UniversalReceiver(
48
+ msg.sender,
49
+ msg.value,
50
+ _TYPEID_LSP9_VALUE_RECEIVED,
51
+ "",
52
+ ""
53
+ );
54
+ }
46
55
  OwnableUnset._setOwner(newOwner);
47
56
 
48
57
  // set key SupportedStandards:LSP9Vault
@@ -51,7 +60,7 @@ abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
51
60
  _LSP9_SUPPORTED_STANDARDS_VALUE
52
61
  );
53
62
 
54
- newOwner.tryNotifyUniversalReceiver(
63
+ newOwner.notifyUniversalReceiver(
55
64
  _TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
56
65
  ""
57
66
  );
@@ -19,17 +19,19 @@ contract UniversalProfile is LSP0ERC725Account {
19
19
  /**
20
20
  * @notice Deploying a UniversalProfile contract with owner set to address `initialOwner`.
21
21
  *
22
- * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store. The `constructor` also allows funding the contract on deployment.
22
+ * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
23
+ * - The `constructor` is payable and allows funding the contract on deployment.
24
+ * - The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
23
25
  *
24
26
  * @param initialOwner the owner of the contract
25
27
  *
26
28
  * @custom:events
27
- * - {ValueReceived} event when funding the contract on deployment.
29
+ * - {UniversalReceiver} event when funding the contract on deployment.
28
30
  * - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
29
31
  * - {DataChanged} event when setting the {_LSP3_SUPPORTED_STANDARDS_KEY}.
30
32
  */
31
33
  constructor(address initialOwner) payable LSP0ERC725Account(initialOwner) {
32
- // set data key SupportedStandards:LSP3UniversalProfile
34
+ // set data key SupportedStandards:LSP3Profile
33
35
  _setData(
34
36
  _LSP3_SUPPORTED_STANDARDS_KEY,
35
37
  _LSP3_SUPPORTED_STANDARDS_VALUE
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  // modules
5
+ import {Version} from "./Version.sol";
5
6
  import {UniversalProfileInitAbstract} from "./UniversalProfileInitAbstract.sol";
6
7
 
7
8
  /**
@@ -9,12 +10,11 @@ import {UniversalProfileInitAbstract} from "./UniversalProfileInitAbstract.sol";
9
10
  * @author Fabian Vogelsteller <fabian@lukso.network>
10
11
  * @dev Implementation of the ERC725Account + LSP1 universalReceiver
11
12
  */
12
- contract UniversalProfileInit is UniversalProfileInitAbstract {
13
+ contract UniversalProfileInit is UniversalProfileInitAbstract, Version {
13
14
  /**
14
15
  * @notice deploying a `UniversalProfileInit` base contract to be used behind proxy
15
- * @dev Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone
16
- * after it has been deployed. This is intended so that the sole purpose of this contract is to be used as a base
17
- * contract behind a proxy.
16
+ * @dev Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone after it has been deployed.
17
+ * This is intended so that the sole purpose of this contract is to be used as a base contract behind a proxy.
18
18
  */
19
19
  constructor() {
20
20
  _disableInitializers();
@@ -23,13 +23,16 @@ contract UniversalProfileInit is UniversalProfileInitAbstract {
23
23
  /**
24
24
  * @notice Initializing a UniversalProfile contract with owner set to address `initialOwner`.
25
25
  *
26
- * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store. The `constructor` also allows funding the contract on deployment. The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier. The `initialize(address)` function also allows funding the contract on initialization.
26
+ * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
27
+ * - The `initialize(address)` function is payable and allows funding the contract on initialization.
28
+ * - The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
27
29
  *
28
30
  * @param initialOwner the owner of the contract
29
31
  *
30
32
  * @custom:events
31
- * - {ValueReceived} event when funding the contract on deployment.
33
+ * - {UniversalReceiver} event when funding the contract on deployment.
32
34
  * - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
35
+ * - {DataChanged} event when setting the {_LSP3_SUPPORTED_STANDARDS_KEY}.
33
36
  */
34
37
  function initialize(
35
38
  address initialOwner
@@ -21,22 +21,24 @@ abstract contract UniversalProfileInitAbstract is
21
21
  LSP0ERC725AccountInitAbstract
22
22
  {
23
23
  /**
24
- * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store.
24
+ * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
25
+ * The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
25
26
  *
26
27
  * @param initialOwner The owner of the contract.
27
28
  *
28
29
  * @custom:warning ERC725X & ERC725Y parent contracts are not initialised as they don't have non-zero initial state. If you decide to add non-zero initial state to any of those contracts, you must initialize them here.
29
30
  *
30
31
  * @custom:events
31
- * - {ValueReceived} event when funding the contract on deployment.
32
+ * - {UniversalReceiver} event when funding the contract on deployment.
32
33
  * - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
34
+ * - {DataChanged} event when setting the {_LSP3_SUPPORTED_STANDARDS_KEY}.
33
35
  */
34
36
  function _initialize(
35
37
  address initialOwner
36
38
  ) internal virtual override onlyInitializing {
37
39
  LSP0ERC725AccountInitAbstract._initialize(initialOwner);
38
40
 
39
- // set data key SupportedStandards:LSP3UniversalProfile
41
+ // set data key SupportedStandards:LSP3Profile
40
42
  _setData(
41
43
  _LSP3_SUPPORTED_STANDARDS_KEY,
42
44
  _LSP3_SUPPORTED_STANDARDS_VALUE
@@ -0,0 +1,17 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.4;
3
+
4
+ abstract contract Version {
5
+ /**
6
+ * @dev Get the version of the contract.
7
+ * @notice Contract version.
8
+ *
9
+ * @return The version of the the contract.
10
+ */
11
+ // DO NOT CHANGE
12
+ // Comments block below is used by release-please to automatically update the version in this file.
13
+ // x-release-please-start-version
14
+ string public constant VERSION = "0.12.1";
15
+
16
+ // x-release-please-end
17
+ }
@@ -91,12 +91,12 @@
91
91
  }
92
92
  }
93
93
  ],
94
- "LSP20CallVerificationFailed(bool,bytes)": [
94
+ "LSP20CallVerificationFailed(bool,bytes4)": [
95
95
  {
96
96
  "details": "reverts when the call to the owner does not return the LSP20 success value",
97
97
  "params": {
98
98
  "postCall": "True if the execution call was done, False otherwise",
99
- "returnedData": "The data returned by the call to the logic verifier"
99
+ "returnedStatus": "The bytes4 decoded data returned by the logic verifier."
100
100
  }
101
101
  }
102
102
  ],
@@ -139,14 +139,14 @@
139
139
  }
140
140
  },
141
141
  "constructor": {
142
- "custom:events": "- {ValueReceived} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
143
- "details": "Set `initialOwner` as the contract owner. The `constructor` also allows funding the contract on deployment.",
142
+ "custom:events": "- {UniversalReceiver} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
143
+ "details": "Set `initialOwner` as the contract owner. - The `constructor` also allows funding the contract on deployment. - The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.",
144
144
  "params": {
145
145
  "initialOwner": "The owner of the contract."
146
146
  }
147
147
  },
148
148
  "execute(uint256,address,uint256,bytes)": {
149
- "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). - {ValueReceived} event when receiving native tokens.",
149
+ "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). - {UniversalReceiver} event when receiving native tokens.",
150
150
  "custom:requirements": "- Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. - If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. - If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.",
151
151
  "details": "Generic executor function to: - send native tokens to any address. - interact with any contract by passing an abi-encoded function call in the `data` parameter. - deploy a contract by providing its creation bytecode in the `data` parameter.",
152
152
  "params": {
@@ -157,7 +157,7 @@
157
157
  }
158
158
  },
159
159
  "executeBatch(uint256[],address[],uint256[],bytes[])": {
160
- "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) - {ValueReceived} event when receiving native tokens.",
160
+ "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) - {UniversalReceiver} event when receiving native tokens.",
161
161
  "custom:requirements": "- The length of the parameters provided must be equal. - Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. - If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. - If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.",
162
162
  "custom:warning": "- The `msg.value` should not be trusted for any method called within the batch with `operationType`: `DELEGATECALL` (4).",
163
163
  "details": "Batch executor function that behaves the same as {execute} but allowing multiple operations in the same transaction.",
@@ -187,6 +187,7 @@
187
187
  }
188
188
  },
189
189
  "isValidSignature(bytes32,bytes)": {
190
+ "custom:warning": "This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP0ERC725Account and prevent signatures from the same EOA to be replayed across different LSP0ERC725Accounts.",
190
191
  "details": "Handles two cases: 1. If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature. - If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid. 2. If the owner is a smart contract, it forwards the call of {isValidSignature()} to the owner contract: - If the contract fails or returns the `_ERC1271_FAILVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid. - If the {isValidSignature()} on the owner returned the `_ERC1271_SUCCESSVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.",
191
192
  "params": {
192
193
  "dataHash": "The hash of the data to be validated.",
@@ -209,7 +210,7 @@
209
210
  "details": "Renounce ownership of the contract in a 2-step process. 1. The first call will initiate the process of renouncing ownership. 2. The second call is used as a confirmation and will leave the contract without an owner."
210
211
  },
211
212
  "setData(bytes32,bytes)": {
212
- "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
213
+ "custom:events": "- {UniversalReceiver} event when receiving native tokens. - {DataChanged} event.",
213
214
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
214
215
  "details": "Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data.",
215
216
  "params": {
@@ -218,7 +219,7 @@
218
219
  }
219
220
  },
220
221
  "setDataBatch(bytes32[],bytes[])": {
221
- "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
222
+ "custom:events": "- {UniversalReceiver} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
222
223
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
223
224
  "details": "Batch data setting function that behaves the same as {setData} but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.",
224
225
  "params": {
@@ -243,8 +244,8 @@
243
244
  }
244
245
  },
245
246
  "universalReceiver(bytes32,bytes)": {
246
- "custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
247
- "details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
247
+ "custom:events": "- {UniversalReceiver} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
248
+ "details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. This function delegates internally the handling of native tokens to the {universalReceiver} function itself passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data.",
248
249
  "params": {
249
250
  "receivedData": "The data received.",
250
251
  "typeId": "The type of call received."
@@ -91,12 +91,12 @@
91
91
  }
92
92
  }
93
93
  ],
94
- "LSP20CallVerificationFailed(bool,bytes)": [
94
+ "LSP20CallVerificationFailed(bool,bytes4)": [
95
95
  {
96
96
  "details": "reverts when the call to the owner does not return the LSP20 success value",
97
97
  "params": {
98
98
  "postCall": "True if the execution call was done, False otherwise",
99
- "returnedData": "The data returned by the call to the logic verifier"
99
+ "returnedStatus": "The bytes4 decoded data returned by the logic verifier."
100
100
  }
101
101
  }
102
102
  ],
@@ -142,7 +142,7 @@
142
142
  "details": "Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone after it has been deployed. This is intended so that the sole purpose of this contract is to be used as a base contract behind a proxy."
143
143
  },
144
144
  "execute(uint256,address,uint256,bytes)": {
145
- "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). - {ValueReceived} event when receiving native tokens.",
145
+ "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). - {UniversalReceiver} event when receiving native tokens.",
146
146
  "custom:requirements": "- Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. - If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. - If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.",
147
147
  "details": "Generic executor function to: - send native tokens to any address. - interact with any contract by passing an abi-encoded function call in the `data` parameter. - deploy a contract by providing its creation bytecode in the `data` parameter.",
148
148
  "params": {
@@ -153,7 +153,7 @@
153
153
  }
154
154
  },
155
155
  "executeBatch(uint256[],address[],uint256[],bytes[])": {
156
- "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) - {ValueReceived} event when receiving native tokens.",
156
+ "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) - {UniversalReceiver} event when receiving native tokens.",
157
157
  "custom:requirements": "- The length of the parameters provided must be equal. - Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. - If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. - If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.",
158
158
  "custom:warning": "- The `msg.value` should not be trusted for any method called within the batch with `operationType`: `DELEGATECALL` (4).",
159
159
  "details": "Batch executor function that behaves the same as {execute} but allowing multiple operations in the same transaction.",
@@ -183,13 +183,14 @@
183
183
  }
184
184
  },
185
185
  "initialize(address)": {
186
- "custom:events": "- {ValueReceived} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
186
+ "custom:events": "- {UniversalReceiver} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
187
187
  "details": "Set `initialOwner` as the contract owner. The `initialize(address)` also allows funding the contract on deployment.",
188
188
  "params": {
189
189
  "initialOwner": "The owner of the contract."
190
190
  }
191
191
  },
192
192
  "isValidSignature(bytes32,bytes)": {
193
+ "custom:warning": "This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP0ERC725Account and prevent signatures from the same EOA to be replayed across different LSP0ERC725Accounts.",
193
194
  "details": "Handles two cases: 1. If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature. - If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid. 2. If the owner is a smart contract, it forwards the call of {isValidSignature()} to the owner contract: - If the contract fails or returns the `_ERC1271_FAILVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid. - If the {isValidSignature()} on the owner returned the `_ERC1271_SUCCESSVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.",
194
195
  "params": {
195
196
  "dataHash": "The hash of the data to be validated.",
@@ -212,7 +213,7 @@
212
213
  "details": "Renounce ownership of the contract in a 2-step process. 1. The first call will initiate the process of renouncing ownership. 2. The second call is used as a confirmation and will leave the contract without an owner."
213
214
  },
214
215
  "setData(bytes32,bytes)": {
215
- "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
216
+ "custom:events": "- {UniversalReceiver} event when receiving native tokens. - {DataChanged} event.",
216
217
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
217
218
  "details": "Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data.",
218
219
  "params": {
@@ -221,7 +222,7 @@
221
222
  }
222
223
  },
223
224
  "setDataBatch(bytes32[],bytes[])": {
224
- "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
225
+ "custom:events": "- {UniversalReceiver} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
225
226
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
226
227
  "details": "Batch data setting function that behaves the same as {setData} but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.",
227
228
  "params": {
@@ -246,8 +247,8 @@
246
247
  }
247
248
  },
248
249
  "universalReceiver(bytes32,bytes)": {
249
- "custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
250
- "details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
250
+ "custom:events": "- {UniversalReceiver} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
251
+ "details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. This function delegates internally the handling of native tokens to the {universalReceiver} function itself passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data.",
251
252
  "params": {
252
253
  "receivedData": "The data received.",
253
254
  "typeId": "The type of call received."