Skip to content

Commit f4d60e5

Browse files
committed
fix: typo, bug and useless condition
1 parent ca27499 commit f4d60e5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

contracts/GeneralizedTCR.sol

+4-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ contract GeneralizedTCR is IArbitrable, IEvidence {
6565
}
6666

6767
struct Round {
68-
uint[3] amountPaid; // Tracks the sum for each Party in this round. Includes arbitration fees, fee stakes and deposits.
68+
uint[3] amountPaid; // Tracks the sum paid for each Party in this round. Includes arbitration fees, fee stakes and deposits.
6969
bool[3] hasPaid; // True if the Party has fully paid its fee in this round.
7070
uint feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.
7171
mapping(address => uint[3]) contributions; // Maps contributors to their contributions for each side.
@@ -366,7 +366,6 @@ contract GeneralizedTCR is IArbitrable, IEvidence {
366366
uint appealCost = request.arbitrator.appealCost(request.disputeID, request.arbitratorExtraData);
367367
uint totalCost = appealCost.addCap((appealCost.mulCap(multiplier)) / MULTIPLIER_DIVISOR);
368368
uint contribution = contribute(round, _side, msg.sender, msg.value, totalCost);
369-
round.paidArbitrationFees[uint(_side)] += appealCost;
370369

371370
emit AppealContribution(
372371
_itemID,
@@ -415,17 +414,16 @@ contract GeneralizedTCR is IArbitrable, IEvidence {
415414
_beneficiary != request.parties[uint(Party.Challenger)]
416415
) return;
417416

418-
uint side = _beneficiary == request.parties[uint(Party.Requester)] ? 1 : 2;
419-
if (round.contributions[_beneficiary][side] == 0) return;
417+
Party side = _beneficiary == request.parties[uint(Party.Requester)] ? Party.Requester : Party.Challenger;
420418

421419
// The first round is special since it does not include crowdfunding fees,
422420
// or stake multipliers. The only participants are the requester and challenger.
423421
//
424422
// Arbitration costs can rise or fall between when a request was made and when it was
425423
// challenged. To keep things fair, we reimburse proportionally to the amount
426424
// contributed.
427-
reward = round.contributions[_beneficiary][side].subCap(round.paidArbitrationFees[side]); // Base deposit.
428-
uint arbitrationFeesSide = round.paidArbitrationFees[side];
425+
reward = round.contributions[_beneficiary][uint(side)].subCap(round.paidArbitrationFees[uint(side)]); // Base deposit.
426+
uint arbitrationFeesSide = round.paidArbitrationFees[uint(side)];
429427
uint totalArbitrationFeesPaid = round.paidArbitrationFees[uint(Party.Requester)] + round.paidArbitrationFees[uint(Party.Requester)];
430428

431429
// Reimbursable fees are total amount paid minus the amount paid by the challenger

0 commit comments

Comments
 (0)