ERC-7595 Collateralized NFT

Draft · NFTs & multi-token · created 2023-03-13

An extension standard that lets ERC-20 tokens or native coins be held as collateral inside an ERC-721 NFT, which the NFT owner can withdraw. It enables the NFT's minimum value to be verified on-chain.

Why it is needed

Services that lend money against NFT collateral typically value the NFT based on the collection's floor price, the lowest price at which it is currently being sold in the market. However, floor prices fluctuate widely based on supply and demand in the NFT market and are more volatile than the crypto market as a whole. In certain collections, price manipulation can artificially inflate prices, distorting even the floor prices that lending services rely on. Ultimately, valuing NFTs based solely on market price is unpredictable and unreliable. This standard places actual tokens as collateral inside the NFT and lets anyone verify that balance on-chain, giving the NFT a verifiable minimum value independent of market sentiment. It also proposes royalties backed by the collateral asset and additional revenue streams for creators.

What to implement

In depth

Collateral deposit and withdrawal

collateralize(tokenId, amounts, tokenAddresses) takes arrays of token addresses and amounts to deposit multiple ERC-20 tokens as collateral in a single transaction. It is declared payable so it can also receive the native coin. uncollateralize can only be called by the NFT owner and withdraws the collateral. For queries, collateralBalances(tokenId, tokenAddress) returns the token balance held under a tokenId, and collateralTokens(tokenId, index) returns the list of tokens ever deposited as collateral for that tokenId. Fees are defined in the commissions array, where the first element is the deposit fee and the second is the withdrawal fee, with a three-decimal buffer so that 1000 equals 1%.

Native coin represented by the 0x0 address

Every ERC-20 token has its own contract address, but the native coin has no address. This standard uses the null address (0x0000000000000000000000000000000000000000) as the identifier for the native coin when depositing collateral, since the null address cannot collide with a smart contract address.

disperse: distributing collateral across the collection

disperse(amounts, tokenAddresses) deposits collateral at once across every asset in the collection rather than a single NFT. The total collateral amount is deposited into the smart contract, and each user can claim their share when adding or withdrawing collateral for that asset. Query functions include disperseBalance (total amount deposited), disperseTotalTaken (total amount already claimed), disperseTaken (amount claimed per tokenId), and disperseTokens (list of tokens used for distribution).

harvest, communityToken, and blackHole

Each collection can designate a community ERC-20 token (communityToken), which can be paid to exchange for fees accumulated during the collateral deposit and withdrawal process. getAmount(amount, tokenAddress) calculates the harvestable amount based on the amount of community token spent, and harvest performs the actual exchange. Since some ERC-20 implementations prohibit transfers to the null address, the community tokens received during harvesting are sent to the blackHole contract and removed from circulation. blackHole is an address designed so that it cannot send any token out and only allows read operations.

Four presets

The original text presents four presets. The Basic preset evaluates an on-chain verifiable price floor for a specific NFT asset. The Dynamic preset allows the tokenURI to be changed on-chain according to predetermined collateral rules. The Royalty preset lets creators receive royalties on trades between the asset owner and an externally owned account (EOA), as well as on trades with smart contracts. The VRF preset uses Chainlink's Verifiable Random Function (VRF) to distribute collateral among multiple NFT holders.

EnviousHouse for existing collections

For ERC-721 collections that have already been deployed and cannot be redeployed, an abstraction layer smart contract called IEnviousHouse is provided. This contract replicates all the functionality of the standard and provides access to collateral via mappings. Calling registerCollection(collection, token, incoming, outcoming) registers an ERC-721-compatible collection, grants it collateral functionality, and performs an initial minimum distribution to all NFT holders. The fee rate is interpreted as incoming / 1e5 * 100%. Collections that are not ERC-721 compatible can be added to the exception list with setSpecificCollection, and registration status can be queried via totalCollections, collections, and collectionIds. Each function takes the same form as the individual collection standard's function, with an additional collection address argument.

The name Envious

The original text proposes calling NFT collections issued under this standard, or existing ERC-721 collections using the EnviousHouse abstraction layer, Envious.

Still in Draft stage

This proposal is in Draft status, created in March 2023. Since the specification is not finalized, the content may change or progress may stall going forward.

Things to watch out for

Original ERC · ← ERCs