From dc75b7a4b4c79243d924e39a546adf151d09cd47 Mon Sep 17 00:00:00 2001 From: Maxime Date: Fri, 27 Oct 2023 11:28:05 +0100 Subject: [PATCH] refactor: update universalReceiver event in lsp0 & lsp9 --- contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol | 10 +++++----- contracts/LSP9Vault/LSP9VaultCore.sol | 6 +++--- docs/contracts/LSP0ERC725Account/LSP0ERC725Account.md | 2 +- docs/contracts/LSP9Vault/LSP9Vault.md | 2 +- tests/LSP9Vault/LSP9Vault.behaviour.ts | 2 +- tests/UniversalProfile.behaviour.ts | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol b/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol index 103b10bd7..ff2412981 100644 --- a/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +++ b/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol @@ -120,7 +120,7 @@ abstract contract LSP0ERC725AccountCore is * * 2. If the data sent to this function is of length less than 4 bytes (not a function selector), return. * - * @custom:events {UniversalReceiver} event when receiving native tokens. + * @custom:events {UniversalReceiver} event when receiving native tokens and extension function selector is not found or not payable. */ // solhint-disable-next-line no-complex-fallback fallback( @@ -198,7 +198,7 @@ abstract contract LSP0ERC725AccountCore is msg.sender, msg.value, _TYPEID_LSP0_VALUE_RECEIVED, - "", + abi.encodePacked(msg.sig), "" ); } @@ -262,7 +262,7 @@ abstract contract LSP0ERC725AccountCore is msg.sender, msg.value, _TYPEID_LSP0_VALUE_RECEIVED, - "", + abi.encodePacked(msg.sig), "" ); } @@ -321,7 +321,7 @@ abstract contract LSP0ERC725AccountCore is msg.sender, msg.value, _TYPEID_LSP0_VALUE_RECEIVED, - "", + abi.encodePacked(msg.sig), "" ); } @@ -364,7 +364,7 @@ abstract contract LSP0ERC725AccountCore is msg.sender, msg.value, _TYPEID_LSP0_VALUE_RECEIVED, - "", + abi.encodePacked(msg.sig), "" ); } diff --git a/contracts/LSP9Vault/LSP9VaultCore.sol b/contracts/LSP9Vault/LSP9VaultCore.sol index b3335a49c..512740308 100644 --- a/contracts/LSP9Vault/LSP9VaultCore.sol +++ b/contracts/LSP9Vault/LSP9VaultCore.sol @@ -122,7 +122,7 @@ contract LSP9VaultCore is * * 2. If the data sent to this function is of length less than 4 bytes (not a function selector), return. * - * @custom:events {UniversalReceiver} event when receiving native tokens. + * @custom:events {UniversalReceiver} event when receiving native tokens and extension function selector is not found or not payable. */ // solhint-disable-next-line no-complex-fallback fallback( @@ -202,7 +202,7 @@ contract LSP9VaultCore is msg.sender, msg.value, _TYPEID_LSP9_VALUE_RECEIVED, - "", + abi.encodePacked(msg.sig), "" ); } @@ -237,7 +237,7 @@ contract LSP9VaultCore is msg.sender, msg.value, _TYPEID_LSP9_VALUE_RECEIVED, - "", + abi.encodePacked(msg.sig), "" ); } diff --git a/docs/contracts/LSP0ERC725Account/LSP0ERC725Account.md b/docs/contracts/LSP0ERC725Account/LSP0ERC725Account.md index fa942fc41..7fe768ead 100644 --- a/docs/contracts/LSP0ERC725Account/LSP0ERC725Account.md +++ b/docs/contracts/LSP0ERC725Account/LSP0ERC725Account.md @@ -110,7 +110,7 @@ This function is executed when: **Emitted events:** -- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens. +- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens and extension function selector is not found or not payable. diff --git a/docs/contracts/LSP9Vault/LSP9Vault.md b/docs/contracts/LSP9Vault/LSP9Vault.md index ff65659bf..617fe2adc 100644 --- a/docs/contracts/LSP9Vault/LSP9Vault.md +++ b/docs/contracts/LSP9Vault/LSP9Vault.md @@ -96,7 +96,7 @@ This function is executed when: **Emitted events:** -- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens. +- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens and extension function selector is not found or not payable. diff --git a/tests/LSP9Vault/LSP9Vault.behaviour.ts b/tests/LSP9Vault/LSP9Vault.behaviour.ts index 8444f8e0c..e1debc273 100644 --- a/tests/LSP9Vault/LSP9Vault.behaviour.ts +++ b/tests/LSP9Vault/LSP9Vault.behaviour.ts @@ -801,7 +801,7 @@ export const shouldBehaveLikeLSP9 = ( context.deployParams.newOwner, msgValue, LSP1_TYPE_IDS.LSP9ValueReceived, - '0x', + context.universalProfile.interface.getSighash('executeBatch'), '0x', ); }); diff --git a/tests/UniversalProfile.behaviour.ts b/tests/UniversalProfile.behaviour.ts index 5076e0f17..b222c73af 100644 --- a/tests/UniversalProfile.behaviour.ts +++ b/tests/UniversalProfile.behaviour.ts @@ -289,7 +289,7 @@ export const shouldBehaveLikeLSP3 = ( context.accounts[0].address, msgValue, LSP1_TYPE_IDS.LSP0ValueReceived, - '0x', + context.universalProfile.interface.getSighash('setData'), '0x', ); @@ -314,7 +314,7 @@ export const shouldBehaveLikeLSP3 = ( context.accounts[0].address, msgValue, LSP1_TYPE_IDS.LSP0ValueReceived, - '0x', + context.universalProfile.interface.getSighash('setDataBatch'), '0x', ); @@ -429,7 +429,7 @@ export const shouldBehaveLikeLSP3 = ( context.deployParams.owner.address, msgValue, LSP1_TYPE_IDS.LSP0ValueReceived, - '0x', + context.universalProfile.interface.getSighash('executeBatch'), '0x', ); });