mint ​
Mint an exact number of vault shares to a receiver, pulling the required USDC from the caller.
Signature ​
solidity
function mint(uint256 shares, address receiver) external returns (uint256 assets);Parameters ​
| Name | Type | Description |
|---|---|---|
shares | uint256 | Exact number of vault shares to mint (18 decimals). |
receiver | address | Address that will receive the shares. |
Returns ​
| Name | Type | Description |
|---|---|---|
assets | uint256 | Amount of USDC pulled from the caller (6 decimals). |
Preconditions ​
depositsPaused()must befalse.shares > 0.receivermust be a non-zero address.- The caller must have approved at least the resulting
assetsof USDC to the vault. Quote the required amount with the read functionpreviewMint(shares).
Events emitted ​
solidity
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Transfer(address indexed from, address indexed to, uint256 value); // share mintExample — mint 100 shares ​
ts
import { parseUnits } from 'viem'
import { publicClient, walletClient } from './client'
import { liteUsdVaultAbi } from './abi'
import { VAULT, SHARE_DECIMALS } from './constants'
const account = walletClient.account!
const shares = parseUnits('100', SHARE_DECIMALS)
// Simulate first — `result` is the USDC amount the vault will pull.
// Make sure your USDC allowance to the vault is >= this value
// before calling writeContract. (See Getting Started.)
const { request, result: requiredAssets } = await publicClient.simulateContract({
account,
address: VAULT,
abi: liteUsdVaultAbi,
functionName: 'mint',
args: [shares, account.address],
})
console.log('Will pull', requiredAssets, 'USDC (raw, 6 decimals)')
const hash = await walletClient.writeContract(request)
await publicClient.waitForTransactionReceipt({ hash })When to use this vs deposit ​
Use deposit when you have an exact USDC amount in mind. Use mint when you need an exact share amount — for example, when matching a pre-quoted position or rebalancing to a target share count.

