Skip to content

Commit a92ddcf

Browse files
committed
fix: removed SafeSend from ruler and university, natspec tweaks, SafeSend solidity version
1 parent 08b2293 commit a92ddcf

15 files changed

+22
-35
lines changed

contracts/deploy/00-home-chain-arbitration-ruler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
3232
deployer, // governor
3333
pnk.target,
3434
[minStake, alpha, feeForJuror, jurorsForCourtJump],
35-
weth.target,
3635
],
3736
log: true,
3837
});

contracts/deploy/00-home-chain-arbitration-university.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
5959
[minStake, alpha, feeForJuror, jurorsForCourtJump],
6060
[0, 0, 0, 10], // evidencePeriod, commitPeriod, votePeriod, appealPeriod
6161
sortitionModule.address,
62-
weth.target,
6362
],
6463
log: true,
6564
}); // nonce+2 (implementation), nonce+3 (proxy)

contracts/src/arbitration/KlerosCore.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ contract KlerosCore is KlerosCoreBase {
3030
/// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.
3131
/// @param _sortitionExtraData The extra data for sortition module.
3232
/// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.
33-
/// @param _wNative The address for WETH tranfers.
33+
/// @param _wNative The wrapped native token address, typically wETH.
3434
function initialize(
3535
address _governor,
3636
address _guardian,

contracts/src/arbitration/KlerosCoreBase.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ abstract contract KlerosCoreBase is IArbitratorV2, Initializable, UUPSProxiable
101101
Dispute[] public disputes; // The disputes.
102102
mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.
103103
bool public paused; // Whether asset withdrawals are paused.
104-
address public wNative; // The address for WETH tranfers.
104+
address public wNative; // The wrapped native token for safeSend().
105105

106106
// ************************************* //
107107
// * Events * //

contracts/src/arbitration/KlerosCoreNeo.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ contract KlerosCoreNeo is KlerosCoreBase {
3939
/// @param _sortitionExtraData The extra data for sortition module.
4040
/// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.
4141
/// @param _jurorNft NFT contract to vet the jurors.
42-
/// @param _wNative The address for WETH tranfers.
42+
/// @param _wNative The wrapped native token address, typically wETH.
4343
function initialize(
4444
address _governor,
4545
address _guardian,

contracts/src/arbitration/KlerosGovernor.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "./interfaces/IDisputeTemplateRegistry.sol";
99
/// @title KlerosGovernor for V2. Note that appeal functionality and evidence submission will be handled by the court.
1010
contract KlerosGovernor is IArbitrableV2 {
1111
using SafeSend for address payable;
12+
1213
// ************************************* //
1314
// * Enums / Structs * //
1415
// ************************************* //
@@ -48,6 +49,7 @@ contract KlerosGovernor is IArbitrableV2 {
4849

4950
IArbitratorV2 public arbitrator; // Arbitrator contract.
5051
bytes public arbitratorExtraData; // Extra data for arbitrator.
52+
address public wNative; // The wrapped native token for safeSend().
5153
IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.
5254
uint256 public templateId; // The current dispute template identifier.
5355

@@ -62,8 +64,6 @@ contract KlerosGovernor is IArbitrableV2 {
6264
Submission[] public submissions; // Stores all created transaction lists. submissions[_listID].
6365
Session[] public sessions; // Stores all submitting sessions. sessions[_session].
6466

65-
address public wNative; // The address for WETH tranfers.
66-
6767
// ************************************* //
6868
// * Function Modifiers * //
6969
// ************************************* //
@@ -115,7 +115,7 @@ contract KlerosGovernor is IArbitrableV2 {
115115
/// @param _submissionTimeout Time in seconds allocated for submitting transaction list.
116116
/// @param _executionTimeout Time in seconds after approval that allows to execute transactions of the approved list.
117117
/// @param _withdrawTimeout Time in seconds after submission that allows to withdraw submitted list.
118-
/// @param _wNative The address of the WETH used by SafeSend for fallback transfers.
118+
/// @param _wNative The wrapped native token address, typically wETH.
119119
constructor(
120120
IArbitratorV2 _arbitrator,
121121
bytes memory _arbitratorExtraData,

contracts/src/arbitration/devtools/KlerosCoreRuler.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity ^0.8.24;
44

55
import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitratorV2.sol";
66
import {SafeERC20, IERC20} from "../../libraries/SafeERC20.sol";
7-
import {SafeSend} from "../../libraries/SafeSend.sol";
87
import {UUPSProxiable} from "../../proxy/UUPSProxiable.sol";
98
import {Initializable} from "../../proxy/Initializable.sol";
109
import "../../libraries/Constants.sol";
@@ -13,7 +12,6 @@ import "../../libraries/Constants.sol";
1312
/// Core arbitrator contract for development and testing purposes.
1413
contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
1514
using SafeERC20 for IERC20;
16-
using SafeSend for address payable;
1715

1816
string public constant override version = "0.8.0";
1917

@@ -95,7 +93,6 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
9593
mapping(IArbitrableV2 arbitrable => address ruler) public rulers; // The ruler of each arbitrable contract.
9694
mapping(IArbitrableV2 arbitrable => RulerSettings) public settings; // The settings of each arbitrable contract.
9795
mapping(uint256 disputeID => RulingResult) public rulingResults; // The ruling results of each dispute.
98-
address public wNative; // The address for WETH tranfers.
9996

10097
// ************************************* //
10198
// * Events * //
@@ -178,16 +175,13 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
178175
/// @param _governor The governor's address.
179176
/// @param _pinakion The address of the token contract.
180177
/// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).
181-
/// @param _wNative The address of the WETH used by SafeSend for fallback transfers.
182178
function initialize(
183179
address _governor,
184180
IERC20 _pinakion,
185-
uint256[4] memory _courtParameters,
186-
address _wNative
181+
uint256[4] memory _courtParameters
187182
) external reinitializer(1) {
188183
governor = _governor;
189184
pinakion = _pinakion;
190-
wNative = _wNative;
191185

192186
// FORKING_COURT
193187
// TODO: Fill the properties for the Forking court, emit CourtCreated.
@@ -531,7 +525,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
531525
round.sumFeeRewardPaid += feeReward;
532526
if (round.feeToken == NATIVE_CURRENCY) {
533527
// The dispute fees were paid in ETH
534-
payable(account).safeSend(feeReward, wNative);
528+
payable(account).send(feeReward);
535529
} else {
536530
// The dispute fees were paid in ERC20
537531
round.feeToken.safeTransfer(account, feeReward);

contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ contract DisputeKitClassic is DisputeKitClassicBase {
2525
/// @dev Initializer.
2626
/// @param _governor The governor's address.
2727
/// @param _core The KlerosCore arbitrator.
28-
/// @param _wNative The address for WETH tranfers.
28+
/// @param _wNative The wrapped native token address, typically wETH.
2929
function initialize(address _governor, KlerosCore _core, address _wNative) external reinitializer(1) {
3030
__DisputeKitClassicBase_initialize(_governor, _core, _wNative);
3131
}

contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {SafeSend} from "../../libraries/SafeSend.sol";
1515
/// - an appeal system: fund 2 choices only, vote on any choice.
1616
abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxiable {
1717
using SafeSend for address payable;
18+
1819
// ************************************* //
1920
// * Structs * //
2021
// ************************************* //
@@ -66,7 +67,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
6667
mapping(uint256 localDisputeID => mapping(uint256 localRoundID => mapping(address drawnAddress => bool)))
6768
public alreadyDrawn; // True if the address has already been drawn, false by default. To be added to the Round struct when fully redeploying rather than upgrading.
6869
mapping(uint256 coreDisputeID => bool) public coreDisputeIDToActive; // True if this dispute kit is active for this core dispute ID.
69-
address public wNative; // The address for WETH tranfers.
70+
address public wNative; // The wrapped native token for safeSend().
7071

7172
// ************************************* //
7273
// * Events * //
@@ -145,7 +146,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
145146
/// @dev Initializer.
146147
/// @param _governor The governor's address.
147148
/// @param _core The KlerosCore arbitrator.
148-
/// @param _wNative The address for WETH tranfers.
149+
/// @param _wNative The wrapped native token address, typically wETH.
149150
function __DisputeKitClassicBase_initialize(
150151
address _governor,
151152
KlerosCore _core,
@@ -463,7 +464,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
463464
round.contributions[_beneficiary][_choice] = 0;
464465

465466
if (amount != 0) {
466-
_beneficiary.safeSend(amount, wNative); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.
467+
_beneficiary.safeSend(amount, wNative);
467468
emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);
468469
}
469470
}

contracts/src/arbitration/dispute-kits/DisputeKitGated.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ contract DisputeKitGated is DisputeKitClassicBase {
4141
/// @dev Initializer.
4242
/// @param _governor The governor's address.
4343
/// @param _core The KlerosCore arbitrator.
44-
/// @param _wNative The address for WETH tranfers.
44+
/// @param _wNative The wrapped native token address, typically wETH.
4545
function initialize(address _governor, KlerosCore _core, address _wNative) external reinitializer(1) {
4646
__DisputeKitClassicBase_initialize(_governor, _core, _wNative);
4747
}

0 commit comments

Comments
 (0)