Skip to content

Commit 1bbd5a1

Browse files
Merge branch 'dev' into chore/migrate-to-reown
2 parents 41365fe + b472514 commit 1bbd5a1

File tree

115 files changed

+1915
-608
lines changed

Some content is hidden

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

115 files changed

+1915
-608
lines changed

.github/workflows/dependency-review.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#
33
# This Action will scan dependency manifest files that change as part of a Pull Request,
44
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5-
# Once installed, if the workflow run is marked as required,
5+
# Once installed, if the workflow run is marked as required,
66
# PRs introducing known-vulnerable packages will be blocked from merging.
77
#
88
# Source repository: https://github.com/actions/dependency-review-action
99
name: 'Dependency Review'
10-
on:
10+
on:
1111
merge_group:
1212
pull_request:
1313

@@ -25,6 +25,7 @@ jobs:
2525
egress-policy: block
2626
allowed-endpoints: >
2727
api.github.com:443
28+
api.deps.dev:443
2829
github.com:443
2930
pipelinesghubeus2.actions.githubusercontent.com:443
3031
acghubeus1.actions.githubusercontent.com:443

contracts/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
1919
- [EvidenceModule: proxy](https://arbiscan.io/address/0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3), [implementation](https://arbiscan.io/address/0xE22500Fa27f696d06702367246bd17Bd2C8a4c5d)
2020
- [KlerosCoreNeo: proxy](https://arbiscan.io/address/0x991d2df165670b9cac3B022f4B68D65b664222ea), [implementation](https://arbiscan.io/address/0x17c39AB53A7072b167A74a85D47b30385c98ae89)
2121
- [KlerosCoreRulerNeo: proxy](https://arbiscan.io/address/0xc0169e0B19aE02ac4fADD689260CF038726DFE13), [implementation](https://arbiscan.io/address/0x85093b5EDa4F2e2E2fEDae34Da91239D6a08e324)
22+
- [KlerosCoreSnapshotProxy](https://arbiscan.io/address/0xEF719a5B3352F607e6C4E17b7e0cDAd8322fEC95)
2223
- [KlerosV2NeoEarlyUser](https://arbiscan.io/address/0xfE34a72c55e512601E7d491A9c5b36373cE34d63)
2324
- [Pinakion](https://arbiscan.io/address/0x330bD769382cFc6d50175903434CCC8D206DCAE5)
2425
- [PolicyRegistry: proxy](https://arbiscan.io/address/0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c), [implementation](https://arbiscan.io/address/0x15E5964C7751dF8563eA4bC000301582C79BC454)
@@ -39,6 +40,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
3940
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xe763d31Cb096B4bc7294012B78FC7F148324ebcb), [implementation](https://sepolia.arbiscan.io/address/0x7283c07CC5224B20f431B1fa0E6d6db3cA02de34)
4041
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0xA88A9a25cE7f1d8b3941dA3b322Ba91D009E1397), [implementation](https://sepolia.arbiscan.io/address/0x63CF56e1c99E65E4a9eCDCC805F4735E016F2dc8)
4142
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479), [implementation](https://sepolia.arbiscan.io/address/0x0766e4B8c4a3aAC9371a5A9D6119E8125Adcfd55)
43+
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0xd74e61A4dB9C6c3F2C97b62a319aE194f616858C)
4244
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x9f6ffc13B685A68ae359fCA128dfE776458Df464)
4345
- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)
4446
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2668c46A14af8997417138B064ca1bEB70769585), [implementation](https://sepolia.arbiscan.io/address/0xB958113f96950C7806d584eFBed964288d46a0B8)
@@ -87,6 +89,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
8789
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xA54e7A16d7460e38a8F324eF46782FB520d58CE8), [implementation](https://sepolia.arbiscan.io/address/0x91a373BBdE0532F86410682F362e2Cf685e95085)
8890
- [KlerosCoreNeo: proxy](https://sepolia.arbiscan.io/address/0x26bf077037550e437605F07e25EfcAd510715C3A), [implementation](https://sepolia.arbiscan.io/address/0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB)
8991
- [KlerosCoreRuler: proxy](https://sepolia.arbiscan.io/address/0x7ffcd32A0521645E6fCFd071A68F0e26957775a5), [implementation](https://sepolia.arbiscan.io/address/0x97e30A3A940856A3913437912C746f1aF6ccC76c)
92+
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0x9300D415af6e747ADe3C6cbA09a3b3CD5fb0c091)
9093
- [KlerosCoreUniversity: proxy](https://sepolia.arbiscan.io/address/0x5AB37F38778Bc175852fA353056591D91c744ce6), [implementation](https://sepolia.arbiscan.io/address/0xF74DaBfC5F5dbdBD07636637204d9C35326D2906)
9194
- [KlerosV2NeoEarlyUser](https://sepolia.arbiscan.io/address/0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F)
9295
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD)

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

+6
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
122122

123123
console.log(`core.changeArbitrableWhitelist(${resolver.address}, true)`);
124124
await core.changeArbitrableWhitelist(resolver.address, true);
125+
126+
await deploy("KlerosCoreSnapshotProxy", {
127+
from: deployer,
128+
args: [deployer, core.target],
129+
log: true,
130+
});
125131
};
126132

127133
deployArbitration.tags = ["ArbitrationNeo"];

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

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { ChainlinkRNG, DisputeKitClassic, KlerosCore } from "../typechain-types"
1010

1111
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
1212
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
13+
const { deploy } = deployments;
1314
const { ZeroAddress } = hre.ethers;
1415
const RNG_LOOKAHEAD = 20;
1516

@@ -94,6 +95,12 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
9495
} catch (e) {
9596
console.error("failed to change currency rates:", e);
9697
}
98+
99+
await deploy("KlerosCoreSnapshotProxy", {
100+
from: deployer,
101+
args: [deployer, core.target],
102+
log: true,
103+
});
97104
};
98105

99106
deployArbitration.tags = ["Arbitration"];

contracts/deployments/arbitrum/KlerosCoreSnapshotProxy.json

+228
Large diffs are not rendered by default.

contracts/deployments/arbitrumSepolia/KlerosCoreSnapshotProxy.json

+228
Large diffs are not rendered by default.

contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreSnapshotProxy.json

+228
Large diffs are not rendered by default.

contracts/src/arbitration/KlerosCore.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {KlerosCoreBase, IDisputeKit, ISortitionModule, IERC20} from "./KlerosCoreBase.sol";

contracts/src/arbitration/KlerosCoreBase.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol";

contracts/src/arbitration/KlerosCoreNeo.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {KlerosCoreBase, IDisputeKit, ISortitionModule, IERC20, OnError, StakingResult} from "./KlerosCoreBase.sol";

contracts/src/arbitration/KlerosGovernor.sol

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:deployments: []
7-
83
pragma solidity 0.8.24;
94

105
import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitrableV2.sol";

contracts/src/arbitration/arbitrables/DisputeResolver.sol

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
83
import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol";
94
import "../interfaces/IDisputeTemplateRegistry.sol";
105

contracts/src/arbitration/devtools/DisputeResolverRuler.sol

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
83
import {DisputeResolver, IArbitratorV2, IDisputeTemplateRegistry} from "../arbitrables/DisputeResolver.sol";
94

105
pragma solidity 0.8.24;

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

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {DisputeKitClassicBase, KlerosCore} from "./DisputeKitClassicBase.sol";

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

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {KlerosCore, KlerosCoreBase, IDisputeKit, ISortitionModule} from "../KlerosCore.sol";

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

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {DisputeKitClassicBase, KlerosCore} from "./DisputeKitClassicBase.sol";
@@ -115,4 +109,4 @@ contract DisputeKitGated is DisputeKitClassicBase {
115109
return IBalanceHolder(tokenGate).balanceOf(_juror) > 0;
116110
}
117111
}
118-
}
112+
}

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

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import {DisputeKitClassicBase, KlerosCore} from "./DisputeKitClassicBase.sol";

