Library to compute rounds and phases for an equal length commit-reveal voting cycle.

init(struct VoteTiming.Data data, uint256 phaseLength) internal

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

computeCurrentRoundId(struct VoteTiming.Data data, uint256 currentTime) → uint256 roundId internal

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


  • data: input data object.

  • currentTime: input unix timeStamp used to compute the current roundId.

computeRoundEndTime(struct VoteTiming.Data data, uint256 roundId) → uint256 timestamp internal

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


  • data: input data object.

  • roundId: uniquely identifies the current round.

computeCurrentPhase(struct VoteTiming.Data data, uint256 currentTime) → enum VotingInterface.Phase internal

Computes the current phase based only on the current time.

© UMA Project 2018-2019