-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vault standard; SRC-6 #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standard uses the images for SRC-5 instead of newly created images for SRC-6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include methods like fn underlying_asset(asset: AssetId) -> Option<AssetId>
and fn vault_asset(underlying: AssetId) -> Option<AssetId>
to allow converting between vaults & underlying?
Alternatively, we could just delegate this task to the indexer, having it index Deposit
events.
standards/src_6/README.md
Outdated
The following standard allows for the implementation of a standard API for token vaults such as yield bearing token vaults. This standard is an optional add-on to the SRC-20 standard. | ||
|
||
# Motivation | ||
Token vaults allow users to own shares of variable amount of assets, such as lending protocols which may have growing assets due to profits from interest. This pattern is highly useful and would greatly benefit from standardisation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention how a standardized vault increases composability, such as an AMM that allows trading assets based on the underlying assets... wallets that are aware of assets held in a vault, etc.
This standard is fully compatible with the SRC-20 standard | ||
|
||
# Security Considerations | ||
Incorrect implementation of token vaults could allow attackers to steal underlying assets. It is recommended to properly audit any code using this standard to ensure exploits are not possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should include something about how a vault can "lie" about the underlying?
Ex, if a vault says some asset represents USDC, there's no guarantee that the vault actually represents USDC (may be a consideration for wallets)
Vault standard with subvaults
Co-authored-by: Cameron Carstens <54727135+bitzoic@users.noreply.github.com>
Co-authored-by: Cameron Carstens <54727135+bitzoic@users.noreply.github.com>
Tag me when ready for a final review |
Co-authored-by: Cameron Carstens <54727135+bitzoic@users.noreply.github.com>
Co-authored-by: Cameron Carstens <54727135+bitzoic@users.noreply.github.com>
Co-authored-by: Cameron Carstens <54727135+bitzoic@users.noreply.github.com>
…ndards into vault_standard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type of change
Changes
The following changes have been made: