Commit a vote for a price request for identifier at time.
identifier, 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 price, salt, voter address, time, current roundId, and identifier.
Snapshot the current round’s token balances and lock in the inflation rate and GAT.
This function can be called multiple times, but only the first call per round into this function or revealVote
will create the round snapshot. Any later calls will be a no-op. Will revert unless called during reveal period.
commits a vote and logs an event with a data blob, typically an encrypted version of the vote
An encrypted version of the vote is emitted in an event EncryptedVote to allow off-chain infrastructure to
retrieve the commit. The contents of encryptedVote are never used on chain: it is purely for convenience.
Submit a batch of commits in a single transaction.
Using encryptedVote is optional. If included then commitment is emitted in an event.
Look at project-root/common/Constants.js for the tested maximum number of
commitments that can fit in one transaction.
commits: struct to encapsulate an identifier, time, hash and optional encryptedVote.