NFTX
v3.0
Search
K

CreateVaultZap

CreateVaultZap.sol
This contract is a zap for creating and setting up a vault.

Table of Contents

Public Write Functions

Constants

MINIMUM_INVENTORY_LIQUIDITY

uint256 internal immutable MINIMUM_INVENTORY_LIQUIDITY
Set to NFTX inventory staking contract's MINIMUM_LIQUIDITY.

WETH

function WETH() external view returns (address)
Address of WETH contract.

vaultFactory

function vaultFactory() external view returns (address)
Address of NFTXVaultFactoryUpgradeableV3.

nftxRouter

function nftxRouter() external view returns (address)
Address of NFTXRouter contract.

ammFactory

function ammFactory() external view returns (address)
Address of NFTX AMM's UniswapV3FactoryUpgradeable contract.

inventoryStaking

function inventoryStaking() external view returns (address)
Address of NFTXInventoryStakingV3Upgradeable contract.

positionManager

function positionManager() external view returns (address)
Address of the NFTX AMM's NonfungiblePositionManager contract.

Write Functions

createVault

function createVault(
CreateVaultParams calldata params
) external payable returns (uint256 vaultId)
Sells one or more ERC721 NFTs for ETH.
Parameters
Type
Description
params
CreateVaultParams
See table below.
msg.value
uint256
Amount of ETH to send.
CreateVaultParams
Type
Description
vaultInfo
VaultInfo
See table below.
eligibilityStorage
VaultEligibilityStorage
See table below.
nftIds
uint256[]
TokenIDs of NFTs to deposit.
nftAmounts
uint256[]
Amounts of NFTs.
vaultFeaturesFlag
uint256
Packed booleans in the order: enableMint, enableRedeem, enableSwap.
vaultFees
VaultFees
See table below.
liquidityParams
LiquidityParams
See table below.
VaultInfo
Type
Description
assetAddress
address
NFT collection address.
is1155
bool
Whether the collection uses ERC1155.
allowAllItems
bool
Whether all token IDs from the collection are allowed in vault.
name
string
ERC20 vToken name.
symbol
string
ERC20 vToken symbol.
VaultEligibilityStorage
Type
Description
moduleIndex
uint256
Module index number.
initData
bytes
Module initialization data.
VaultFees
Type
Description
mintFee
uint256
Vault mint fee. 1e16 = 1%.
redeemFee
uint256
Vault redeem fee. 1e16 = 1%.
swapFee
uint256
Vault swap fee. 1e16 = 1%.
LiquidityParams
Type
Description
lowerNFTPriceInETH
uint256
Lower vToken price bound of liquidity.
upperNFTPriceInETH
uint256
Upper vToken price bound of liquidity.
fee
uint24
Fee tier of AMM pool.
currentNFTPriceInETH
uint256
Current vToken price. Only used if the AMM pool is new and must be initialized.
vTokenMin
uint256
Minimum required vToken amount to be added.
wethMin
uint256
Minimum required WETH amount to be added.
deadline
uint256
Deadline for transaction to succeed, expressed as a Unix timestamp in seconds.
Return values
Type
Description
vaultId
uint256
ID number of newly deployed vault.