Token Vault

This is where NFTs are housed and fractional ownership is tracked. The contract is an ERC20 token which tracks ownership.

Contract Storage:

    /// -----------------------------------
    /// -------- TOKEN INFORMATION --------
    /// -----------------------------------

    /// @notice the ERC721 token address of the vault's token
    address public token;

    /// @notice the ERC721 token ID of the vault's token
    uint256 public id;
    /// -------------------------------------
    /// -------- AUCTION INFORMATION --------
    /// -------------------------------------

    /// @notice the unix timestamp end time of the token auction
    uint256 public auctionEnd;

    /// @notice the length of auctions
    uint256 public auctionLength;

    /// @notice reservePrice * votingTokens
    uint256 public reserveTotal;

    /// @notice the current price of the token during an auction
    uint256 public livePrice;

    /// @notice the current user winning the token auction
    address payable public winning;

    enum State { inactive, live, ended, redeemed }

    State public auctionState;

Governance Functions:

This function allows for governance to remove a curator who is acting maliciously in some way.

Curator Functions:

Allows the curator to update their address.

Allows the curator to update the base price of the NFT. This will influence the max and min reserve prices.

Allows the curator to update the length of an auction for the NFT.

Allows the curator to update their fee.

Can be called by anyone but claims fees for the curator and governance.

Pricing Functions:

Public function for a user to update their desired reserve price. Updated the full reserve price as well.

This function is called on all token transfers. Its core functionality is to update the reserve price on transfer based on the new holders desired reserve prices.

Auction Functions:

Start an auction by sending ETH to the smart contract. This will set a livePrice variable and allow for bid() to be called.

Bid on an already live auction. Must send more ETH than the previous bid by a percentage set by governance. If the auction is within 15 minutes of ending, extend the auction by 15 minutes.

This can be called by anyone once an auction has ended to close the vault and send NFT to the winner.

Burn the total supply of ownership tokens to receive the NFT.

Burn your tokens to receive ETH based on your percentage of the total supply. Only to be called once an auction has ended.

Helper function to try to send someone ETH and if that fails we force them to take WETH.

Last updated

Was this helpful?