Skip to content

Comments

Pull Request: Track Beneficiary and Delegate Changes (#27, #48#81

Merged
JerryIdoko merged 5 commits intoVesting-Vault:mainfrom
JamesEjembi:feature/track-beneficiary-delegate-events-27-48
Feb 24, 2026
Merged

Pull Request: Track Beneficiary and Delegate Changes (#27, #48#81
JerryIdoko merged 5 commits intoVesting-Vault:mainfrom
JamesEjembi:feature/track-beneficiary-delegate-events-27-48

Conversation

@JamesEjembi
Copy link
Contributor

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

@JerryIdoko JerryIdoko merged commit 2e3c696 into Vesting-Vault:main Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#27 Issue 27: [Events] Track Beneficiary and Delegate Changes

2 participants