contracts/src/arbitration/evidence/EvidenceModule.sol

-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@jaybuidl, @fnanni-0]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
/// @custom:tools: []
9-
103
pragma solidity 0.8.24;
114

125
import "../interfaces/IArbitratorV2.sol";

contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol

-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@fnanni-0]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
/// @custom:tools: []
9-
103
pragma solidity 0.8.24;
114

125
// TODO: standard interfaces should be placed in a separated repo (?)

contracts/src/arbitration/interfaces/IDisputeKit.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@unknownunknown1, @jaybuidl]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import "./IArbitratorV2.sol";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity 0.8.24;
4+
5+
import {ISortitionModule} from "../interfaces/ISortitionModule.sol";
6+
7+
interface IKlerosCore {
8+
function sortitionModule() external view returns (ISortitionModule);
9+
}
10+
11+
/// @title KlerosCoreSnapshotProxy
12+
/// Proxy contract for V2 that exposes staked PNK with balanceOf() function for Snapshot voting.
13+
contract KlerosCoreSnapshotProxy {
14+
// ************************************* //
15+
// * State Modifiers * //
16+
// ************************************* //
17+
18+
IKlerosCore public core;
19+
address public governor;
20+
string public constant name = "Staked Pinakion";
21+
string public constant symbol = "stPNK";
22+
uint8 public constant decimals = 18;
23+
24+
// ************************************* //
25+
// * Modifiers * //
26+
// ************************************* //
27+
28+
modifier onlyByGovernor() {
29+
require(governor == msg.sender, "Access not allowed: Governor only.");
30+
_;
31+
}
32+
33+
// ************************************* //
34+
// * Constructor * //
35+
// ************************************* //
36+
37+
/// @dev Constructor
38+
/// @param _governor The governor of the contract.
39+
/// @param _core KlerosCore to read the balance from.
40+
constructor(address _governor, IKlerosCore _core) {
41+
governor = _governor;
42+
core = _core;
43+
}
44+
45+
// ************************************* //
46+
// * Governance * //
47+
// ************************************* //
48+
49+
/// @dev Changes the `governor` storage variable.
50+
/// @param _governor The new value for the `governor` storage variable.
51+
function changeGovernor(address _governor) external onlyByGovernor {
52+
governor = _governor;
53+
}
54+
55+
/// @dev Changes the `core` storage variable.
56+
/// @param _core The new value for the `core` storage variable.
57+
function changeCore(IKlerosCore _core) external onlyByGovernor {
58+
core = _core;
59+
}
60+
61+
// ************************************* //
62+
// * Public Views * //
63+
// ************************************* //
64+
65+
/// @dev Returns the amount of PNK staked in KlerosV2 for a particular address.
66+
/// Note: Proxy doesn't need to differentiate between courts so we pass 0 as courtID.
67+
/// @param _account The address to query.
68+
/// @return totalStaked Total amount staked in V2 by the address.
69+
function balanceOf(address _account) external view returns (uint256 totalStaked) {
70+
(totalStaked, , , ) = core.sortitionModule().getJurorBalance(_account, 0);
71+
}
72+
}

