Skip to content

Commit 3f78e40

Browse files
fix(xLiquid): small fixes
1 parent 6fbf7d3 commit 3f78e40

File tree

5 files changed

+6
-76
lines changed

5 files changed

+6
-76
lines changed

contracts/src/gateway/interfaces/IForeignGateway.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ interface IForeignGateway is IArbitrator, IReceiverGateway {
2121

2222
function withdrawFees(bytes32 _disputeHash) external;
2323

24-
// TODO: add withdrawal for ERC20?
25-
2624
// For cross-chain Evidence standard
2725
function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);
2826

contracts/src/gateway/xForeignGateway.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ contract xForeignGateway is IForeignGateway {
125125
// ************************************* //
126126

127127
function createDispute(
128-
uint256 _choices,
129-
bytes calldata _extraData
128+
uint256 /*_choices*/,
129+
bytes calldata /*_extraData*/
130130
) external payable override returns (uint256 disputeID) {
131-
// TODO
131+
revert("Fees should be paid in WETH");
132132
}
133133

134134
function createDisputeERC20(
@@ -195,7 +195,6 @@ contract xForeignGateway is IForeignGateway {
195195
arbitrable.rule(dispute.id, _ruling);
196196
}
197197

198-
// TODO: separate regular withdrawal from ERC20
199198
function withdrawFees(bytes32 _disputeHash) external override {
200199
DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];
201200
require(dispute.id != 0, "Dispute does not exist");

contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pragma solidity ^0.8;
44

55
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
6-
import "../../libraries/SafeMath.sol";
6+
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
77
import "../interfaces/ITokenController.sol";
88
import "./interfaces/ITokenBridge.sol";
99
import "./interfaces/IERC677.sol";

contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,6 @@ contract xKlerosLiquidToV2 is Initializable, ITokenController, IArbitrator {
829829
) public payable override returns (uint256 disputeID) {
830830
require(msg.value == 0, "Fees should be paid in WETH");
831831
uint256 fee = foreignGateway.arbitrationCost(_extraData);
832-
// TODO: give possibility to overpay. Use createDisputeERC20 function?
833832
require(weth.transferFrom(msg.sender, address(this), fee), "Not enough WETH for arbitration");
834833

835834
(uint96 subcourtID, uint256 minJurors) = extraDataToSubcourtIDAndMinJurors(_extraData);
@@ -842,7 +841,7 @@ contract xKlerosLiquidToV2 is Initializable, ITokenController, IArbitrator {
842841
dispute.lastPeriodChange = block.timestamp;
843842
// As many votes that can be afforded by the provided funds.
844843

845-
uint256 nbVotes = msg.value / courts[dispute.subcourtID].feeForJuror;
844+
uint256 nbVotes = fee / courts[dispute.subcourtID].feeForJuror;
846845

847846
uint256 newLastRoundID = disputeNbRounds[disputeID];
848847
disputeNbVotesInRound[disputeID][newLastRoundID] = nbVotes;
@@ -853,7 +852,7 @@ contract xKlerosLiquidToV2 is Initializable, ITokenController, IArbitrator {
853852
dispute.tokensAtStakePerJuror.push(
854853
(courts[dispute.subcourtID].minStake * courts[dispute.subcourtID].alpha) / ALPHA_DIVISOR
855854
);
856-
dispute.totalFeesForJurors.push(msg.value);
855+
dispute.totalFeesForJurors.push(fee);
857856
dispute.votesInEachRound.push(0);
858857
dispute.repartitionsInEachRound.push(0);
859858
dispute.penaltiesInEachRound.push(0);

contracts/src/libraries/SafeMath.sol

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)