diff --git a/contracts/LSP9Vault/LSP9VaultCore.sol b/contracts/LSP9Vault/LSP9VaultCore.sol index 019ff7da7..b3335a49c 100644 --- a/contracts/LSP9Vault/LSP9VaultCore.sol +++ b/contracts/LSP9Vault/LSP9VaultCore.sol @@ -128,11 +128,10 @@ contract LSP9VaultCore is fallback( bytes calldata callData ) external payable virtual returns (bytes memory) { - // if value is associated with the extension call, use the universalReceiver - if (msg.value != 0) - universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, callData); - if (msg.data.length < 4) { + // if value is associated with the extension call, use the universalReceiver + if (msg.value != 0) + universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, callData); return ""; } @@ -554,6 +553,10 @@ contract LSP9VaultCore is msg.sig ); + // if value is associated with the extension call and function selector is not payable, use the universalReceiver + if (msg.value != 0 && !isPayable) + universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, callData); + // if no extension was found for bytes4(0) return don't revert if (msg.sig == bytes4(0) && extension == address(0)) return "";