contracts/src/gateway/ForeignGateway.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import "./interfaces/IForeignGateway.sol";

contracts/src/gateway/HomeGateway.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import "./interfaces/IForeignGateway.sol";

contracts/src/gateway/interfaces/IForeignGateway.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import "../../arbitration/interfaces/IArbitratorV2.sol";

contracts/src/gateway/interfaces/IHomeGateway.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

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

contracts/src/kleros-v1/interfaces/IArbitrableV1.sol

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@ferittuncer, @hbarcelos, @clesaege]
4-
/// @custom:reviewers: [@remedcu]
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
83
pragma solidity 0.8.24;
94

105
import "./IArbitratorV1.sol";

contracts/src/kleros-v1/interfaces/IArbitratorV1.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@ferittuncer, @hbarcelos, @clesaege]
4-
/// @custom:reviewers: [@remedcu]
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
import "./IArbitrableV1.sol";

contracts/src/libraries/SortitionSumTreeFactory.sol

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// SPDX-License-Identifier: MIT
22

3-
/// @custom:authors: [@epiqueras, @unknownunknown1]
4-
/// @custom:reviewers: []
5-
/// @custom:auditors: []
6-
/// @custom:bounties: []
7-
/// @custom:deployments: []
8-
93
pragma solidity 0.8.24;
104

115
/// @title SortitionSumTreeFactory

0 commit comments

Comments
 (0)