ERC 5725: Transferable Vesting NFTs is an EIP created to offer a standardized Non-Fungible Token (NFT) API to enable vesting ERC-20 tokens over a vesting release curve. Read on to learn more about how to implement EIP-5725 for your own use cases
Following the Specification
After reading through ERC-5725, the main section you will focus on during integration will be the ERC-5725 specification.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
During the integration process, take some time to read carefully through the natspec comments of the ERC-5725 specification to ensure you are implementing the functions the correct way. The key words above help define how the functions should work, given different inputs.
Follow along below for how to use this interface to create your own ERC-5725 NFTs.
Implementing an ERC-5725 Contract
Obtain the Base Contracts
The simplest way to get started is to head to the EIP-5725 Reference Implementation GitHub repository and click the button Use this templateto quickly create a copy of the code under your own GitHub profile.
Otherwise, you can use git clone to copy the code locally, or even download the code in .ZIP files under the <> Code drop down.
$ git clone [email protected]:ApeSwapFinance/eip-5725-vesting-nft-implementation.git
$ cd eip-5725-vesting-nft-implementation
Use git clone to pull the reference code
Extending ERC5725.sol: Easily Create Vesting NFTs
ERC5725.sol is a valid IERC-5725 implementation which can be used as a base to quickly create Vesting NFTs.
// To Write
ERC5725.sol is an abstract contract. To be able to implement ERC5725.sol you will need to import it into a parent contract and override 5 virtual functions:
vestedPayoutAtTime: Total amount of vested tokens at the provided timestamp for a given tokenId. This number also includes vested tokens which have been claimed.
_payoutToken: Payout token of a given tokenId.
_payout: The total payout of a given tokenId.
_startTime: The unix timestamp of when vesting starts for a given tokenId.
_endTime: The unix timestamp of when vesting ends for a given tokenId.
Full ERC5725 Implementation
// To Write
Two contracts are fully implemented in the reference directory: LinearVestingNFT and VestingNFT.
Extend ERC5725 by importing it: contract LinearVestingNFT is ERC5725
It can be seen in this implementation that the five virtual functions above are implemented in this contact with override specifiers
vestedPayoutAtTime is the central place to be able to change the vesting curve. In this case, it first checks that the _cliff has passed, otherwise it will linearly release tokens between the _startTime and _endTime
Implement Your Own!
// To Write
ERC5725.sol is a great starting place to easily get off the ground with Vesting NFTs.
Use the reference implementations shared above as a guide to easily implement your own!
Transferable Vesting NFTs brought to you by ApeBond & Paladin
ApeBond and Paladin, a blockchain security provider, collaborated to develop an extension to the ERC-721 standard that allows for exciting new functionality for NFTs. The ERC-5725: Transferable Vesting NFT standard is the result of careful consideration of what NFTs can and should be, as well as many rounds of real-world testing and iteration.
What is ERC-5725?
ERC-5725 (Ethereum Request for Comments 5725) provides an interface for transferable vesting NFTs which release underlying tokens over time.
While time locks and vesting are both important mechanisms for controlling the distribution of ERC-20 tokens and have been around since the age of ICOs, the lack of standardization across the industry can be problematic. Without a standardized approach, it can be difficult for investors to understand how a particular token is being distributed and what the implications of that distribution might be.
How does ERC-5725 work?
ERC-5725 allows for the implementation of a standard API for NFT based contracts to allow two primary functionalities: transferability, and vesting.
Projects that implement ERC-5725 are able to use their NFTs to represent unvested tokens that belong to the holder of the NFT. In other words, this standard allows projects to either integrate with an existing NFT marketplace, or create their own, to be used as a secondary market for vesting tokens.
Also, using ERC-5725, projects can hold and represent the vested and locked properties of any underlying token (ERC-20 or otherwise) that is emitted to the NFT holder. This standard is an extension of the ERC-721 token that provides basic functionality for creating vesting NFTs, claiming the tokens and reading vesting curve properties.
Who created ERC-5725?
ApeGuru and Apetastic, core contributors to ApeBond, created the ERC-5725 after realizing that no such standard existed when developing vesting contracts for ApeBond’s business development partners. They enlisted the help of Paladin to review the contracts and ensure the highest level of security and usability for future projects. ApeBond used the standard in creating the Bonds to raise protocol-owned liquidity through the sale of discounted vesting tokens in exchange for user LP tokens.
Why is ERC-5725 important?
ERC-5725 allows projects to implement several new capabilities to create value for users and projects:
Transferability of vesting tokensWhen using ERC-5725, vesting tokens are emitted to the holder of a transferable NFT, meaning that users can buy or sell the NFTs that represent unvested tokens. This secondary market offers users more flexibility around the underlying asset, as they can liquidate or trade it at any time.
Custom NFT art capabilitiesERC-5725 also allows projects to create custom NFT art based on a variety of underlying inputs. For example, projects can choose to include a limited edition seal or color scheme on NFTs of particular significance or value, which can then become one of the considerations when valuing the NFT on a secondary market.
Novel vesting curvesThe vesting curves within ERC-5725 NFTs do not have to be linear — they are entirely customizable, and can have accelerating or decelerating vesting depending on the use case required by the project.
Aggregated, holistic views of vesting tokens and propertiesThe standard ERC-5725 API enables projects to create holistic dashboards and reporting tools that aggregate the status of their vesting NFTs across entire chains, which can help the project make more informed strategic decisions about future releases and marketing efforts.
How are projects using ERC-5725 right now?
ApeBond has used the ERC-5725 standard to create a category of products called Bonds. Bonds allow crypto projects to create transferable NFTs that users purchase with liquidity provider tokens. Holders of the NFTs then receive the project’s native token at a discount, which is set by a variety of factors including Bond supply and token prices, linearly over the course of a vesting period set by the project.
This serves two purposes — first, users get access to discounted tokens that vest over time instead of having to buy them directly at current market prices, and second, projects receive LP tokens that represent liquidity they now own and control. This approach is superior to the traditional yield farming model in that the capital that a project puts forth in the form of discounted tokens generates a return in the form of project-owned liquidity, as opposed to rented liquidity where reward tokens spent generate no return for the project.
To date, ApeBond has created over $5M worth of protocol-owned liquidity through the sale of Bonds based on the ERC-5725 standard.
Why should users educate themselves on ERC-5725?
ApeBond and Paladin are excited to promote the ERC-5725 standard to the crypto community at large to enable users to take advantage of the many opportunities that it creates.
If you have a favorite crypto project that might be a good fit for Bonds, have them reach out to us using our partnership application form.
Who can I contact about ERC-5725?
ApeGuru invites anyone with questions about ERC-5725 to reach out to them on Telegram at @Apegurus .
Interesting in learning more about how to deploy an ERC-5725 contract?
Please consult our implementation guide here