feat: Per-Vault Admin Override - Enable Independent Vault Governance#150
Open
Nanle-code wants to merge 4 commits into
Open
feat: Per-Vault Admin Override - Enable Independent Vault Governance#150Nanle-code wants to merge 4 commits into
Nanle-code wants to merge 4 commits into
Conversation
…ks (StellarYield#104) - Add Error::InsufficientVaultBalance variant for clearer diagnostics - Add explicit balance checks before all outgoing transfers in transfer_asset_from_vault - Wrap transfer_asset_to_vault to catch insufficient user balance scenarios - Add vault_asset_balance() public view function for frontend solvency verification - Document atomicity assumptions in all functions combining state changes with external calls - Add comprehensive tests for insufficient balance scenarios Addresses vault state inconsistency when token transfers fail by providing explicit balance checks and clear error diagnostics instead of opaque token contract failures.
- Add optional vault_admin, zkme_verifier, and cooperator fields to BatchVaultParams - Update _create_single_rwa_vault to use custom admin with fallback to factory admin - Enhance VaultCreated event to emit actual vault admin - Add comprehensive tests for independent admin control - Maintain backward compatibility with existing vault creation functions Fixes StellarYield#101
|
@Nanle-code Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
3 tasks
Author
|
@Jayy4rl can you review this |
Contributor
|
@Nanle-code CI checks failed, resolve that please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-Vault Admin Override - Enable Independent Vault Governance
Summary
This PR addresses the critical security issue where all vaults were controlled by the factory admin, creating a single point of failure. The implementation enables per-vault admin override functionality while maintaining full backward compatibility.
Problem Solved
Solution
Added optional admin override functionality to allow independent vault governance:
Key Changes
vault_admin: Option<Address>field in BatchVaultParamszkme_verifierandcooperatoroverridesVaultCreatedevent now emits actual vault adminFiles Modified
Security Benefits
🔒 Eliminates Single Point of Failure: Different vaults can have different admins
🏢 Multi-Tenant Support: Asset managers can have independent control
📊 Enhanced Transparency: Events show actual vault governance
🔄 Zero Breaking Changes: Existing integrations continue working
Definition of Done
Testing
Added comprehensive tests covering:
Compatibility
This implementation enables a truly multi-tenant RWA platform while maintaining the security and flexibility needed for different asset managers to operate independently.
closes #101