Skip to content

Commit 4530869

Browse files
committed
chore: replaced @dev natspec with @notice where relevant, fixed foundry doc generation
1 parent 78833f3 commit 4530869

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+670
-580
lines changed

contracts/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@
8787
"watch": "hardhat watch",
8888
"natspec-smells": "natspec-smells",
8989
"docgen": "hardhat docgen",
90-
"docserve": "scripts/docPreprocess.sh && forge doc --serve",
91-
"docbuild": "scripts/docPreprocess.sh && forge doc --build --out dist && scripts/docPostprocess.sh",
9290
"populate:courts:devnet": "hardhat populate:courts --from v2_devnet --network arbitrumSepoliaDevnet",
9391
"populate:courts:testnet": "hardhat populate:courts --from v2_testnet --network arbitrumSepolia",
9492
"populate:courts:mainnet": "hardhat populate:courts --from v2_mainnet --network arbitrum",

contracts/src/arbitration/DisputeTemplateRegistry.sol

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import "../proxy/Initializable.sol";
66
import "./interfaces/IDisputeTemplateRegistry.sol";
77

88
/// @title Dispute Template Registry
9-
/// @dev A contract to maintain a registry of dispute templates.
9+
/// @notice A contract to maintain a registry of dispute templates.
1010
contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {
1111
string public constant override version = "2.0.0";
1212

1313
// ************************************* //
1414
// * Storage * //
1515
// ************************************* //
1616

17-
/// @dev The owner of the contract.
17+
/// @notice The owner of the contract.
1818
address public owner;
1919

20-
/// @dev The number of templates.
20+
/// @notice The number of templates.
2121
uint256 public templates;
2222

2323
// ************************************* //
@@ -38,7 +38,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
3838
_disableInitializers();
3939
}
4040

41-
/// @dev Initializer
41+
/// @notice Initializer
4242
/// @param _owner Owner of the contract.
4343
function initialize(address _owner) external initializer {
4444
owner = _owner;
@@ -54,7 +54,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
5454
// NOP
5555
}
5656

