CreateVaultZap
CreateVaultZap.sol
This contract is a zap for creating and setting up a vault.
Table of Contents
Constants
MINIMUM_INVENTORY_LIQUIDITY
Set to NFTX inventory staking contract's MINIMUM_LIQUIDITY
.
WETH
Address of WETH contract.
vaultFactory
Address of NFTXVaultFactoryUpgradeableV3.
nftxRouter
Address of NFTXRouter contract.
ammFactory
Address of NFTX AMM's UniswapV3FactoryUpgradeable contract.
inventoryStaking
Address of NFTXInventoryStakingV3Upgradeable contract.
positionManager
Address of the NFTX AMM's NonfungiblePositionManager contract.
Write Functions
createVault
Sells one or more ERC721 NFTs for ETH.
Parameters | Type | Description |
---|---|---|
params |
| See table below. |
|
| Amount of ETH to send. |
CreateVaultParams | Type | Description |
---|---|---|
vaultInfo |
| See table below. |
eligibilityStorage |
| See table below. |
nftIds |
| TokenIDs of NFTs to deposit. |
nftAmounts |
| Amounts of NFTs. |
vaultFeaturesFlag |
| Packed booleans in the order: |
vaultFees |
| See table below. |
liquidityParams | LiquidityParams | See table below. |
VaultInfo | Type | Description |
---|---|---|
assetAddress |
| NFT collection address. |
is1155 |
| Whether the collection uses ERC1155. |
allowAllItems |
| Whether all token IDs from the collection are allowed in vault. |
name |
| ERC20 vToken name. |
symbol |
| ERC20 vToken symbol. |
VaultEligibilityStorage | Type | Description |
---|---|---|
moduleIndex |
| Module index number. |
initData |
| Module initialization data. |
VaultFees | Type | Description |
---|---|---|
mintFee |
| Vault mint fee. 1e16 = 1%. |
redeemFee |
| Vault redeem fee. 1e16 = 1%. |
swapFee |
| Vault swap fee. 1e16 = 1%. |
LiquidityParams | Type | Description |
---|---|---|
lowerNFTPriceInETH |
| Lower vToken price bound of liquidity. |
upperNFTPriceInETH |
| Upper vToken price bound of liquidity. |
fee |
| Fee tier of AMM pool. |
currentNFTPriceInETH |
| Current vToken price. Only used if the AMM pool is new and must be initialized. |
vTokenMin |
| Minimum required vToken amount to be added. |
wethMin |
| Minimum required WETH amount to be added. |
deadline |
| Deadline for transaction to succeed, expressed as a Unix timestamp in seconds. |
Return values | Type | Description |
---|---|---|
vaultId |
| ID number of newly deployed vault. |
Last updated