Skip to content

Commit 5b41eda

Browse files
committed
Merge branch 'dev' into feat/atlas-siwe
2 parents 10efe92 + e2a3a58 commit 5b41eda

File tree

66 files changed

+55275
-9858
lines changed

Some content is hidden

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

66 files changed

+55275
-9858
lines changed

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
</p>
1010

1111
<p align="center">
12-
<a href="https://app.netlify.com/sites/kleros-v2/deploys"><img src="https://api.netlify.com/api/v1/badges/86d94ae8-f655-46a4-a859-d68696173f3a/deploy-status" alt="Netlify Build Status"></a>
13-
<a href="https://app.netlify.com/sites/kleros-v2-university/deploys"><img src="https://api.netlify.com/api/v1/badges/085e1305-e434-4d36-91a4-88e8cbc3aa46/deploy-status" alt="Netlify Build Status"></a>
14-
<a href="https://www.gitpoap.io/gh/kleros/kleros-v2"><img src="https://public-api.gitpoap.io/v1/repo/kleros/kleros-v2/badge" alt="GitPoap badge"></a>
15-
</br>
1612
<a href="https://api.securityscorecards.dev/projects/github.com/kleros/kleros-v2"><img src="https://api.securityscorecards.dev/projects/github.com/kleros/kleros-v2/badge" alt="OpenSSF Scorecard"></a>
1713
<a href="https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2"><img src="https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2&metric=security_rating" alt="Security Rating"></a>
1814
<a href="https://sonarcloud.io/summary/new_code?id=kleros_kleros-v2"><img src="https://sonarcloud.io/api/project_badges/measure?project=kleros_kleros-v2&metric=alert_status" alt="Quality Gate Status"></a>
@@ -24,6 +20,8 @@
2420
<a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
2521
<a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
2622
<a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
23+
</br>
24+
<a href="https://www.gitpoap.io/gh/kleros/kleros-v2"><img src="https://public-api.gitpoap.io/v1/repo/kleros/kleros-v2/badge" alt="GitPoap badge"></a>
2725
</p>
2826

2927
---
@@ -34,7 +32,7 @@
3432

3533
##### 🗃️ [Subgraph endpoints](subgraph/README.md#deployments)
3634

37-
##### ⚖️ [Web frontend](https://app.netlify.com/sites/kleros-v2/deploys)
35+
##### ⚖️ [Web frontend](web/README.md#court-deployments)
3836

3937
## Content
4038

