Skip to content

Commit 8a5b397

Browse files
committedNov 11, 2021
docs: readme and spdx headers
1 parent 17f6a76 commit 8a5b397

21 files changed

+109
-37
lines changed
 

‎.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"solidity.compileUsingRemoteVersion": "v0.8.9+commit.e5eed63a"
2+
"solidity.compileUsingRemoteVersion": "v0.8.9+commit.e5eed63a",
3+
"mochaExplorer.files": "contracts/test/**/*.{j,t}s"
34
}

‎CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## 0.1.0 (2021-11-10)
1+
## 0.1.0 (2021-11-11)
22

3+
- feat: modern toolchain setup and simple RNG smart contracts ([17f6a76](https://github.com/kleros/kleros-v2/commit/17f6a76))
34
- docs: initial commit ([23356e7](https://github.com/kleros/kleros-v2/commit/23356e7))
45
- docs: license file added ([cb62d2c](https://github.com/kleros/kleros-v2/commit/cb62d2c))
56
- docs: updated ([5b9a8f1](https://github.com/kleros/kleros-v2/commit/5b9a8f1))

‎README.md

+64-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,75 @@
1-
# Kleros version 2
1+
<p align="center">
2+
<a href="https://kleros.io">
3+
<img alt="Kleros" src="https://github.com/kleros/court/blob/master/public/icon-512.png?raw=true" width="128">
4+
</a>
5+
</p>
26

3-
## Deployed Addresses
7+
<p align="center">
8+
<b style="font-size: 32px;">Kleros v2</b>
9+
</p>
410

5-
See [contracts/README.md](contracts/README.md#deployed-addresses).
11+
<p align="center">
12+
<a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
13+
<a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
14+
<a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
15+
</p>
16+
17+
---
18+
19+
## Toolchain:
20+
21+
- Node 16
22+
- Yarn 3 without [PlugnPlay](https://yarnpkg.com/getting-started/migration/#switching-to-plugnplay)
23+
- Solidity 0.8
24+
- Hardhat
25+
- Ethers
26+
- Waffle
27+
- Typescript
628

729
## Contributing
830

9-
### Repo Structure
31+
### Pre-Requisites
32+
33+
- Install NodeJS 16:
34+
- on Red Hat Linux: `dnf module install nodejs:16`
35+
- on Ubuntu Linux: `sudo snap install node --classic`
36+
- on MacOS via [brew](https://brew.sh/): `brew install node`
37+
- on Windows via [Chocolatey](https://chocolatey.org/): `choco install nvs`
38+
- Install Yarn v1.22: `npm install -g yarn`
39+
- Upgrade Yarn to v3: `yarn set version berry`
40+
41+
### Optional Steps
42+
43+
#### [Hardhat CLI auto-completion](https://hardhat.org/guides/shorthand.html)
44+
45+
```bash
46+
$ npm i -g hardhat-shorthand
47+
48+
$ hardhat-completion install
49+
✔ Which Shell do you use ? · bash
50+
✔ We will install completion to ~/.bashrc, is it ok ? (y/N) · true
51+
52+
$ . ~/.bashrc
53+
```
54+
55+
### Getting Started
56+
57+
#### Install the dependencies
58+
59+
```bash
60+
$ yarn install
61+
```
62+
63+
## Repo Structure
1064

1165
Each directory at the root of this repository contains code for each individual part that enables this integration:
1266

1367
- **`bots/`**: service to automate some steps of the flow which otherwise would required manual intervention from users.
14-
- **Notice:** while this is a centralized service, it exists only for convenience. Users can fulfill the role of the bots if they wish to.
15-
- **`contracts/`**: Smart contracts to enable cross-chain arbitration for Realitio (Reality.eth). [Learn more](contracts/README.md).
68+
- **Notice:** while this is a centralized service, it exists only for convenience. Anyone can fulfill the role of the bots if they wish to do so.
69+
- **`contracts/`**: Smart contracts running the arbitration system [Learn more](contracts/README.md).
1670
- **`dynamic-script/`**: allows fetching the dynamic content for the arbitration, as described by [ERC-1497: Evidence Standard](https://github.com/ethereum/EIPs/issues/1497).
1771
- **`evidence-display/`**: display interface that should be used to render the evidence for arbitrators, as described by [ERC-1497: Evidence Standard](https://github.com/ethereum/EIPs/issues/1497).
72+
73+
## Deployed Addresses
74+
75+
See [contracts/README.md](contracts/README.md#deployed-addresses).

‎bots/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @kleros/kleros-v2-bots
2+
3+
🚧 ⚖️ 🚧

‎contracts/.mocharc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"require": "ts-node/register/files",
3+
"timeout": 20000
4+
}

‎contracts/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Smart contracts for Kleros v2
1515

1616
## Contributing
1717

18-
### Install Dependencies
18+
### Install the Dependencies
1919

2020
```bash
2121
yarn install

‎contracts/package.json

-7
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@
2929
"@typescript-eslint/parser": "^4.33.0",
3030
"chai": "^4.3.4",
3131
"dotenv": "^10.0.0",
32-
"eslint": "^7.32.0",
33-
"eslint-config-prettier": "^8.3.0",
34-
"eslint-config-standard": "^16.0.3",
35-
"eslint-plugin-import": "^2.25.3",
36-
"eslint-plugin-node": "^11.1.0",
37-
"eslint-plugin-prettier": "^3.4.1",
38-
"eslint-plugin-promise": "^5.1.1",
3932
"ethereum-waffle": "^3.4.0",
4033
"ethers": "^5.5.1",
4134
"hardhat": "^2.6.8",

‎contracts/src/rng/ConstantNG.sol

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
13
/**
24
* @title Constant Number Generator
35
* @author Clément Lesaege - <clement@lesaege.com>

‎contracts/src/rng/IncrementalNG.sol

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
13
/**
24
* @title Incremental Number Generator
35
* @author JayBuidl <jb@kleros.io>
@@ -14,7 +16,9 @@ contract IncrementalNG is RNG {
1416
* @dev Contribute to the reward of a random number. All the ETH will be lost forever.
1517
* @param _block Block the random number is linked to.
1618
*/
17-
function contribute(uint256 _block) public payable override {}
19+
function contribute(uint256 _block) public payable override {
20+
/* NOP */
21+
}
1822

1923
/**
2024
* @dev Get the "random number", which is predictable.

‎contracts/src/rng/RNG.sol

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
13
/**
24
* @authors: [@clesaege]
35
* @reviewers: [@remedcu]

‎contracts/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"strict": true,
66
"esModuleInterop": true,
77
"outDir": "dist",
8-
"declaration": true
8+
"declaration": true,
9+
"sourceMap": true
910
},
1011
"include": [
1112
"./src",

‎contracts/typechain/factories/ConstantNG__factory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const _abi = [
105105
];
106106

107107
const _bytecode =
108-
"0x60a060405234801561001057600080fd5b5060405161024438038061024483398101604081905261002f91610037565b608052610050565b60006020828403121561004957600080fd5b5051919050565b6080516101cd6100776000396000818160a80152818160f9015261011f01526101cd6000f3fe60806040526004361061004a5760003560e01c80631c73601e1461004f5780637b9c34e0146100815780638381f58a14610096578063c1cbbca7146100ca578063ca4742f1146100db575b600080fd5b34801561005b57600080fd5b5061006f61006a36600461017e565b61011b565b60405190815260200160405180910390f35b61009461008f36600461017e565b6100d8565b005b3480156100a257600080fd5b5061006f7f000000000000000000000000000000000000000000000000000000000000000081565b6100946100d836600461017e565b50565b3480156100e757600080fd5b5061006f6100f636600461017e565b507f000000000000000000000000000000000000000000000000000000000000000090565b60007f00000000000000000000000000000000000000000000000000000000000000008061014c5750600092915050565b6040805133602082015290810182905260600160408051601f1981840301815291905280516020909101209392505050565b60006020828403121561019057600080fd5b503591905056fea26469706673582212206d2da4fc3117603518cc1c783c546f03bbd1e50dfa448bb2a407e51a64116bae64736f6c63430008090033";
108+
"0x60a060405234801561001057600080fd5b5060405161024438038061024483398101604081905261002f91610037565b608052610050565b60006020828403121561004957600080fd5b5051919050565b6080516101cd6100776000396000818160a80152818160f9015261011f01526101cd6000f3fe60806040526004361061004a5760003560e01c80631c73601e1461004f5780637b9c34e0146100815780638381f58a14610096578063c1cbbca7146100ca578063ca4742f1146100db575b600080fd5b34801561005b57600080fd5b5061006f61006a36600461017e565b61011b565b60405190815260200160405180910390f35b61009461008f36600461017e565b6100d8565b005b3480156100a257600080fd5b5061006f7f000000000000000000000000000000000000000000000000000000000000000081565b6100946100d836600461017e565b50565b3480156100e757600080fd5b5061006f6100f636600461017e565b507f000000000000000000000000000000000000000000000000000000000000000090565b60007f00000000000000000000000000000000000000000000000000000000000000008061014c5750600092915050565b6040805133602082015290810182905260600160408051601f1981840301815291905280516020909101209392505050565b60006020828403121561019057600080fd5b503591905056fea2646970667358221220da36bd046649ac0965fcb143806f875d8dc06d68eed5b93e4492f5705ddcfe8064736f6c63430008090033";
109109

110110
export class ConstantNG__factory extends ContractFactory {
111111
constructor(

‎contracts/typechain/factories/IncrementalNG__factory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const _abi = [
8787
];
8888

8989
const _bytecode =
90-
"0x608060405234801561001057600080fd5b50610180806100206000396000f3fe60806040526004361061004a5760003560e01c80631c73601e1461004f5780637b9c34e0146100815780638381f58a14610096578063c1cbbca7146100ac578063ca4742f1146100bd575b600080fd5b34801561005b57600080fd5b5061006f61006a366004610131565b6100e7565b60405190815260200160405180910390f35b61009461008f366004610131565b6100ba565b005b3480156100a257600080fd5b5061006f60005481565b6100946100ba366004610131565b50565b3480156100c957600080fd5b5061006f6100d8366004610131565b50600080546001810190915590565b60008054600181018255806100ff5750600092915050565b6040805133602082015290810182905260600160408051601f1981840301815291905280516020909101209392505050565b60006020828403121561014357600080fd5b503591905056fea2646970667358221220562300a549bfb467e77cd13c2ac51e0c94951c728324d67e8def7ce9760400f864736f6c63430008090033";
90+
"0x608060405234801561001057600080fd5b50610180806100206000396000f3fe60806040526004361061004a5760003560e01c80631c73601e1461004f5780637b9c34e0146100815780638381f58a14610096578063c1cbbca7146100ac578063ca4742f1146100bd575b600080fd5b34801561005b57600080fd5b5061006f61006a366004610131565b6100e7565b60405190815260200160405180910390f35b61009461008f366004610131565b6100ba565b005b3480156100a257600080fd5b5061006f60005481565b6100946100ba366004610131565b50565b3480156100c957600080fd5b5061006f6100d8366004610131565b50600080546001810190915590565b60008054600181018255806100ff5750600092915050565b6040805133602082015290810182905260600160408051601f1981840301815291905280516020909101209392505050565b60006020828403121561014357600080fd5b503591905056fea264697066735822122040cb2f1d7acbbaf5795cf4881e9b2f91a28086592f5227ed248deab156debf1864736f6c63430008090033";
9191

9292
export class IncrementalNG__factory extends ContractFactory {
9393
constructor(

‎contracts/typechain/hardhat.d.ts

-9
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import * as Contracts from ".";
1212

1313
declare module "hardhat/types/runtime" {
1414
interface HardhatEthersHelpers extends HardhatEthersHelpersBase {
15-
getContractFactory(
16-
name: "Greeter",
17-
signerOrOptions?: ethers.Signer | FactoryOptions
18-
): Promise<Contracts.Greeter__factory>;
1915
getContractFactory(
2016
name: "ConstantNG",
2117
signerOrOptions?: ethers.Signer | FactoryOptions
@@ -29,11 +25,6 @@ declare module "hardhat/types/runtime" {
2925
signerOrOptions?: ethers.Signer | FactoryOptions
3026
): Promise<Contracts.RNG__factory>;
3127

32-
getContractAt(
33-
name: "Greeter",
34-
address: string,
35-
signer?: ethers.Signer
36-
): Promise<Contracts.Greeter>;
3728
getContractAt(
3829
name: "ConstantNG",
3930
address: string,

‎dynamic-script/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @kleros/kleros-v2-dynamic-script
2+
3+
🚧 ⚖️ 🚧

‎evidence-display/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @kleros/kleros-v2-evidence-display
2+
3+
🚧 ⚖️ 🚧

‎klerosjs/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# @kleros/kleros-v2-klerosjs
2+
3+
_Archon's successor_
4+
5+
\
6+
7+
🚧 ⚖️ 🚧

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"license": "MIT",
99
"private": true,
1010
"workspaces": [
11-
"archon",
1211
"bots",
1312
"contracts",
1413
"dynamic-script",
1514
"evidence-display",
15+
"klerosjs",
1616
"subgraph",
1717
"web"
1818
],

‎subgraph/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @kleros/kleros-v2-subgraph
2+
3+
🚧 ⚖️ 🚧

‎web/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @kleros/kleros-v2-web
2+
3+
🚧 ⚖️ 🚧

‎yarn.lock

-7
Original file line numberDiff line numberDiff line change
@@ -1004,13 +1004,6 @@ __metadata:
10041004
"@typescript-eslint/parser": ^4.33.0
10051005
chai: ^4.3.4
10061006
dotenv: ^10.0.0
1007-
eslint: ^7.32.0
1008-
eslint-config-prettier: ^8.3.0
1009-
eslint-config-standard: ^16.0.3
1010-
eslint-plugin-import: ^2.25.3
1011-
eslint-plugin-node: ^11.1.0
1012-
eslint-plugin-prettier: ^3.4.1
1013-
eslint-plugin-promise: ^5.1.1
10141007
ethereum-waffle: ^3.4.0
10151008
ethers: ^5.5.1
10161009
hardhat: ^2.6.8

0 commit comments

Comments
 (0)
Please sign in to comment.