DOCS
  • Getting Started
  • Custom token vaults
  • Running a check
  • Output and exit codes
  • Preflight errors
  • Conformance checks
  • Security checks
  • Check API
  • Limits and queue
  • Function coverage
  • Result types
  • Test vaults
Guide

Custom token vaults

How to fund the test accounts when the vault's underlying asset is a custom Soroban token instead of native XLM.

When you need this

Every check moves the vault's underlying asset from one of the seven test accounts.

  • Native XLM: Friendbot-funded accounts already hold XLM. Nothing else is needed.
  • A custom token: five of the seven accounts need a balance of that token first. Without it, the checks that need the token end as INCONCLUSIVE with the reason code insufficient_token_balance, and the process exits with code 3.

XLM is only needed for transaction fees. The checker warns when an identity holds less than 5 XLM.

Find the asset and its decimals

terminal
stellar contract invoke --id <VAULT_ADDRESS> --source-account alice --network testnet -- query_asset
stellar contract invoke --id <VAULT_ADDRESS> --source-account alice --network testnet -- decimals
stellar contract invoke --id <TOKEN_ADDRESS> --source-account alice --network testnet -- decimals

query_asset prints the token's contract address. The checker derives decimals_offset as the vault's decimals() minus the token's decimals().

Minimum balances

Amounts are in the token's smallest unit. The token column assumes 7 decimals.

AccountUsed byMinimum (smallest unit)Tokens (7 decimals)
alicethe 7 conformance checks, on the target vault5,000,000 + preview_mint(3,000,000) = 5,003,0000.5003
gracedonation_attack (attacker)100,000,00110.0000001
bobdonation_attack (victim)5,000,0000.5
daverounding_direction1,6010.0001601
erinaccess_control_probing (owner)10,000,0001.0
caroloverflow_protection00
frankaccess_control_probing (operator)00
Not verified yet

These figures were measured on a single vault: the reference vault code with decimals_offset = 3 and the repository's 7-decimal test token. Alice's and dave's amounts depend on the vault's share price and will differ on another vault.

size alice's amount
stellar contract invoke --id <VAULT_ADDRESS> --source-account alice --network testnet -- \
  preview_mint --shares 3000000

Add the result to 5,000,000.

Sending the tokens

admin mint (only if you control the token)
stellar contract invoke --id <TOKEN_ADDRESS> --source-account <TOKEN_ADMIN> --network testnet -- \
  mint --to <ACCOUNT_ADDRESS> --amount 5003000
transfer from a holder
stellar contract invoke --id <TOKEN_ADDRESS> --source-account <HOLDER> --network testnet -- \
  transfer --from <HOLDER> --to <ACCOUNT_ADDRESS> --amount 5003000

Repeat for alice, grace, bob, dave and erin. Print an account's address with stellar keys address <name>.

Not verified yet

The measured run used the test token's admin mint. Sending with transfer from a holder has not been tested.

Reading the result

  • INCONCLUSIVE with insufficient_token_balance: a token transfer was rejected, most likely a short balance. The detail names the account, for example test account 'alice'. Top it up and run again. It is not a finding about the vault.
  • If donation_attack ends as INCONCLUSIVE with unclassified_error, check grace's balance first. The status is right, but the reason code is not yet accurate in this case.
  • Balances are spent by each run. Top the accounts up before running again. Testnet tokens have no monetary value.