Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions contracts/interfaces/IERC6372.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@

pragma solidity >=0.4.16;

/**
* @dev Interface for the Contract Clock standard.
*
* A standardized interface for a contract to expose the clock it uses internally, so that an external observer can
* tell whether it tracks time using timestamps, block numbers, or some other mode, instead of assuming one.
*/
interface IERC6372 {
/**
* @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).
* @dev Returns the current timepoint according to the mode the contract is operating on.
* This is a non-decreasing function of the chain, such as `block.timestamp` or `block.number`.
*
* NOTE: Clock must not return 0.
*/
function clock() external view returns (uint48);

/**
* @dev Description of the clock
* @dev Returns a machine-readable description of the clock, formatted as a URL query string.
* Timestamps are described as `mode=timestamp` and block numbers as `mode=blocknumber&from=default`,
* where `default` becomes a CAIP-2 chain ID (e.g. `eip155:1`) if the block number is not that of the
* `NUMBER` opcode (0x43). Any other mode uses a unique identifier for the `mode` field.
*/
// solhint-disable-next-line func-name-mixedcase
function CLOCK_MODE() external view returns (string memory);
Expand Down
Loading