Skip to content

Commit 568eb40

Browse files
committed
chore: foundry lint
1 parent 1b6c98a commit 568eb40

File tree

10 files changed

+16
-7
lines changed

10 files changed

+16
-7
lines changed

contracts/foundry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ src = 'src'
1010
out = 'out'
1111
libs = ['../node_modules', 'lib']
1212

13+
[lint]
14+
severity = ['high', 'medium']
15+
1316
[rpc_endpoints]
1417
arbitrumSepolia = "https://sepolia-rollup.arbitrum.io/rpc"
1518
arbitrum = "https://arb1.arbitrum.io/rpc"

contracts/src/arbitration/university/KlerosCoreUniversity.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,9 +851,9 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
851851
sortitionModule.unlockStake(account, pnkLocked);
852852

853853
// Compute the rewards
854-
uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * pnkCoherence) / ONE_BASIS_POINT;
854+
uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * pnkCoherence) / ONE_BASIS_POINT; /// forge-lint: disable-line(divide-before-multiply)
855855
round.sumPnkRewardPaid += pnkReward;
856-
uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * feeCoherence) / ONE_BASIS_POINT;
856+
uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * feeCoherence) / ONE_BASIS_POINT; /// forge-lint: disable-line(divide-before-multiply)
857857
round.sumFeeRewardPaid += feeReward;
858858

859859
// Transfer the fee reward

contracts/src/libraries/SafeSend.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ library SafeSend {
1919
if (_to.send(_value)) return;
2020

2121
WethLike(_wethLike).deposit{value: _value}();
22-
WethLike(_wethLike).transfer(_to, _value);
22+
WethLike(_wethLike).transfer(_to, _value); /// forge-lint: disable-line(erc20-unchecked-transfer)
2323
}
2424
}

contracts/src/token/Faucet.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pragma solidity ^0.8.24;
44

55
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
66

7+
/// forge-lint: disable-next-item(erc20-unchecked-transfer)
78
contract Faucet {
89
// ************************************* //
910
// * Storage * //

contracts/src/utils/TransactionBatcher.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ contract TransactionBatcher {
1717
bytes[] memory datas
1818
) public payable {
1919
for (uint256 i = 0; i < targets.length; i++) {
20+
/// forge-lint: disable-next-line(unchecked-call)
2021
targets[i].call{value: values[i]}(datas[i]); // Intentionally ignoring return value.
2122
}
2223
}

contracts/test/foundry/KlerosCore_Disputes.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import "../../src/libraries/Constants.sol";
1010

1111
/// @title KlerosCore_DisputesTest
1212
/// @dev Tests for KlerosCore dispute creation and management
13+
/// forge-lint: disable-next-item(erc20-unchecked-transfer)
1314
contract KlerosCore_DisputesTest is KlerosCore_TestBase {
1415
function test_createDispute_eth() public {
1516
// Create a new court and DK to test non-standard extra data

contracts/test/foundry/KlerosCore_Execution.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import "../../src/libraries/Constants.sol";
1111

1212
/// @title KlerosCore_ExecutionTest
1313
/// @dev Tests for KlerosCore execution, rewards, and ruling finalization
14+
/// forge-lint: disable-next-item(erc20-unchecked-transfer)
1415
contract KlerosCore_ExecutionTest is KlerosCore_TestBase {
1516
function test_execute() public {
1617
uint256 disputeID = 0;

contracts/test/foundry/KlerosCore_Initialization.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import "../../src/libraries/Constants.sol";
1414

1515
/// @title KlerosCore_InitializationTest
1616
/// @dev Tests for KlerosCore initialization and basic configuration
17+
/// forge-lint: disable-next-item(erc20-unchecked-transfer)
1718
contract KlerosCore_InitializationTest is KlerosCore_TestBase {
18-
function test_initialize() public {
19+
function test_initialize() public view {
1920
assertEq(core.owner(), msg.sender, "Wrong owner");
2021
assertEq(core.guardian(), guardian, "Wrong guardian");
2122
assertEq(address(core.pinakion()), address(pinakion), "Wrong pinakion address");
@@ -96,7 +97,6 @@ contract KlerosCore_InitializationTest is KlerosCore_TestBase {
9697
address newOwner = msg.sender;
9798
address newGuardian = vm.addr(1);
9899
address newStaker1 = vm.addr(2);
99-
address newOther = vm.addr(9);
100100
address newJurorProsecutionModule = vm.addr(8);
101101
uint256 newMinStake = 1000;
102102
uint256 newAlpha = 10000;

contracts/test/foundry/KlerosCore_Staking.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import "../../src/libraries/Constants.sol";
1010

1111
/// @title KlerosCore_StakingTest
1212
/// @dev Tests for KlerosCore staking mechanics and stake management
13+
/// forge-lint: disable-next-item(erc20-unchecked-transfer)
1314
contract KlerosCore_StakingTest is KlerosCore_TestBase {
1415
function test_setStake_increase() public {
1516
vm.prank(owner);

contracts/test/foundry/KlerosCore_TestBase.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {IKlerosCore, KlerosCoreSnapshotProxy} from "../../src/arbitration/view/K
2323

2424
/// @title KlerosCore_TestBase
2525
/// @dev Abstract base contract for KlerosCore tests containing shared setup and utilities
26+
/// forge-lint: disable-next-item(erc20-unchecked-transfer)
2627
abstract contract KlerosCore_TestBase is Test {
2728
event Initialized(uint64 version);
2829

@@ -224,7 +225,7 @@ abstract contract KlerosCore_TestBase is Test {
224225
uint256 expectedAlpha,
225226
uint256 expectedFeeForJuror,
226227
uint256 expectedJurorsForJump
227-
) internal {
228+
) internal view {
228229
(
229230
uint96 courtParent,
230231
bool courtHiddenVotes,
@@ -243,7 +244,7 @@ abstract contract KlerosCore_TestBase is Test {
243244
}
244245

245246
/// @dev Helper function to check times per period
246-
function _assertTimesPerPeriod(uint96 courtId, uint256[4] memory expectedTimes) internal {
247+
function _assertTimesPerPeriod(uint96 courtId, uint256[4] memory expectedTimes) internal view {
247248
uint256[4] memory courtTimesPerPeriod = core.getTimesPerPeriod(courtId);
248249
for (uint256 i = 0; i < 4; i++) {
249250
assertEq(courtTimesPerPeriod[i], expectedTimes[i], "Wrong times per period");

0 commit comments

Comments
 (0)