transferFrom ​
Standard ERC-20 transfer of vault shares from from to to, using the caller's allowance.
Signature ​
solidity
function transferFrom(address from, address to, uint256 value) external returns (bool);Parameters ​
| Name | Type | Description |
|---|---|---|
from | address | Address whose shares are spent. |
to | address | Recipient of the shares. |
value | uint256 | Amount of shares to move (18 decimals). |
Returns ​
true on success. Reverts on failure.
Preconditions ​
fromandtomust be non-zero addresses.frommust hold at leastvalueshares.- The caller must have
allowance(from, msg.sender) >= value. Set this withapprove(called byfrom).
Events emitted ​
solidity
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value); // updated allowanceExample — pull 5 shares using a prior allowance ​
ts
import { parseUnits } from 'viem'
import { publicClient, walletClient } from './client'
import { liteUsdVaultAbi } from './abi'
import { VAULT, SHARE_DECIMALS } from './constants'
const FROM = '0x...' as const
const TO = '0x...' as const
const value = parseUnits('5', SHARE_DECIMALS)
const { request } = await publicClient.simulateContract({
account: walletClient.account!,
address: VAULT,
abi: liteUsdVaultAbi,
functionName: 'transferFrom',
args: [FROM, TO, value],
})
const hash = await walletClient.writeContract(request)
await publicClient.waitForTransactionReceipt({ hash })Notes ​
transferFromis the underlying mechanism behind third-partywithdraw/redeemcalls — whenowner != msg.sender, the vault internally consumes share allowance the same way.

