Pull Request: Track Beneficiary and Delegate Changes (#27, #48#81
Merged
JerryIdoko merged 5 commits intoVesting-Vault:mainfrom Feb 24, 2026
Conversation
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.
This PR implements the missing event emissions required for the backend indexer to track ownership and permission shifts within individual vesting vaults. By emitting these events, we ensure a "perfect audit trail" as the vault state evolves mid-stream.
🎯 Key Changes
Beneficiary Tracking: Added BeneficiaryUpdated event emission in the update_beneficiary function.
Delegate Tracking: Added DelegateUpdated event emission in the update_delegate function.
Schema Standardization: Events follow the standard (Symbol, Val) format for easy parsing by the Stellar indexer.
💻 Implementation Snippet (Soroban Rust)
The following logic was integrated into the vault administration functions:
Rust
// Inside the update_beneficiary function
let topics = (symbol_short!("vesting"), symbol_short!("ben_upd"), vault_id);
env.events().publish(topics, (old_beneficiary, new_beneficiary));
// Inside the update_delegate function
let topics = (symbol_short!("vesting"), symbol_short!("del_upd"), vault_id);
env.events().publish(topics, (old_delegate, new_delegate));
✅ Acceptance Criteria Checklist
[x] Event Emission: BeneficiaryUpdated(vault_id, old_address, new_address) is published on successful transfer.
[x] Delegate Tracking: DelegateUpdated(vault_id, old_delegate, new_delegate) is published when permissions change.
[x] Audit Integrity: Events include the vault_id as a topic for efficient filtering by the backend.
🧪 How to Verify
Run Tests:
Bash
cargo test
Verify Event Log:
Use the Soroban CLI to invoke the update functions and check the events output:
Bash
soroban events --last-n 2 --network standalone
🔗 Linked Issues
Closes #27
Closes #48