You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -299,15 +311,21 @@ abstract contract LSP0ERC725AccountCore is
299
311
* @custom:requirements Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
300
312
*
301
313
* @custom:events
302
-
* - {ValueReceived} event when receiving native tokens.
314
+
* - {UniversalReceiver} event when receiving native tokens.
303
315
* - {DataChanged} event.
304
316
*/
305
317
function setData(
306
318
bytes32dataKey,
307
319
bytesmemorydataValue
308
320
) publicpayablevirtualoverride {
309
321
if (msg.value!=0) {
310
-
emitValueReceived(msg.sender, msg.value);
322
+
emitUniversalReceiver(
323
+
msg.sender,
324
+
msg.value,
325
+
_TYPEID_LSP0_VALUE_RECEIVED,
326
+
abi.encodePacked(msg.sig),
327
+
""
328
+
);
311
329
}
312
330
313
331
address accountOwner =owner();
@@ -336,15 +354,21 @@ abstract contract LSP0ERC725AccountCore is
336
354
* @custom:requirements Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
337
355
*
338
356
* @custom:events
339
-
* - {ValueReceived} event when receiving native tokens.
357
+
* - {UniversalReceiver} event when receiving native tokens.
340
358
* - {DataChanged} event. (on each iteration of setting data)
341
359
*/
342
360
function setDataBatch(
343
361
bytes32[] memorydataKeys,
344
362
bytes[] memorydataValues
345
363
) publicpayablevirtualoverride {
346
364
if (msg.value!=0) {
347
-
emitValueReceived(msg.sender, msg.value);
365
+
emitUniversalReceiver(
366
+
msg.sender,
367
+
msg.value,
368
+
_TYPEID_LSP0_VALUE_RECEIVED,
369
+
abi.encodePacked(msg.sig),
370
+
""
371
+
);
348
372
}
349
373
350
374
if (dataKeys.length!= dataValues.length) {
@@ -416,15 +440,15 @@ abstract contract LSP0ERC725AccountCore is
416
440
* @return returnedValues The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call.
417
441
*
418
442
* @custom:events
419
-
* - {ValueReceived} when receiving native tokens.
443
+
* - {UniversalReceiver} when receiving native tokens.
420
444
* - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.
// Query the ERC725Y storage with the data key {_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY}
@@ -742,8 +766,9 @@ abstract contract LSP0ERC725AccountCore is
742
766
/**
743
767
* @dev Forwards the call to an extension mapped to a function selector.
744
768
*
745
-
* Calls {_getExtension} to get the address of the extension mapped to the function selector being
769
+
* Calls {_getExtensionAndForwardValue} to get the address of the extension mapped to the function selector being
746
770
* called on the account. If there is no extension, the `address(0)` will be returned.
771
+
* Forwards the value sent with the call to the extension if the function selector is mapped to a payable extension.
747
772
*
748
773
* 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.
749
774
*
@@ -763,7 +788,14 @@ abstract contract LSP0ERC725AccountCore is
763
788
bytescalldatacallData
764
789
) internalvirtualoverridereturns (bytesmemory) {
765
790
// If there is a function selector
766
-
address extension =_getExtension(msg.sig);
791
+
(
792
+
addressextension,
793
+
boolisForwardingValue
794
+
) =_getExtensionAndForwardValue(msg.sig);
795
+
796
+
// if value is associated with the extension call and extension function selector is not payable, use the universalReceiver
* @title Inheritable Proxy Implementation of [LSP-0-ERC725Account] Standard.
15
18
*
@@ -27,14 +30,20 @@ abstract contract LSP0ERC725AccountInitAbstract is
27
30
* @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.
28
31
*
29
32
* @custom:events
30
-
* - {ValueReceived} event when funding the contract on deployment.
33
+
* - {UniversalReceiver} event when funding the contract on deployment.
31
34
* - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
0 commit comments