Repository navigation
feat(token-vault): productionize real token custody for vesting, locks, and emergency unlocks - #70
Merged
xqcxx merged 6 commits intoJul 29, 2026
Conversation
- Add Asset storage key and store asset address in initialize() - Add revoked field to VestingSchedule for terminal-state discipline - Wire token::transfer in lock_tokens (owner → vault) - Wire token::transfer in claim (vault → owner) - Wire token::transfer in create_vesting (admin → vault) - Wire token::transfer in claim_vested (vault → beneficiary) - Wire token::transfer in emergency_unlock (vault → lock owner) - Implement revoke_vesting: admin-gated, transfers unclaimed remainder to admin, marks revoked=true, adjusts total_locked - Check revoked flag in claim_vested to enforce terminal-state discipline - Update unit tests for real token integration Addresses issue Stellar-Re-Code#43: real token custody across vesting, locks, and emergency unlock lifecycles with conservation invariant enforcement. The sum of releasable + locked + emergency-withdrawable never exceeds deposited. Emergency unlock is multi-sig gated and auditable.
The deploy_vault helper now takes an asset: &Address parameter to pass to the vault's initialize(), aligning with the new real-token-custody contract interface.
…rvation - Setup registers real Stellar Asset Contract and assigns ACL roles - All tests mint tokens before lock/vesting operations - Add revoke_vesting_refunds_unclaimed test - Add conservation invariant assertion: vault token balance == total_locked - Seeded sequences exercise combined lock/vest/claim/revoke/emergency ops with real token balance verification after every step - Reduce seeded iterations (40→20) to fit Soroban budget with real transfers
- cross_contract: assign ACL Member roles, use real SAC for treasury/vault, fix finalize() caller to be a member (not admin) - event_lifecycle: use real SAC, make event count baseline-relative - governance_invariants: assign ACL roles in setup, fix finalize() callers - treasury_invariants: use real SAC and pre-mint tokens to treasury - resource_report: add asset parameter and token minting - All test files: add soroban_sdk::testutils::Address trait import
Replace assert_eq! on tuples containing Val (which lacks PartialEq) with field-level comparisons (last.0 address comparison).
Contributor
|
Great job @Ultra-Tech-code |
Contributor
Author
Thank you |
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.
Summary
Productionizes the token-vault with real token custody for vesting schedules, token locks, and emergency unlocks.
Closes #57
What Changed
Contract (`token-vault/src/lib.rs`)
Emergency Unlock Threat Model
Integration Tests
Test Results
85/85 tests pass, 0 failures
Acceptance Criteria