Skip to main content

VoteTimingV2

VoteTimingV2#

Functions#

init(struct VoteTimingV2.Data data, uint256 phaseLength, uint256 minRollToNextRoundLength) (internal)

Initializes the data object. Sets the phase length based on the input.

computeCurrentRoundId(struct VoteTimingV2.Data data, uint256 currentTime) โ†’ uint256 (internal)

Computes the roundID based off the current time as floor(timestamp/roundLength).

The round ID depends on the global timestamp but not on the lifetime of the system. The consequence is that the initial round ID starts at an arbitrary number (that increments, as expected, for subsequent rounds) instead of zero or one.

Parameters:#

  • data: input data object.
  • currentTime: input unix timestamp used to compute the current roundId.
computeRoundEndTime(struct VoteTimingV2.Data data, uint256 roundId) โ†’ uint256 (internal)

compute the round end time as a function of the round Id.

Parameters:#

  • data: input data object.
  • roundId: uniquely identifies the current round.
computeCurrentPhase(struct VoteTimingV2.Data data, uint256 currentTime) โ†’ enum VotingAncillaryInterface.Phase (internal)

Computes the current phase based only on the current time.

Parameters:#

  • data: input data object.
  • currentTime: input unix timestamp used to compute the current roundId.
computeRoundToVoteOnPriceRequest(struct VoteTimingV2.Data data, uint256 currentTime) โ†’ uint256 (internal)