This guide documents common failure scenarios when interacting with StellarYield contracts, along with quick diagnosis checklists and matching error variants.
Symptoms:
- Transaction reverts when attempting to deposit assets
- Error code returned from
deposit()call
Quick Diagnosis Checklist:
-
Check KYC Status (Error:
NotKYCVerified- Code 1)- Verify user has completed zkMe KYC verification
- Call
is_kyc_verified(user_address)to check status - Fix: Complete KYC verification through zkMe before depositing
-
Check Vault State (Error:
InvalidVaultState- Code 5)- Verify vault is in
FundingorActivestate - Call
vault_state()to check current state - Fix: Wait for vault to enter appropriate state or choose a different vault
- Verify vault is in
-
Check Deposit Amount (Error:
BelowMinimumDeposit- Code 6 orExceedsMaximumDeposit- Code 7)- Verify deposit meets minimum:
min_deposit() - Verify deposit doesn't exceed per-user limit:
max_deposit_per_user() - Check user's current deposits:
user_deposited(user_address) - Fix: Adjust deposit amount to be within
[min_deposit, max_deposit_per_user - user_deposited]
- Verify deposit meets minimum:
-
Check Funding Target (Error:
FundingTargetExceeded- Code 46)- During
Fundingstate, deposits cannot exceed the funding target - Call
funding_target()andtotal_assets()to check remaining capacity - Fix: Reduce deposit amount to fit within remaining capacity:
funding_target - total_assets
- During
-
Check Vault Pause Status (Error:
VaultPaused- Code 11)- Verify vault is not paused:
paused() - Fix: Wait for admin/operator to unpause the vault
- Verify vault is not paused:
-
Check Blacklist Status (Error:
AddressBlacklisted- Code 14)- Verify neither caller nor receiver is blacklisted
- Call
is_blacklisted(address)for both addresses - Fix: Contact compliance officer to resolve blacklist status
-
Check Asset Allowance
- Ensure vault has sufficient allowance to transfer assets from caller
- Fix: Approve vault contract to spend assets before depositing
Related Error Codes:
NotKYCVerified(1)InvalidVaultState(5)BelowMinimumDeposit(6)ExceedsMaximumDeposit(7)VaultPaused(11)ZeroAmount(13)AddressBlacklisted(14)FundingTargetExceeded(46)
Symptoms:
- Transaction reverts when attempting to withdraw assets or redeem shares
- Error code returned from
withdraw()orredeem()call
Quick Diagnosis Checklist:
-
Check Share Balance (Error:
InsufficientBalance- Code 20)- Verify user has sufficient shares:
balance(user_address) - Fix: Reduce withdrawal amount or wait for deposits to settle
- Verify user has sufficient shares:
-
Check Vault State (Error:
InvalidVaultState- Code 5)- Withdrawals are allowed in
ActiveandMaturedstates - Call
vault_state()to check current state - Fix: Wait for vault to enter appropriate state
- Withdrawals are allowed in
-
Check Freeze Flags (Error:
VaultPaused- Code 11)- Verify withdraw/redeem operations are not frozen
- Call
freeze_flags()and check ifFREEZE_WITHDRAW_REDEEM(2) is set - Fix: Wait for admin/operator to unfreeze operations
-
Check Blacklist Status (Error:
AddressBlacklisted- Code 14)- Verify neither owner nor receiver is blacklisted
- Call
is_blacklisted(address)for both addresses - Fix: Contact compliance officer to resolve blacklist status
-
Check Allowance for
redeem_from(Error:InsufficientAllowance- Code 19)- If using
redeem_from, verify spender has sufficient allowance - Call
allowance(owner, spender) - Fix: Owner must approve spender via
approve()before redemption
- If using
-
Check Pending Yield (Error:
BurnRequiresYieldClaim- Code 32)- Some configurations require claiming yield before burning shares
- Call
pending_yield(user_address)to check unclaimed yield - Fix: Call
claim_yield()before attempting withdrawal/redemption
-
Check Amount Validity (Error:
ZeroAmount- Code 13 orPreviewZeroAssets- Code 48)- Verify withdrawal amount is positive and non-zero
- Verify shares convert to non-zero assets at current price
- Fix: Increase withdrawal amount or wait for share price to increase
Related Error Codes:
InvalidVaultState(5)VaultPaused(11)ZeroAmount(13)AddressBlacklisted(14)InsufficientAllowance(19)InsufficientBalance(20)BurnRequiresYieldClaim(32)PreviewZeroAssets(48)
Symptoms:
- Transaction reverts when attempting to claim yield
- Error code returned from
claim_yield()call
Quick Diagnosis Checklist:
-
Check Pending Yield (Error:
NoYieldToClaim- Code 9)- Verify user has unclaimed yield:
pending_yield(user_address) - Fix: Wait for yield distribution or verify you held shares during yield epochs
- Verify user has unclaimed yield:
-
Check Vault State (Error:
InvalidVaultState- Code 5)- Yield claiming is allowed in
ActiveandMaturedstates - Call
vault_state()to check current state - Fix: Wait for vault to enter appropriate state
- Yield claiming is allowed in
-
Check Freeze Flags (Error:
VaultPaused- Code 11)- Verify yield operations are not frozen
- Call
freeze_flags()and check ifFREEZE_YIELD(4) is set - Fix: Wait for admin/operator to unfreeze yield operations
-
Check Share Balance History
- Yield is calculated based on share balance at each epoch
- Call
get_user_yield_history(user, start_epoch, end_epoch)to see per-epoch breakdown - Fix: Ensure you held shares during the epochs you're trying to claim
Related Error Codes:
InvalidVaultState(5)NoYieldToClaim(9)VaultPaused(11)
Symptoms:
- Transaction reverts when attempting to request early redemption
- Error code returned from
request_early_redemption()call
Quick Diagnosis Checklist:
-
Check Vault State (Error:
InvalidVaultState- Code 5)- Early redemption is only available in
Activestate - Call
vault_state()to check current state - Fix: Wait for vault to enter
Activestate
- Early redemption is only available in
-
Check Share Balance (Error:
InsufficientBalance- Code 20)- Verify user has sufficient shares:
balance(user_address) - Fix: Reduce redemption amount to match available balance
- Verify user has sufficient shares:
-
Check Freeze Status (Error:
VaultPaused- Code 11)- Verify withdraw/redeem operations are not frozen
- Call
freeze_flags()and check ifFREEZE_WITHDRAW_REDEEM(2) is set - Fix: Wait for admin/operator to unfreeze operations
-
Check Blacklist Status (Error:
AddressBlacklisted- Code 14)- Verify user is not blacklisted:
is_blacklisted(user_address) - Fix: Contact compliance officer to resolve blacklist status
- Verify user is not blacklisted:
-
Check Amount Validity (Error:
ZeroAmount- Code 13)- Verify redemption amount is positive and non-zero
- Fix: Provide a positive non-zero share amount
-
Use Precheck Function
- Call
can_request_early_redemption(user_address)for detailed validation - Returns
PassorFail(reason)with specific failure reason - Fix: Address the specific failure reason returned
- Call
Related Error Codes:
InvalidVaultState(5)VaultPaused(11)ZeroAmount(13)AddressBlacklisted(14)InsufficientBalance(20)
Symptoms:
- Transaction reverts when operator attempts to activate vault
- Error code returned from
activate_vault()call
Quick Diagnosis Checklist:
-
Check Operator Permissions (Error:
NotOperator- Code 3)- Verify caller has operator role:
is_operator(caller)orhas_role(caller, LifecycleManager) - Fix: Use an authorized operator account or request role from admin
- Verify caller has operator role:
-
Check Vault State (Error:
InvalidVaultState- Code 5)- Vault must be in
Fundingstate to activate - Call
vault_state()to check current state - Fix: Ensure vault is in
Fundingstate before activation
- Vault must be in
-
Check Funding Target (Error:
FundingTargetNotMet- Code 10)- If funding target is set, it must be met before activation
- Call
funding_target()andtotal_assets()to check progress - Call
is_funding_target_met()for quick check - Fix: Wait for more deposits or admin may adjust funding target via
set_funding_target()
-
Check Funding Deadline (Error:
FundingDeadlinePassed- Code 16)- If funding deadline is set and has passed, vault cannot be activated
- Call
funding_deadline()to check deadline timestamp - Fix: If deadline passed without meeting target, use
cancel_funding()instead
Related Error Codes:
NotOperator(3)InvalidVaultState(5)FundingTargetNotMet(10)FundingDeadlinePassed(16)
Symptoms:
- Transaction reverts when operator attempts to distribute yield
- Error code returned from
distribute_yield()call
Quick Diagnosis Checklist:
-
Check Operator Permissions (Error:
NotOperator- Code 3)- Verify caller has operator role:
is_operator(caller)orhas_role(caller, YieldOperator) - Fix: Use an authorized operator account or request role from admin
- Verify caller has operator role:
-
Check Vault State (Error:
InvalidVaultState- Code 5)- Yield can only be distributed in
Activestate - Call
vault_state()to check current state - Fix: Ensure vault is activated before distributing yield
- Yield can only be distributed in
-
Check Shareholders (Error:
NoShareholders- Code 50)- Cannot distribute yield when total supply is zero
- Call
total_supply()to check if there are any shareholders - Fix: Wait for deposits before distributing yield
-
Check Yield Amount (Error:
ZeroAmount- Code 13)- Yield amount must be positive and non-zero
- Fix: Provide a positive non-zero yield amount
-
Check Asset Allowance
- Ensure operator has approved vault to transfer yield assets
- Fix: Approve vault contract to spend yield assets before distribution
Related Error Codes:
NotOperator(3)InvalidVaultState(5)ZeroAmount(13)NoShareholders(50)
Symptoms:
- Transaction reverts when admin attempts to update vault configuration
- Error code returned from configuration functions
Quick Diagnosis Checklist:
-
Check Admin Permissions (Error:
NotAdmin- Code 4)- Verify caller is the admin:
admin() - Fix: Use the admin account for configuration operations
- Verify caller is the admin:
-
Check Address Validity (Error:
ZeroAddress- Code 12)- Verify address parameters are not zero-equivalent (contract's own address)
- Fix: Provide valid non-zero addresses
-
Check Deposit Limits (Error:
InvalidDepositLimits- Code 33)- When setting deposit limits, ensure
min_deposit ≤ max_deposit_per_user - Fix: Adjust limits to satisfy the constraint
- When setting deposit limits, ensure
-
Check Fee Limits (Error:
FeeTooHigh- Code 22)- Early redemption fee must be ≤ 1000 basis points (10%)
- Fix: Reduce fee to 1000 bps or below
-
Check Timelock Requirements (Error:
TimelockDelayNotPassed- Code 35)- Critical operations require timelock delay
- Call
get_timelock_action(action_id)to check status - Fix: Wait for timelock delay period to expire before executing
Related Error Codes:
NotAdmin(4)ZeroAddress(12)FeeTooHigh(22)InvalidDepositLimits(33)TimelockDelayNotPassed(35)
Symptoms:
- Transaction reverts when creating a new vault through factory
- Error code returned from
create_single_rwa_vault()call
Quick Diagnosis Checklist:
-
Check Operator Permissions (Error:
NotAuthorized- Code 3)- Verify caller has operator role or is admin
- Call
is_operator(caller)orhas_role(caller, FullOperator) - Fix: Use an authorized operator account or request role from admin
-
Check Initialization Parameters (Error:
InvalidInitParams- Code 6)- Verify maturity date is in the future
- Verify early redemption fee ≤ 1000 bps (10%)
- Verify min_deposit ≥ 0 and funding_target ≥ 0
- Verify min_deposit ≤ max_deposit_per_user (if both > 0)
- Fix: Correct invalid parameters
-
Check Batch Size (Error:
BatchTooLarge- Code 7)- Batch vault creation is limited to 10 vaults per transaction
- Fix: Reduce batch size to 10 or fewer vaults
-
Check WASM Hash (Error:
InvalidWasmHash- Code 8)- WASM hash must not be all zeros
- Fix: Upload vault WASM and use the returned hash
-
Check Migration Status (Error:
MigrationRequired- Code 9)- Factory storage schema must be current
- Fix: Admin must call
migrate()before creating vaults
Related Error Codes:
NotAuthorized(3)InvalidInitParams(6)BatchTooLarge(7)InvalidWasmHash(8)MigrationRequired(9)
Always start by checking the current state of the contract:
# Vault state
stellar contract invoke --id <VAULT> -- vault_state
# Pause status
stellar contract invoke --id <VAULT> -- paused
# Freeze flags
stellar contract invoke --id <VAULT> -- freeze_flagsVerify user-specific conditions:
# KYC status
stellar contract invoke --id <VAULT> -- is_kyc_verified --user <ADDRESS>
# Blacklist status
stellar contract invoke --id <VAULT> -- is_blacklisted --address <ADDRESS>
# Share balance
stellar contract invoke --id <VAULT> -- balance --id <ADDRESS>
# Pending yield
stellar contract invoke --id <VAULT> -- pending_yield --user <ADDRESS>Review vault configuration:
# Deposit limits
stellar contract invoke --id <VAULT> -- min_deposit
stellar contract invoke --id <VAULT> -- max_deposit_per_user
# Funding status
stellar contract invoke --id <VAULT> -- funding_target
stellar contract invoke --id <VAULT> -- total_assets
stellar contract invoke --id <VAULT> -- is_funding_target_met
# Maturity
stellar contract invoke --id <VAULT> -- maturity_date
stellar contract invoke --id <VAULT> -- is_maturedMany operations have preview functions that can help diagnose issues:
# Preview deposit
stellar contract invoke --id <VAULT> -- preview_deposit --assets <AMOUNT>
# Preview redemption
stellar contract invoke --id <VAULT> -- preview_redeem --shares <AMOUNT>
# Preview early redemption fee
stellar contract invoke --id <VAULT> -- estimate_early_redemption_fee --shares <AMOUNT>
# Check early redemption eligibility
stellar contract invoke --id <VAULT> -- can_request_early_redemption --user <ADDRESS>Verify role assignments:
# Check admin
stellar contract invoke --id <VAULT> -- admin
# Check operator status
stellar contract invoke --id <VAULT> -- is_operator --account <ADDRESS>
# Check specific role
stellar contract invoke --id <VAULT> -- has_role --addr <ADDRESS> --role <ROLE>If you've followed the troubleshooting steps and still encounter issues:
- Check the Error Catalog in the main README for detailed error descriptions
- Review Contract Events emitted during the failed transaction for additional context
- Verify Network Status - ensure you're connected to the correct network (testnet/mainnet)
- Check Gas Limits - some operations may require higher gas limits
- Contact Support with:
- Transaction hash
- Error code received
- Contract address
- Steps to reproduce
- Results from relevant diagnostic commands above