Skip to main content

Nft Vault

Overview

The NFT Vault is a sub-vault of users' main vault. The NFT Vault manages Capped Collateral tokens by holding the capped token in the NFT vault. Deposits to the NFT vault are made via the UniV3CollateralToken contract, and withdrawals occur at the main vault. The sub-vault provides additional functionality and acts as a conduit without requiring users to interact with it directly.

Each NFT Vault has the same owner and sub-vault ID as its parent vault. New vaults are made by the NFT Vault Controller, similar to the Vault Controller. Unlike the primary vault, users cannot send assets directly to the vault. Users should not interact with the vault contract directly, other than to collect rewards.

Constructor

  • uint256 id
    • The number of the vault. The same as the Parent.
  • address vault_address
    • The address of the primary vault.
  • address controller_address
    • where the vault references for access to the protocol.
  • address voting_controller_address
    • where the vault references for access to the protocol.

Modifier

  • onlyVotingVaultController
    • checks if _msgSender is the controller of the voting vault
  • onlyVaultController
    • checks if _msgSender is the controller of the vault
  • onlyMinter
    • check if _msgSender is the minter of the vault

Functions

  • function parentVault() external view returns (address)
    • return address(_parentVault)
  • function id() external view returns (uint96)
    • return _vaultInfo.id;
  • function collect(uint256 tokenId, address recipient) external onlyMinter
    • Allows the vault minter to collect any revenue generated by the Uni V3 Position
    • Uncollected revenue is not included in the value of the position and so does not contrubute to borrow power
  • function controllerTransfer(address _token, address _to, uint256 _amount) external onlyVaultController
    • Allows the primary vault controller to transfer tokens (used for the liquidation)
  • function votingVaultControllerTransfer(address _token, address _to, uint256 _amount) external onlyVotingVaultController
    • Allows the voting vault controller to transfer tokens (used for the withdraw)