Skip to content

Commit d3470ad

Browse files
committed
fix: natspec
1 parent e36f679 commit d3470ad

File tree

2 files changed

+65
-88
lines changed

2 files changed

+65
-88
lines changed

contracts/src/arbitration/IArbitrableV2.sol

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,61 @@ pragma solidity ^0.8;
44

55
import "./IArbitratorV2.sol";
66

7-
/**
8-
* @title IArbitrableV2
9-
* Arbitrable interface.
10-
* When developing arbitrable contracts, we need to:
11-
* - Define the action taken when a ruling is received by the contract.
12-
* - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);
13-
*/
7+
/// @title IArbitrableV2
8+
/// @notice Arbitrable interface.
9+
/// When developing arbitrable contracts, we need to:
10+
/// - Define the action taken when a ruling is received by the contract.
11+
/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);
1412
interface IArbitrableV2 {
15-
/**
16-
* @dev To be emitted when a new dispute template is created.
17-
* @param _templateId The ID of the dispute template.
18-
* @param _templateTag An optional tag for the dispute template, such as "registration" or "removal".
19-
* @param data The template data.
20-
*/
21-
event NewDisputeTemplate(
22-
uint256 indexed _templateId,
23-
string indexed _templateTag,
24-
string data
25-
);
13+
/// @dev To be emitted when a new dispute template is created.
14+
/// @param _templateId The ID of the dispute template.
15+
/// @param _templateTag An optional tag for the dispute template, such as "registration" or "removal".
16+
/// @param data The template data.
17+
event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data);
2618

27-
/**
28-
* @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
29-
* @param _arbitrator The arbitrator of the contract.
30-
* @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.
31-
* @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
32-
* @param _templateId The ID of the dispute template. Should not be used with _templateUri.
33-
* @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
34-
*/
19+
/// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
20+
/// @param _arbitrator The arbitrator of the contract.
21+
/// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.
22+
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
23+
/// @param _templateId The ID of the dispute template. Should not be used with _templateUri.
24+
/// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
3525
event DisputeRequest(
3626
IArbitratorV2 indexed _arbitrator,
3727
uint256 indexed _arbitrableDisputeID,
3828
uint256 _externalDisputeID,
3929
uint256 _templateId,
4030
string _templateUri
4131
);
42-
43-
/**
44-
* @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
45-
* @param _arbitrator The arbitrator of the contract.
46-
* @param _arbitrableChainId The chain ID of the Arbitrable contract.
47-
* @param _arbitrable The address of the Arbitrable contract.
48-
* @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.
49-
* @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
50-
* @param _templateId The ID of the dispute template. Should not be used with _templateUri.
51-
* @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
52-
*/
32+
33+
/// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
34+
/// @param _arbitrator The arbitrator of the contract.
35+
/// @param _arbitrableChainId The chain ID of the Arbitrable contract.
36+
/// @param _arbitrable The address of the Arbitrable contract.
37+
/// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.
38+
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
39+
/// @param _templateId The ID of the dispute template. Should not be used with _templateUri.
40+
/// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
5341
event CrossChainDisputeRequest(
54-
IArbitratorV2 indexed _arbitrator,
42+
IArbitratorV2 indexed _arbitrator,
5543
uint256 _arbitrableChainId,
56-
address indexed _arbitrable,
44+
address indexed _arbitrable,
5745
uint256 indexed _arbitrableDisputeID,
5846
uint256 _externalDisputeID,
5947
uint256 _templateId,
6048
string _templateUri
6149
);
6250

63-
/**
64-
* @dev To be raised when a ruling is given.
65-
* @param _arbitrator The arbitrator giving the ruling.
66-
* @param _disputeID ID of the dispute in the Arbitrator contract.
67-
* @param _ruling The ruling which was given.
68-
*/
51+
/// @dev To be raised when a ruling is given.
52+
/// @param _arbitrator The arbitrator giving the ruling.
53+
/// @param _disputeID ID of the dispute in the Arbitrator contract.
54+
/// @param _ruling The ruling which was given.
6955
event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);
7056

