ERC-5007: Time NFT, ERC-721 Time Extension

Add start time and end time to ERC-721 tokens.


Metadata
Status: FinalStandards Track: ERCCreated: 2022-04-13
Authors
Anders (@0xanders), Lance (@LanceSnow), Shrug (shrug@emojidao.org)
Requires

Abstract


This standard is an extension of ERC-721. It proposes some additional functions (startTime, endTime) to help with on-chain time management.

Motivation


Some NFTs have a defined usage period and cannot be used outside of that period. With traditional NFTs that do not include time information, if you want to mark a token as invalid or enable it at a specific time, you need to actively submit a transaction—a process both cumbersome and expensive.

Some existing NFTs contain time functions, but their interfaces are not consistent, so it is difficult to develop third-party platforms for them.

By introducing these functions (startTime, endTime), it is possible to enable and disable NFTs automatically on chain.

Specification


The keywords "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.


The composable extension is OPTIONAL for this standard. This allows your NFT to be minted from an existing NFT or to merge two NFTs into one NFT.


Rationale


Time Data Type

The max value of uint64 is 18,446,744,073,709,551,615. As a timestamp, 18,446,744,073,709,551,615 is about year 584,942,419,325. uint256 is too big for C, C++, Java, Go, etc, and uint64 is natively supported by mainstream programming languages.

Backwards Compatibility


This standard is fully ERC-721 compatible.

Test Cases


Test cases are included in test.js.

Run in terminal:


Reference Implementation


See ERC5007.sol.

Security Considerations


No security issues found.

Copyright


Copyright and related rights waived via CC0.