EIP-XXX Time Scheme

Motivation: many of the recent EIPs and development require a specification of what time scheme is being used. For example, in Voting, a snapshot of voting weight will only be meaningful if there is a sense of time-point. Also, for time-delay or recurring payment, it’s important to align between Smart Contract and its callers what time scheme they are used. The most often used are blocknum and timestamp which is made available in EVM. But we can leave to future extension for other type of time scheme.

EIP-XXX Time Scheme

Specification

enum TimeSchemeOption {
  blocknum = 0;
  timestamp = 1;
};

interface ERCTimeScheme {
  function defaultTimeScheme() external pure returns(TimeSchemeOption);
}

Ref Impl

contract Foo is ERCTimeScheme, ERC1202, ERC5805, ERC5732 {
    function defaultTimeScheme() external pure returns(TimeSchemeOption) {
      return TimeSchemeOption.blocknum;
   }
}

This help ensuring whenever a time is being used, the scheme is acquirable and shall be consistent across different functions.

Complying contracts of EIP-1202 probably need to align with the same sense of time too. The EIP-5007: Time NFT, EIP-721 Time Extension however choose to use int64 for unix stamp.