Contract Schema
This page describes the public end-user methods of the current Stable Vault contracts. Internal controller, allocator, and admin methods are intentionally omitted from this page. Use the proxy addresses from Contract Addresses.
Contract Topology
HakoStableVaultis the home contract on Base. It is the canonical contract for vault shares, total managed assets, and withdrawal finalization.HakoStableGatewayis deployed on the other supported EVM chains. It is the local deposit and payout entrypoint on those chains.Vault shares exist only on
HakoStableVault.
HakoStableVault
HakoStableVaultHakoStableVault is the contract users interact with on Base. It mints and burns vault shares, stores the canonical withdrawal queue, and finalizes accounting for every completed withdrawal.
deposit
depositfunction deposit(address token, uint256 amount, address receiver)
external
returns (uint256 sharesMinted)Deposits an allowlisted stablecoin on Base and mints vault shares for receiver.
token
address
Deposit token address. The token must be allowlisted in the home vault.
amount
uint256
Deposit amount in the token's native decimals.
receiver
address
Address that receives the minted vault shares.
ERC20 Transfer on the deposit token
from, to, value
Transfers the deposited stablecoin from the user to the home vault.
Vault share Transfer
from, to, value
Mints vault shares by transferring from 0x0 to receiver.
DepositRecorded
depositId: unique deposit id
receiver: share receiver
amountNormalized: deposit value in 18 decimals
sharesMinted: minted share amount
remote: false
Confirms that the home vault accepted the deposit and minted shares locally.
requestWithdrawal
requestWithdrawalCreates a withdrawal request by target normalized asset amount and locks the required share amount.
receiver
address
Destination EVM address that should receive the payout.
dstChainId
uint64
Destination chain identifier. The destination chain must be allowlisted.
token
address
Destination payout token. The token must be allowlisted for the selected destination chain.
amountNormalized
uint256
Requested withdrawal value in normalized 18-decimal units.
maxShares
uint256
Maximum number of vault shares the caller allows the contract to lock for this request.
WithdrawalRequested
requestId: withdrawal request id
owner: share owner
dstChainId: destination chain
token: payout token
receiver: encoded destination receiver bytes
amountNormalized: requested value in 18 decimals
sharesLocked: number of locked shares
Confirms that the withdrawal request was created and the corresponding shares were locked.
WithdrawalPayoutOnCompleteMarked
requestId: withdrawal request id
dstChainId: destination chain
token: payout token
Emitted only when the destination chain is the home chain and payout will be executed during final completion.
requestRedeem
requestRedeemCreates a withdrawal request by exact share amount instead of target value.
receiver
address
Destination EVM address that should receive the payout.
dstChainId
uint64
Destination chain identifier. The destination chain must be allowlisted.
token
address
Destination payout token. The token must be allowlisted for the selected destination chain.
shares
uint256
Exact amount of vault shares to lock and redeem.
minAmountNormalized
uint256
Minimum acceptable withdrawal value in normalized 18-decimal units.
WithdrawalRequested
requestId: withdrawal request id
owner: share owner
dstChainId: destination chain
token: payout token
receiver: encoded destination receiver bytes
amountNormalized: resulting value in 18 decimals
sharesLocked: number of locked shares
Confirms that the withdrawal request was created from an exact share amount.
WithdrawalPayoutOnCompleteMarked
requestId: withdrawal request id
dstChainId: destination chain
token: payout token
Emitted only when the destination chain is the home chain and payout will be executed during final completion.
totalAssets
totalAssetsReturns the total managed assets of the home vault in normalized 18-decimal units.
balanceOf
balanceOfReturns the current vault share balance of account.
account
address
Address whose vault share balance should be returned.
withdrawalNonce
withdrawalNonceReturns the current withdrawal nonce used by the controller-based withdrawal flow for owner.
owner
address
Address whose withdrawal nonce should be returned.
getWithdrawalRequest
getWithdrawalRequestReturns the stored home-vault withdrawal request data for requestId.
requestId
uint256
Withdrawal request identifier returned when the request was created.
getWithdrawalReceiver
getWithdrawalReceiverReturns the raw encoded receiver data stored for requestId. For direct EVM withdrawals this is the encoded destination address.
requestId
uint256
Withdrawal request identifier returned when the request was created.
minDepositNormalized
minDepositNormalizedReturns the current minimum accepted deposit value in normalized 18-decimal units.
HakoStableGateway
HakoStableGatewayHakoStableGateway is the chain-local contract users interact with on the supported non-home EVM chains. It accepts deposits locally and stores local payout requests on that chain.
deposit
depositDeposits an allowlisted stablecoin into the local gateway contract. This method does not mint vault shares locally. The deposit is later recorded on the home vault.
token
address
Deposit token address. The token must be allowlisted on the gateway.
amount
uint256
Deposit amount in the token's native decimals.
receiver
address
EVM identity that will be credited on the home vault after remote deposit recording.
ERC20 Transfer on the deposit token
from, to, value
Transfers the deposited stablecoin from the user to the gateway contract.
GatewayDepositRecorded
depositId: unique deposit id
sender: original caller
token: deposit token
amountToken: raw token amount
amountNormalized: deposit value in 18 decimals
receiver: receiver identity for home-vault accounting
Confirms that the gateway accepted the local deposit and created the remote deposit record.
requestWithdrawal
requestWithdrawalCreates a local gateway withdrawal request for payout on the current chain.
token
address
Payout token address. The token must be allowlisted on the gateway.
amountToken
uint256
Requested payout amount in the token's native decimals.
receiver
address
Destination EVM address that should receive the payout on this chain.
GatewayWithdrawalRequested
requestId: withdrawal request id
owner: request owner
receiver: destination address
token: payout token
amountToken: raw token amount
amountNormalized: value in 18 decimals
Confirms that the local gateway withdrawal request was created.
getWithdrawalRequest
getWithdrawalRequestReturns the stored gateway withdrawal request data for requestId.
requestId
uint256
Gateway withdrawal request identifier returned when the request was created.
getWithdrawalReceiver
getWithdrawalReceiverReturns the raw encoded receiver data stored for requestId. For current EVM gateway withdrawals this maps to the encoded destination address.
requestId
uint256
Gateway withdrawal request identifier returned when the request was created.
withdrawalNonce
withdrawalNonceReturns the current gateway withdrawal nonce used by the controller-based withdrawal flow for owner.
owner
address
Address whose gateway withdrawal nonce should be returned.
minDepositNormalized
minDepositNormalizedReturns the current minimum accepted deposit value on the gateway in normalized 18-decimal units.
Last updated