Skip to content

Commit

Permalink
refactor: update lsp9 fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
skimaharvey committed Oct 27, 2023
1 parent 46c325f commit 1653101
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions contracts/LSP9Vault/LSP9VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
}

Expand Down Expand Up @@ -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 "";

Expand Down

0 comments on commit 1653101

Please sign in to comment.