@@ -238,7 +238,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
238
238
/// `n` is the number of votes.
239
239
/// @param _coreDisputeID The ID of the dispute in Kleros Core.
240
240
/// @param _voteIDs The IDs of the votes.
241
- /// @param _commit The commitment hash .
241
+ /// @param _commit The commit. Note that justification string is a part of the commit .
242
242
function castCommit (
243
243
uint256 _coreDisputeID ,
244
244
uint256 [] calldata _voteIDs ,
@@ -283,14 +283,13 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
283
283
Round storage round = dispute.rounds[dispute.rounds.length - 1 ];
284
284
(uint96 courtID , , , , ) = core.disputes (_coreDisputeID);
285
285
(, bool hiddenVotes , , , , , ) = core.courts (courtID);
286
- bytes32 voteHash = hashVote (_choice, _salt, _justification);
287
286
288
287
// Save the votes.
289
288
for (uint256 i = 0 ; i < _voteIDs.length ; i++ ) {
290
289
require (round.votes[_voteIDs[i]].account == msg .sender , "The caller has to own the vote. " );
291
290
require (
292
- ! hiddenVotes || round.votes[_voteIDs[i]].commit == voteHash ,
293
- "The vote hash must match the commitment in courts with hidden votes. "
291
+ ! hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256 ( abi.encodePacked (_choice, _salt)) ,
292
+ "The commit must match the choice in courts with hidden votes. "
294
293
);
295
294
require (! round.votes[_voteIDs[i]].voted, "Vote already cast. " );
296
295
round.votes[_voteIDs[i]].choice = _choice;
@@ -436,22 +435,6 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
436
435
// * Public Views * //
437
436
// ************************************* //
438
437
439
- /**
440
- * @dev Computes the hash of a vote using ABI encoding
441
- * @dev The unused parameters may be used by overriding contracts.
442
- * @param _choice The choice being voted for
443
- * @param _justification The justification for the vote
444
- * @param _salt A random salt for commitment
445
- * @return bytes32 The hash of the encoded vote parameters
446
- */
447
- function hashVote (
448
- uint256 _choice ,
449
- uint256 _salt ,
450
- string memory _justification
451
- ) public pure virtual returns (bytes32 ) {
452
- return keccak256 (abi.encodePacked (_choice, _salt));
453
- }
454
-
455
438
function getFundedChoices (uint256 _coreDisputeID ) public view returns (uint256 [] memory fundedChoices ) {
456
439
Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
457
440
Round storage lastRound = dispute.rounds[dispute.rounds.length - 1 ];
0 commit comments