Interface that voters must use to Vote on price request resolutions.
Commit a vote for a price request for
time must correspond to a price request that’s currently in the commit phase.
Commits can be changed.
Since transaction data is public, the salt will be revealed with the vote. While this is the system’s expected behavior,
voters should never reuse salts. If someone else is able to guess the voted price and knows that a salt will be reused, then
they can determine the vote pre-reveal.
identifier: uniquely identifies the committed vote. EG BTC/USD price pair.
time: unix timestamp of the price being voted on.
hash: keccak256 hash of the
Submit a batch of commits in a single transaction.
encryptedVote is optional. If included then commitment is stored on chain.
project-root/common/Constants.js for the tested maximum number of
commitments that can fit in one transaction.
commits: array of structs that encapsulate an
snapshot the current round’s token balances and lock in the inflation rate and GAT.
This function can be called multiple times but each round will only every have one snapshot at the
time of calling
Reveal a previously committed vote for
identifier, must hash to the latest
commitVote() was called with. Only the committer can reveal their vote.
identifier: voted on in the commit phase. EG BTC/USD price pair.
time: specifies the unix timestamp of the price is being voted on.
price: voted on during the commit phase.
salt: value used to hide the commitment price during the commit phase.
Reveal multiple votes in a single transaction.
project-root/common/Constants.js for the tested maximum number of reveals.
that can fit in one transaction.
For more information on reveals, review the comment for
reveals: array of the Reveal struct which contains an identifier, time, price and salt.
Gets the queries that are being voted on this round.
Returns the current voting phase, as a function of the current time.
Returns the current round ID, as a function of the current time.
retrieveRewards(address voterAddress, uint256 roundId, struct VotingInterface.PendingRequest toRetrieve) → struct FixedPoint.Unsigned public
Retrieves rewards owed for a set of resolved price requests.
Can only retrieve rewards if calling for a valid round and if the call is done within the timeout threshold (not expired).
voterAddress: voter for which rewards will be retrieved. Does not have to be the caller.
roundId: the round from which voting rewards will be retrieved from.
toRetrieve: array of PendingRequests which rewards are retrieved from.