LSP1UniversalReceiverDelegateUP
The LSP1UniversalReceiverDelegateUP is a contract called by the universalReceiver(...)
function of the LSP0ERC725Account contract that:
Writes the data keys representing assets received from type LSP7-DigitalAsset and LSP8-IdentifiableDigitalAsset into the account storage, and removes them when the balance is zero according to the LSP5-ReceivedAssets Standard.
Writes the data keys representing the owned vaults from type LSP9-Vault into your account storage, and removes them when transferring ownership to other accounts according to the LSP10-ReceivedVaults Standard.
The following two requirements are required to execute the logic above correctly:
- The owner of the LSP0ERC725Account contract should be an LSP6KeyManager contract.
- The LSP1UniversalReceiverDelegateUP contract should be granted permission to
SETDATA
on the account (otherwise, the transaction will pass but will not write any data keys to the storage).
LSP1UniversalReceiverDelegateUP contract also contains the methods from the ERC165 Standard:
function supportsInterface(bytes4 interfaceId) public view returns (bool)
Functions
universalReceiverDelegate
function universalReceiverDelegate(
address caller,
uint256 value,
bytes32 typeId,
bytes memory data
) public payable returns (bytes memory result)
Writes the data keys of the received LSP7DigitalAsset, LSP8IdentifiableDigitalAsset, and LSP9Vault contract addresses into the account storage according to the LSP5ReceivedAssets and LSP10-ReceivedVaults Standard.
The data keys representing an asset/vault are cleared when the asset/vault is no longer owned by the account.
Parameters:
Name | Type | Description |
---|---|---|
caller | address | The token's or vault's smart contract address. |
value | uint256 | The amount of value sent to the universalReceiver function. |
typeId | bytes32 | The token hooks of the contract. |
data | bytes | The data that is associated with the asset or vault transfer (concatenated). |
Return Values:
Name | Type | Description |
---|---|---|
result | bytes | The value that is returned by the Key Manager's execute(...) function. |