71-
/**
72-
* @dev Give a ruling for a dispute. Must be called by the arbitrator.
73-
* The purpose of this function is to ensure that the address calling it has the right to rule on the contract.
74-
* @param _disputeID ID of the dispute in the Arbitrator contract.
75-
* @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
76-
*/
57+
/// @dev Give a ruling for a dispute.
58+
/// Must be called by the arbitrator.
59+
/// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.
60+
/// @param _disputeID ID of the dispute in the Arbitrator contract.
61+
/// @param _ruling Ruling given by the arbitrator.
62+
/// Note that 0 is reserved for "Not able/wanting to make a decision".
7763
function rule(uint256 _disputeID, uint256 _ruling) external;
7864
}

contracts/src/arbitration/IArbitratorV2.sol

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,42 @@ pragma solidity ^0.8;
44

55
import "./IArbitrableV2.sol";
66

7-
/**
8-
* @title Arbitrator
9-
* Arbitrator interface that implements the new arbitration standard.
10-
* Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.
11-
* When developing arbitrator contracts we need to:
12-
* - 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 (arbitrationCost).
14-
* - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).
15-
*/
7+
/// @title Arbitrator
8+
/// Arbitrator interface that implements the new arbitration standard.
9+
/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.
10+
/// When developing arbitrator contracts we need to:
11+
/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).
12+
/// - Define the functions for cost display (arbitrationCost).
13+
/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).
1614
interface IArbitratorV2 {
17-
/**
18-
* @dev To be emitted when a dispute is created.
19-
* @param _disputeID Identifier of the dispute.
20-
* @param _arbitrable The contract which created the dispute.
21-
*/
15+
/// @dev To be emitted when a dispute is created.
16+
/// @param _disputeID Identifier of the dispute.
17+
/// @param _arbitrable The contract which created the dispute.
2218
event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);
2319

24-
/**
25-
* @dev To be raised when a ruling is given.
26-
* @param _arbitrable The arbitrable receiving the ruling.
27-
* @param _disputeID Identifier of the dispute in the Arbitrator contract.
28-
* @param _ruling The ruling which was given.
29-
*/
20+
/// @dev To be raised when a ruling is given.
21+
/// @param _arbitrable The arbitrable receiving the ruling.
22+
/// @param _disputeID Identifier of the dispute in the Arbitrator contract.
23+
/// @param _ruling The ruling which was given.
3024
event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);
3125

32-
/**
33-
* @dev Create a dispute. Must be called by the arbitrable contract.
34-
* Must pay at least arbitrationCost(_extraData).
35-
* @param _choices Amount of choices the arbitrator can make in this dispute.
36-
* @param _extraData Can be used to give additional info on the dispute to be created.
37-
* @return disputeID Identifier of the dispute created.
38-
*/
26+
/// @dev Create a dispute.
27+
/// Must be called by the arbitrable contract.
28+
/// Must pay at least arbitrationCost(_extraData).
29+
/// @param _choices Amount of choices the arbitrator can make in this dispute.
30+
/// @param _extraData Can be used to give additional info on the dispute to be created.
31+
/// @return disputeID Identifier of the dispute created.
3932
function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);
4033

41-
/**
42-
* @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
43-
* @param _extraData Can be used to give additional info on the dispute to be created.
44-
* @return cost Required cost of arbitration.
45-
*/
34+
/// @dev Compute the cost of arbitration.
35+
/// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
36+
/// @param _extraData Can be used to give additional info on the dispute to be created.
37+
/// @return cost Required cost of arbitration.
4638
function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);
4739

48-
/**
49-
* @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.
50-
* @param _disputeID ID of the dispute.
51-
* @return ruling The ruling which has been given or the one which will be given if there is no appeal.
52-
*/
40+
/// @dev Return the current ruling of a dispute.
41+
/// This is useful for parties to know if they should appeal.
42+
/// @param _disputeID ID of the dispute.
43+
/// @return ruling The ruling which has been given or the one which will be given if there is no appeal.
5344
function currentRuling(uint _disputeID) external view returns (uint ruling);
5445
}

0 commit comments

Comments
 (0)