Skip to main content
Hashbeam

Crypto protocols, markets and policy

9cdcc6

Read the Vault’s Asset Before You Swap

A vault's token is defined by its contract and chain, so verify the underlying asset address, network, decimals and deposit path before swapping or approving.

The Hashbeam Desk··4 min read

Read the Vault’s Asset Before You Swap

To get the exact token a vault requires, identify its underlying asset on the same chain as the vault and match the token by contract address, not by symbol. For a vault that follows ERC-4626, its asset() function returns that underlying token’s address. The vault address alone does not tell you what to deposit: vaults on different chains, or even different vaults on one chain, can require different assets.

How do you find a vault’s required token?

For an ERC-4626 vault, call asset() on the vault contract using the chain where you plan to deposit. The result is an address, which identifies the asset contract the vault uses for deposits and withdrawals. Check that the call was made against the intended vault address and on the intended chain; the same address format can exist on many networks, and a call on the wrong network answers a different question.

If you are using a vault interface, treat its displayed asset as a lead, then compare it with the contract result. A ticker such as USDC or WETH is not enough: different contracts can share a symbol, and a bridged token may have the same symbol as a token issued on that chain. A token’s decimals determine how a human-readable amount maps to the integer passed to a contract, but decimals do not identify the token.

Not every vault implements ERC-4626. For a custom vault, inspect its documented deposit function and contract source or ABI to find which token it transfers or checks. Some contracts accept a token address as a function argument; others store one internally or take deposits through a router. The function name alone is not proof of the accepted asset. If the required token is on another chain, the route and destination representation matter too. For the trade-offs in choosing QuickSwap for a first cross-chain swap, see whether QuickSwap suits a first cross-chain swap.

What should you verify before getting the token?

Verify the chain, token contract and deposit route together. A bridge or swap can deliver an asset with the right ticker but the wrong contract, or deliver it to a chain where the target vault does not exist. When comparing a token to the vault’s required asset, compare the full address on the destination chain, not a shortened address copied from a different network.

  • Vault: confirm the vault contract address and chain.
  • Asset: read asset() for ERC-4626, or identify the required token from the custom deposit logic.
  • Amount: check the token’s decimals and the vault’s deposit limits for the intended receiver.
  • Route: confirm the swap or bridge delivers that exact asset to the vault’s chain and to the wallet that will deposit.

When the asset is already on the correct chain, swap into the address returned by asset() and check the output token contract in the transaction details. When it is on another chain, the destination token is the one that must match; a source-chain token with the same name is not interchangeable. Bridges can issue a wrapped or bridged representation at a different address, and a vault may accept one representation but not another.

How do you check that the deposit will work?

For an ERC-4626 vault, check maxDeposit(receiver) and previewDeposit(assets) for the intended receiver and asset amount, then submit deposit(assets, receiver) if those checks fit the vault’s rules. maxDeposit reports the maximum amount the vault says it can accept for that receiver; previewDeposit estimates the shares for the specified asset amount. These calls help catch limits or unsupported states before a transaction, but they do not guarantee that conditions will remain unchanged by the time it is included.

Also check the spender in any approval. A direct ERC-4626 deposit commonly requires allowance for the vault; a routed deposit may require allowance for the contract that actually calls it. Approve only the token and spender required by the path you are using, and confirm the deposit transaction names the expected vault and receiver. A successful swap proves only that the swap executed; it does not prove the resulting token will pass the vault’s deposit checks.

Token behavior can create edge cases even when the address matches. A vault may reject deposits while paused or over its cap, and an implementation may not handle transfer-fee or rebasing tokens as expected. If a preview reverts, a deposit limit is zero, or the contract’s asset cannot be established, stop and resolve that specific mismatch before sending funds. The reliable sequence is to identify the vault on its chain, read its required asset, obtain that exact token, then check the deposit path and allowance.