ITally
Tally interface
AddTallyResultsArgs
tally result args
struct AddTallyResultsArgs {
uint256[] voteOptionIndices;
uint256[] tallyResults;
uint256[][][] tallyResultProofs;
uint256 totalSpent;
uint256 totalSpentSalt;
uint256 tallyResultSalt;
uint256 newResultsCommitment;
uint256 spentVoiceCreditsHash;
uint256 perVOSpentVoiceCreditsHash;
}
verifyPerVOSpentVoiceCredits
function verifyPerVOSpentVoiceCredits(uint256 _voteOptionIndex, uint256 _spent, uint256[][] _spentProof, uint256 _spentSalt, uint8 _voteOptionTreeDepth, uint256 _spentVoiceCreditsHash, uint256 _resultCommitment) external view returns (bool)
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | isValid Whether the provided proof is valid |
verifySpentVoiceCredits
function verifySpentVoiceCredits(uint256 _totalSpent, uint256 _totalSpentSalt, uint256 _resultCommitment, uint256 _perVOSpentVoiceCreditsHash) external view returns (bool)
Verify the number of spent voice credits from the tally.json
Parameters
Name | Type | Description |
---|---|---|
_totalSpent | uint256 | spent field retrieved in the totalSpentVoiceCredits object |
_totalSpentSalt | uint256 | the corresponding salt in the totalSpentVoiceCredit object |
_resultCommitment | uint256 | hashLeftRight(merkle root of the results.tally, results.salt) in tally.json file |
_perVOSpentVoiceCreditsHash | uint256 | only for QV - hashLeftRight(merkle root of the no spent voice credits, salt) |