contracts/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
2020
- [PolicyRegistry: proxy](https://arbiscan.io/address/0x26c1980120F1C82cF611D666CE81D2b54d018547), [implementation](https://arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da)
2121
- [RandomizerRNG: proxy](https://arbiscan.io/address/0xC3dB344755b15c8Edfd834db79af4f8860029FB4), [implementation](https://arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836)
2222
- [SortitionModuleNeo: proxy](https://arbiscan.io/address/0x614498118850184c62f82d08261109334bFB050f), [implementation](https://arbiscan.io/address/0xf327200420F21BAafce8F1C03B1EEdF926074B95)
23+
- [TransactionBatcher](https://arbiscan.io/address/0xBC5ef8d9ad307154447AE148c088f083d2dEa4eF)
2324

2425
### Official Testnet
2526

@@ -88,6 +89,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
8889
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0x19cb28BAB40C3585955798f5EEabd71Eec14471C), [implementation](https://sepolia.arbiscan.io/address/0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3)
8990
- [SortitionModuleNeo: proxy](https://sepolia.arbiscan.io/address/0x809533c303c10915BB5c0585f2d8D738e2a4fB64), [implementation](https://sepolia.arbiscan.io/address/0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0)
9091
- [SortitionModuleUniversity: proxy](https://sepolia.arbiscan.io/address/0xBEEb15EF1DEf96c569c97A703E649B0251ceFB04), [implementation](https://sepolia.arbiscan.io/address/0xaA2833b174D4e29ae2aFc0b11dF9160EDB28BF9d)
92+
- [TransactionBatcher](https://sepolia.arbiscan.io/address/0x35f93986950804ac1F93519BF68C2a7Dd776db0E)
9193
- [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138)
9294
- [WETHFaucet](https://sepolia.arbiscan.io/address/0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd)
9395

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { HardhatRuntimeEnvironment } from "hardhat/types";
2+
import { DeployFunction } from "hardhat-deploy/types";
3+
import { BigNumber, BigNumberish } from "ethers";
4+
import { deployUpgradable } from "./utils/deployUpgradable";
5+
import { HomeChains, isSkipped } from "./utils";
6+
import { deployERC20AndFaucet } from "./utils/deployERC20AndFaucet";
7+
import { KlerosCore } from "../typechain-types";
8+
import { getContractOrDeployUpgradable } from "./utils/getContractOrDeploy";
9+
10+
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
11+
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
12+
const { deploy } = deployments;
13+
14+
// fallback to hardhat node signers on local network
15+
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
16+
const chainId = Number(await getChainId());
17+
console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer);
18+
19+
const pnk = await deployERC20AndFaucet(hre, deployer, "PNK");
20+
const dai = await deployERC20AndFaucet(hre, deployer, "DAI");
21+
const weth = await deployERC20AndFaucet(hre, deployer, "WETH");
22+
23+
const minStake = 0;
24+
const alpha = 10000;
25+
const feeForJuror = BigNumber.from(10).pow(17);
26+
const jurorsForCourtJump = 16;
27+
const klerosCore = await deployUpgradable(deployments, "KlerosCoreRuler", {
28+
from: deployer,
29+
args: [
30+
deployer, // governor
31+
pnk.address,
32+
[minStake, alpha, feeForJuror, jurorsForCourtJump],
33+
],
34+
log: true,
35+
});
36+
37+
const changeCurrencyRate = async (
38+
erc20: string,
39+
accepted: boolean,
40+
rateInEth: BigNumberish,
41+
rateDecimals: BigNumberish
42+
) => {
43+
const core = (await ethers.getContract("KlerosCoreRuler")) as KlerosCore;
44+
const pnkRate = await core.currencyRates(erc20);
45+
if (pnkRate.feePaymentAccepted !== accepted) {
46+
console.log(`core.changeAcceptedFeeTokens(${erc20}, ${accepted})`);
47+
await core.changeAcceptedFeeTokens(erc20, accepted);
48+
}
49+
if (!pnkRate.rateInEth.eq(rateInEth) || pnkRate.rateDecimals !== rateDecimals) {
50+
console.log(`core.changeCurrencyRates(${erc20}, ${rateInEth}, ${rateDecimals})`);
51+
await core.changeCurrencyRates(erc20, rateInEth, rateDecimals);
52+
}
53+
};
54+
55+
try {
56+
await changeCurrencyRate(pnk.address, true, 12225583, 12);
57+
await changeCurrencyRate(dai.address, true, 60327783, 11);
58+
await changeCurrencyRate(weth.address, true, 1, 1);
59+
} catch (e) {
60+
console.error("failed to change currency rates:", e);
61+
}
62+
63+
const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistry", {
64+
from: deployer,
65+
args: [deployer],
66+
log: true,
67+
});
68+
69+
await deploy("DisputeResolverRuler", {
70+
from: deployer,
71+
args: [klerosCore.address, disputeTemplateRegistry.address],
72+
log: true,
73+
});
74+
};
75+
76+
deployArbitration.tags = ["ArbitrationRuler"];
77+
deployArbitration.skip = async ({ network }) => {
78+
return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
79+
};
80+
81+
export default deployArbitration;
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { HardhatRuntimeEnvironment } from "hardhat/types";
2+
import { DeployFunction } from "hardhat-deploy/types";
3+
import { HomeChains, isSkipped } from "./utils";
4+
5+
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
6+
const { deployments, getNamedAccounts, getChainId } = hre;
7+
const { deploy } = deployments;
8+
9+
// fallback to hardhat node signers on local network
10+
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
11+
const chainId = Number(await getChainId());
12+
console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer);
13+
14+
await deploy("TransactionBatcher", {
15+
from: deployer,
16+
args: [],
17+
log: true,
18+
});
19+
};
20+
21+
deployArbitration.tags = ["TransactionBatcher"];
22+
deployArbitration.skip = async ({ network }) => {
23+
return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
24+
};
25+
26+
export default deployArbitration;

0 commit comments

Comments
 (0)