Skip to content

Commit 0ba4f29

Browse files
fix(IArbitrator): change name to arbitration cost
1 parent e81fb8b commit 0ba4f29

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- fix(Arbitrator): memory to calldata ([4770b1f](https://github.com/kleros/kleros-v2/commit/4770b1f))
44
- fix(IArbitrator): appeals removed from the standard ([02c20ce](https://github.com/kleros/kleros-v2/commit/02c20ce))
5+
- fix(IArbitrator): interface simplification ([e81fb8b](https://github.com/kleros/kleros-v2/commit/e81fb8b))
56
- fix(IArbitrator): replaced appealCost with fundingStatus ([f189dd9](https://github.com/kleros/kleros-v2/commit/f189dd9))
67
- feat: modern toolchain setup and simple RNG smart contracts ([17f6a76](https://github.com/kleros/kleros-v2/commit/17f6a76))
78
- feat(Arbitration): standard update ([ed930de](https://github.com/kleros/kleros-v2/commit/ed930de))

contracts/src/arbitration/CentralizedArbitrator.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ contract CentralizedArbitrator is IArbitrator {
5050
address public owner = msg.sender; // Owner of the contract.
5151
uint256 public appealDuration; // The duration of the appeal period.
5252

53-
uint256 private arbitrationFee; // The cost to create a dispute. Made private because of the cost() getter.
53+
uint256 private arbitrationFee; // The cost to create a dispute. Made private because of the arbitrationCost() getter.
5454
uint256 public appealFee; // The cost to fund one of the choices, not counting the additional fee stake amount.
5555

5656
DisputeStruct[] public disputes; // Stores the dispute info. disputes[disputeID].
@@ -155,7 +155,7 @@ contract CentralizedArbitrator is IArbitrator {
155155
}
156156

157157
/** @dev Create a dispute. Must be called by the arbitrable contract.
158-
* Must be paid at least cost().
158+
* Must be paid at least arbitrationCost().
159159
* @param _choices Amount of choices the arbitrator can make in this dispute.
160160
* @param _extraData Can be used to give additional info on the dispute to be created.
161161
* @return disputeID ID of the dispute created.
@@ -166,8 +166,8 @@ contract CentralizedArbitrator is IArbitrator {
166166
override
167167
returns (uint256 disputeID)
168168
{
169-
uint256 arbitrationCost = cost(_extraData);
170-
require(msg.value >= arbitrationCost, "Not enough ETH to cover arbitration costs.");
169+
uint256 localArbitrationCost = arbitrationCost(_extraData);
170+
require(msg.value >= localArbitrationCost, "Not enough ETH to cover arbitration costs.");
171171
disputeID = disputes.length;
172172
disputes.push(
173173
DisputeStruct({
@@ -329,7 +329,7 @@ contract CentralizedArbitrator is IArbitrator {
329329
/** @dev Cost of arbitration.
330330
* @return fee The required amount.
331331
*/
332-
function cost(
332+
function arbitrationCost(
333333
bytes calldata /*_extraData*/
334334
) public view override returns (uint256 fee) {
335335
return arbitrationFee;

contracts/src/arbitration/IArbitrator.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "./IArbitrable.sol";
1010
* Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.
1111
* When developing arbitrator contracts we need to:
1212
* - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).
13-
* - Define the functions for cost display (cost).
13+
* - Define the functions for cost display (arbitrationCost).
1414
* - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).
1515
*/
1616
interface IArbitrator {
@@ -23,7 +23,7 @@ interface IArbitrator {
2323

2424
/**
2525
* @dev Create a dispute. Must be called by the arbitrable contract.
26-
* Must pay at least cost(_extraData).
26+
* Must pay at least arbitrationCost(_extraData).
2727
* @param _choices Amount of choices the arbitrator can make in this dispute.
2828
* @param _extraData Can be used to give additional info on the dispute to be created.
2929
* @return disputeID ID of the dispute created.
@@ -35,5 +35,5 @@ interface IArbitrator {
3535
* @param _extraData Can be used to give additional info on the dispute to be created.
3636
* @return cost Required cost of arbitration.
3737
*/
38-
function cost(bytes calldata _extraData) external view returns (uint256 cost);
38+
function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);
3939
}

0 commit comments

Comments
 (0)