Skip to content

Comments

Pull Request: Transferable Allocations (Secondary Market) (#24, #45)#78

Merged
JerryIdoko merged 2 commits intoVesting-Vault:mainfrom
JamesEjembi:feature/transferable-allocations-24
Feb 24, 2026
Merged

Pull Request: Transferable Allocations (Secondary Market) (#24, #45)#78
JerryIdoko merged 2 commits intoVesting-Vault:mainfrom
JamesEjembi:feature/transferable-allocations-24

Conversation

@JamesEjembi
Copy link
Contributor

This PR introduces Transferable Allocations, allowing team members or investors to trade their unvested positions Over-The-Counter (OTC) by transferring vault ownership. This is a critical feature for DeFi liquidity, controlled strictly by administrative configuration to prevent unauthorized secondary markets.

🎯 Key Changes
Vault Configuration: Added an is_transferable boolean to the VaultConfig struct.

Transfer Logic: Implemented the transfer_vault function which updates the beneficiary address of a specific vault ID.

Access Control: * Ensures only the current beneficiary (owner) can initiate a transfer.

Verifies that the vault has been explicitly marked as transferable by the Admin.

Safety Guards: Added a "Non-transferable" revert string to satisfy the compliance requirement.

💻 Implementation Snippet (Soroban/Rust)
The core logic ensures that transferability is an opt-in security feature:

Rust
pub fn transfer_vault(env: Env, vault_id: u64, new_beneficiary: Address) {
let mut vault = get_vault(&env, vault_id);

// Verify current ownership
vault.beneficiary.require_auth();

// Check if the Admin enabled secondary transfers for this vault
if !vault.is_transferable {
    panic!("Vault is non-transferable");
}

// Update ownership
vault.beneficiary = new_beneficiary;
put_vault(&env, vault_id, vault);

}
✅ Acceptance Criteria Checklist
[x] State Update: is_transferable flag added to vault storage.

[x] Transfer Function: transfer_vault(vault_id, new_beneficiary) successfully updates the ledger.

[x] Constraint Validation: Reverts with "Vault is non-transferable" if the flag is set to false.

[x] Auth Check: Verified that only the current owner can move their allocation.

🚀 How to Test
Initialize a Vault: Set is_transferable: true.

Execute Transfer: Call transfer_vault from the current beneficiary's wallet.

Validate Failure: Attempt to transfer a vault where is_transferable: false and verify the panic message.

🔗 Linked Issues
Closes #24
Closes #45

@JerryIdoko JerryIdoko merged commit f7561cf 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.

#24 Issue 24: [Feature] Transferable Allocations (Secondary Market)

2 participants