57-
/// @dev Changes the owner of the contract.
57+
/// @notice Changes the owner of the contract.
5858
/// @param _owner The new owner.
5959
function changeOwner(address _owner) external onlyByOwner {
6060
owner = _owner;
@@ -64,10 +64,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
6464
// * State Modifiers * //
6565
// ************************************* //
6666

67-
/// @dev Registers a new dispute template.
68-
/// @param _templateTag The tag of the template (optional).
69-
/// @param _templateData The data of the template.
70-
/// @param _templateDataMappings The data mappings of the template.
67+
/// @inheritdoc IDisputeTemplateRegistry
7168
function setDisputeTemplate(
7269
string memory _templateTag,
7370
string memory _templateData,

contracts/src/arbitration/KlerosCore.sol

Lines changed: 70 additions & 81 deletions
Large diffs are not rendered by default.

contracts/src/arbitration/KlerosGovernor.sol

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitrableV2.sol";
66
import {SafeSend} from "../libraries/SafeSend.sol";
77
import "./interfaces/IDisputeTemplateRegistry.sol";
88

9-
/// @title KlerosGovernor for V2. Note that appeal functionality and evidence submission will be handled by the court.
9+
/// @title KlerosGovernor for V2.
10+
/// @dev Appeal and evidence submission is handled by the court.
1011
contract KlerosGovernor is IArbitrableV2 {
1112
using SafeSend for address payable;
1213

@@ -89,7 +90,7 @@ contract KlerosGovernor is IArbitrableV2 {
8990
// * Events * //
9091
// ************************************* //
9192

92-
/// @dev Emitted when a new list is submitted.
93+
/// @notice Emitted when a new list is submitted.
9394
/// @param _listID The index of the transaction list in the array of lists.
9495
/// @param _submitter The address that submitted the list.
9596
/// @param _session The number of the current session.
@@ -106,7 +107,7 @@ contract KlerosGovernor is IArbitrableV2 {
106107
// * Constructor * //
107108
// ************************************* //
108109

109-
/// @dev Constructor.
110+
/// @notice Constructor.
110111
/// @param _arbitrator The arbitrator of the contract.
111112
/// @param _arbitratorExtraData Extra data for the arbitrator.
112113
/// @param _templateData The dispute template data.
@@ -145,32 +146,34 @@ contract KlerosGovernor is IArbitrableV2 {
145146
// * Governance * //
146147
// ************************************* //
147148

148-
/// @dev Changes the value of the base deposit required for submitting a list.
149+
/// @notice Changes the value of the base deposit required for submitting a list.
149150
/// @param _submissionBaseDeposit The new value of the base deposit, in wei.
150151
function changeSubmissionDeposit(uint256 _submissionBaseDeposit) external onlyByOwner {
151152
submissionBaseDeposit = _submissionBaseDeposit;
152153
}
153154

154-
/// @dev Changes the time allocated for submission. Note that it can't be changed during approval period because there can be an active dispute in the old arbitrator contract
155+
/// @notice Changes the time allocated for submission.
156+
/// @dev It cannot be changed during approval period because there can be an active dispute in the old arbitrator contract
155157
/// and prolonging submission timeout might switch it back to submission period.
156158
/// @param _submissionTimeout The new duration of the submission period, in seconds.
157159
function changeSubmissionTimeout(uint256 _submissionTimeout) external onlyByOwner duringSubmissionPeriod {
158160
submissionTimeout = _submissionTimeout;
159161
}
160162

161-
/// @dev Changes the time allocated for list's execution.
163+
/// @notice Changes the time allocated for list's execution.
162164
/// @param _executionTimeout The new duration of the execution timeout, in seconds.
163165
function changeExecutionTimeout(uint256 _executionTimeout) external onlyByOwner {
164166
executionTimeout = _executionTimeout;
165167
}
166168

167-
/// @dev Changes list withdrawal timeout. Note that withdrawals are only possible in the first half of the submission period.
169+
/// @notice Changes list withdrawal timeout. Note that withdrawals are only possible in the first half of the submission period.
168170
/// @param _withdrawTimeout The new duration of withdraw period, in seconds.
169171
function changeWithdrawTimeout(uint256 _withdrawTimeout) external onlyByOwner {
170172
withdrawTimeout = _withdrawTimeout;
171173
}
172174

173-
/// @dev Changes the arbitrator of the contract. Note that it can't be changed during approval period because there can be an active dispute in the old arbitrator contract.
175+
/// @notice Changes the arbitrator of the contract.
176+
/// @dev It cannot be changed during approval period because there can be an active dispute in the old arbitrator contract.
174177
/// @param _arbitrator The new trusted arbitrator.
175178
/// @param _arbitratorExtraData The extra data used by the new arbitrator.
176179
function changeArbitrator(
@@ -181,7 +184,7 @@ contract KlerosGovernor is IArbitrableV2 {
181184
arbitratorExtraData = _arbitratorExtraData;
182185
}
183186

184-
/// @dev Update the dispute template data.
187+
/// @notice Update the dispute template data.
185188
/// @param _templateData The new dispute template data.
186189
/// @param _templateDataMappings The new dispute template data mappings.
187190
function changeDisputeTemplate(
@@ -195,7 +198,7 @@ contract KlerosGovernor is IArbitrableV2 {
195198
// * State Modifiers * //
196199
// ************************************* //
197200

198-
/// @dev Creates transaction list based on input parameters and submits it for potential approval and execution.
201+
/// @notice Creates transaction list based on input parameters and submits it for potential approval and execution.
199202
/// @param _target List of addresses to call.
200203
/// @param _value List of values required for respective addresses.
201204
/// @param _data Concatenated calldata of all transactions of this list.
@@ -249,8 +252,8 @@ contract KlerosGovernor is IArbitrableV2 {
249252
reservedETH += submission.deposit;
250253
}
251254

252-
/// @dev Withdraws submitted transaction list. Reimburses submission deposit.
253-
/// Withdrawal is only possible during the first half of the submission period and during withdrawTimeout after the submission is made.
255+
/// @notice Withdraws submitted transaction list. Reimburses submission deposit.
256+
/// @dev Withdrawal is only possible during the first half of the submission period and during withdrawTimeout after the submission is made.
254257
/// @param _submissionID Submission's index in the array of submitted lists of the current sesssion.
255258
/// @param _listHash Hash of a withdrawing list.
256259
function withdrawTransactionList(uint256 _submissionID, bytes32 _listHash) external {
@@ -269,8 +272,8 @@ contract KlerosGovernor is IArbitrableV2 {
269272
payable(msg.sender).transfer(submission.deposit);
270273
}
271274

272-
/// @dev Approves a transaction list or creates a dispute if more than one list was submitted.
273-
/// If nothing was submitted changes session.
275+
/// @notice Approves a transaction list or creates a dispute if more than one list was submitted.
276+
/// @dev If nothing was submitted changes session.
274277
function executeSubmissions() external duringApprovalPeriod {
275278
Session storage session = sessions[sessions.length - 1];
276279
if (session.status != Status.NoDispute) revert AlreadyDisputed();
@@ -304,7 +307,8 @@ contract KlerosGovernor is IArbitrableV2 {
304307
}
305308
}
306309

307-
/// @dev Gives a ruling for a dispute. Must be called by the arbitrator.
310+
/// @notice Gives a ruling for a dispute.
311+
/// @dev Must be called by the arbitrator.
308312
/// @param _disputeID ID of the dispute in the Arbitrator contract.
309313
/// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Refuse to arbitrate".
310314
/// Note If the final ruling is "0" nothing is approved and deposits will stay locked in the contract.
@@ -332,7 +336,7 @@ contract KlerosGovernor is IArbitrableV2 {
332336
emit Ruling(IArbitratorV2(msg.sender), _disputeID, _ruling);
333337
}
334338

335-
/// @dev Executes selected transactions of the list.
339+
/// @notice Executes selected transactions of the list.
336340
/// @param _listID The index of the transaction list in the array of lists.
337341
/// @param _cursor Index of the transaction from which to start executing.
338342
/// @param _count Number of transactions to execute. Executes until the end if set to "0" or number higher than number of transactions in the list.
@@ -354,16 +358,16 @@ contract KlerosGovernor is IArbitrableV2 {
354358
}
355359
}
356360

357-
/// @dev Receive function to receive funds for the execution of transactions.
361+
/// @notice Receive function to receive funds for the execution of transactions.
358362
receive() external payable {}
359363

360-
/// @dev Gets the sum of contract funds that are used for the execution of transactions.
364+
/// @notice Gets the sum of contract funds that are used for the execution of transactions.
361365
/// @return Contract balance without reserved ETH.
362366
function getExpendableFunds() public view returns (uint256) {
363367
return address(this).balance - reservedETH;
364368
}
365369

366-
/// @dev Gets the info of the specific transaction in the specific list.
370+
/// @notice Gets the info of the specific transaction in the specific list.
367371
/// @param _listID The index of the transaction list in the array of lists.
368372
/// @param _transactionIndex The index of the transaction.
369373
/// @return target The target of the transaction.
@@ -379,30 +383,33 @@ contract KlerosGovernor is IArbitrableV2 {
379383
return (transaction.target, transaction.value, transaction.data, transaction.executed);
380384
}
381385

382-
/// @dev Gets the array of submitted lists in the session.
383-
/// Note that this function is O(n), where n is the number of submissions in the session. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
386+
/// @notice Gets the array of submitted lists in the session.
387+
///
388+
/// @dev This function is O(n), where `n` is the number of submissions in the session.
389+
/// This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
390+
///
384391
/// @param _session The ID of the session.
385392
/// @return submittedLists Indexes of lists that were submitted during the session.
386393
function getSubmittedLists(uint256 _session) external view returns (uint256[] memory submittedLists) {
387394
Session storage session = sessions[_session];
388395
submittedLists = session.submittedLists;
389396
}
390397

391-
/// @dev Gets the number of transactions in the list.
398+
/// @notice Gets the number of transactions in the list.
392399
/// @param _listID The index of the transaction list in the array of lists.
393400
/// @return txCount The number of transactions in the list.
394401
function getNumberOfTransactions(uint256 _listID) external view returns (uint256 txCount) {
395402
Submission storage submission = submissions[_listID];
396403
return submission.txs.length;
397404
}
398405

399-
/// @dev Gets the number of lists created in contract's lifetime.
406+
/// @notice Gets the number of lists created in contract's lifetime.
400407
/// @return The number of created lists.
401408
function getNumberOfCreatedLists() external view returns (uint256) {
402409
return submissions.length;
403410
}
404411

405-
/// @dev Gets the number of the ongoing session.
412+
/// @notice Gets the number of the ongoing session.
406413
/// @return The number of the ongoing session.
407414
function getCurrentSessionNumber() external view returns (uint256) {
408415
return sessions.length - 1;

contracts/src/arbitration/PolicyRegistry.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import "../proxy/UUPSProxiable.sol";
55
import "../proxy/Initializable.sol";
66

77
/// @title PolicyRegistry
8-
/// @dev A contract to maintain a policy for each court.
8+
/// @notice A contract to maintain a policy for each court.
99
contract PolicyRegistry is UUPSProxiable, Initializable {
1010
string public constant override version = "2.0.0";
1111

1212
// ************************************* //
1313
// * Events * //
1414
// ************************************* //
1515

16-
/// @dev Emitted when a policy is updated.
16+
/// @notice Emitted when a policy is updated.
1717
/// @param _courtID The ID of the policy's court.
1818
/// @param _courtName The name of the policy's court.
1919
/// @param _policy The URI of the policy JSON.
@@ -30,7 +30,7 @@ contract PolicyRegistry is UUPSProxiable, Initializable {
3030
// * Function Modifiers * //
3131
// ************************************* //
3232

33-
/// @dev Requires that the sender is the owner.
33+
/// @notice Requires that the sender is the owner.
3434
modifier onlyByOwner() {
3535
if (owner != msg.sender) revert OwnerOnly();
3636
_;
@@ -45,7 +45,7 @@ contract PolicyRegistry is UUPSProxiable, Initializable {
4545
_disableInitializers();
4646
}
4747

48-
/// @dev Constructs the `PolicyRegistry` contract.
48+
/// @notice Constructs the `PolicyRegistry` contract.
4949
/// @param _owner The owner's address.
5050
function initialize(address _owner) external initializer {
5151
owner = _owner;
@@ -63,7 +63,7 @@ contract PolicyRegistry is UUPSProxiable, Initializable {
6363
// NOP
6464
}
6565

66-
/// @dev Changes the `owner` storage variable.
66+
/// @notice Changes the `owner` storage variable.
6767
/// @param _owner The new value for the `owner` storage variable.
6868
function changeOwner(address _owner) external onlyByOwner {
6969
owner = _owner;
@@ -73,7 +73,7 @@ contract PolicyRegistry is UUPSProxiable, Initializable {
7373
// * State Modifiers * //
7474
// ************************************* //
7575

76-
/// @dev Sets the policy for the specified court.
76+
/// @notice Sets the policy for the specified court.
7777
/// @param _courtID The ID of the specified court.
7878
/// @param _courtName The name of the specified court.
7979
/// @param _policy The URI of the policy JSON.

0 commit comments

Comments
 (0)