Skip to content

Vault Contract Interface

0x1306D3c36eC7E38dd2c128fBe3097C2C2449af64

Vault.sol serves as the Honey vault which provides trading liquidity, and to which protocol fees accrue.

deposit

solidity
function deposit(
    uint256 assets,
    address receiver
) public returns (uint256)

Allows a user to deposit assets into the Vault and receive vault tokens in return.

Parameters

NameTypeDescription
assetsuint256The amount of assets to deposit.
receiveraddressThe address to receive the minted tokens.

Returns

TypeDescription
uint256The amount of tokens minted and received.

mint

solidity
function mint(
    uint256 shares,
    address receiver
) public returns (uint256)

Allows a user to mint vault tokens by depositing assets into the Vault.

Parameters

NameTypeDescription
sharesuint256The amount of vault tokens to mint.
receiveraddressThe address to receive the minted tokens.

Returns

TypeDescription
uint256The amount of assets deposited.

withdraw

solidity
function withdraw(
    uint256 assets,
    address receiver,
    address owner
) public returns (uint256)

Allows a user to withdraw assets from the Vault by burning vault tokens, denominated in number of underlying assets.

Parameters

NameTypeDescription
assetsuint256The amount of assets to withdraw.
receiveraddressThe address to receive the withdrawn assets.
owneraddressThe address of the token owner.

Returns

TypeDescription
uint256The amount of vault tokens burned.

redeem

solidity
function redeem(
    uint256 shares,
    address receiver,
    address owner
) public returns (uint256)

Allows a user to redeem vault tokens for the underlying assets, denomianted in vault shares.

Parameters

NameTypeDescription
sharesuint256The amount of tokens to redeem.
receiveraddressThe address to receive the redeemed assets.
owneraddressThe address of the token owner.

Returns

TypeDescription
uint256The amount of assets received.

makeWithdrawRequest

solidity
function makeWithdrawRequest(uint256 shares) external

Allows a user to request a withdrawal of vault tokens.

Parameters

NameTypeDescription
sharesuint256The amount of tokens to request withdrawal.

cancelWithdrawRequest

solidity
function cancelWithdrawRequest(
    uint256 shares,
    uint256 unlockEpoch
) external

Allows a user to cancel a pending withdrawal request.

Parameters

NameTypeDescription
sharesuint256The amount of vault tokens to cancel withdrawal for.
unlockEpochuint256The epoch number when the withdrawal can be claimed.

maxDeposit

solidity
function maxDeposit(address owner) public view returns (uint256)

Returns the maximum amount of assets that can be deposited by an owner.

Parameters

NameTypeDescription
owneraddressThe address of the owner.

Returns

TypeDescription
uint256The maximum amount of assets that can be deposited.

maxMint

solidity
function maxMint(address) public view returns (uint256)

Returns the maximum amount of shares that can be minted.

Parameters

NameTypeDescription
-addressThe address parameter is not used in the function.

Returns

TypeDescription
uint256The maximum amount of shares that can be minted.

maxWithdraw

solidity
function maxWithdraw(address owner) public view returns (uint256)

Returns the maximum amount of assets that can be withdrawn by an owner.

Parameters

NameTypeDescription
owneraddressThe address of the owner.

Returns

TypeDescription
uint256The maximum amount of assets that can be withdrawn.

maxRedeem

solidity
function maxRedeem(address owner) public view returns (uint256)

Returns the maximum amount of shares that can be redeemed by an owner.

Parameters

NameTypeDescription
owneraddressThe address of the owner.

Returns

TypeDescription
uint256The maximum amount of shares that can be redeemed.

sendAssets

solidity
function sendAssets(uint256 assets, address receiver) external

Allows the PnL handler to send assets to a receiver.

Parameters

NameTypeDescription
assetsuint256The amount of assets to send.
receiveraddressThe address to receive the assets.

receiveAssets

solidity
function receiveAssets(uint256 assets, address user) external

Allows the vault to receive assets from a user.

Parameters

NameTypeDescription
assetsuint256The amount of assets received.
useraddressThe address of the user sending the assets.

forceNewEpoch

solidity
function forceNewEpoch() external

Allows anyone to force start a new epoch if the current epoch has exceeded the epoch length.

tvl

solidity
function tvl() public view returns (uint256)

Returns the total value locked (TVL) in the vault.

Returns

TypeDescription
uint256The total value locked (TVL) in the vault.

availableAssets

solidity
function availableAssets() public view returns (uint256)

Returns the amount of assets available in the vault.

Returns

TypeDescription
uint256The amount of assets available in the vault.

marketCap

solidity
function marketCap() public view returns (uint256)

Returns the market capitalization of the vault.

Returns

TypeDescription
uint256The market capitalization of the vault.

balanceOfAssets

solidity
function balanceOfAssets(address owner) public view returns (uint256)

Returns the balance of assets for a given owner.

Parameters

NameTypeDescription
owneraddressThe address of the owner.

Returns

TypeDescription
uint256The balance of assets for the owner.