LSP10 - Received Vaults
To keep track of all the vaults that an address owns, we should avoid the same problem mentioned in LSP5-ReceivedAssets, which is not informing recipients and senders about the ownership transfer of LSP9-Vaults.
One way to avoid this problem is to create generic metadata keys that developers should register in the smart contract storage, representing how many different vaults you own, their type, and the address of the transferred vault contract.
What does this standard represent ?
Make sure to understand the ERC725Y Generic Key/Value Store and LSP2 - ERC725YJSONSchema Standards before going through the ERC725Y Data Keys.
This Metadata standard describes two data keys that can be added to an ERC725Y smart contract to keep track of received and owned LSP9-Vaults.
This data key represents a list of all the vaults owned by the contract.
It is recommended to query the
LSP10Vaults data key to check if a smart contract supports the LSP10 - ReceivedVaults standard.
This data key represents a map key holding both:
- an ERC165 interface ID to quickly identify the standard used by each vault's smart contract (without the need to query the assets contracts directly).
- the index in the
LSP10Vaultsarray where the received vaults addresses are stored.
LSP10VaultsMap data key also helps prevent adding duplications to the array when automatically added via smart contract (e.g., an LSP1-UniversalReceiverDelegate).
The data keys are also set on the sender's Universal Profile to remove the vault contract address when sent to the recipient.
If set when transferring vaults, these data keys are automatically updated in the UniversalProfile storage via the LSP1UniversalReceiverDelegateUP contract.