Skip to content

Commit 72e547e

Browse files
authored
Merge pull request #68 from Params10/master
Added hardhat-deploy support and updated few packages.
2 parents 0593720 + 5ed82d7 commit 72e547e

17 files changed

+10471
-5958
lines changed

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#for deployment
2+
PRIVATE_KEY_GOVERNOR=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
3+
PRIVATE_KEY_REQUESTER=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
4+
5+
#for deployment + testing add these keys as well
6+
PRIVATE_KEY_CHALLENGER=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
7+
PRIVATE_KEY_GOVERNOR2=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
8+
PRIVATE_KEY_OTHER=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
9+
PRIVATE_KEY_DEPLOYER=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
10+
11+
#for verification of contracts
12+
ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
13+
INFURA_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
14+
15+
#For polygon add
16+
POLYGONSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Contracts for creating arbitrable permission lists on Ethereum.
1515
## Development
1616

1717
1. Clone this repo.
18-
2. Run `yarn` to install dependencies and then `yarn build` to compile the contracts.
18+
2. Run `yarn install` to install dependencies and then `yarn build` to compile the contracts.
1919

2020
## Release
2121

@@ -39,6 +39,18 @@ To bump the version of the package, use `yarn release`.
3939
Testrpc default gas limit is lower than the mainnet which prevents deploying some contracts. Before running truffle tests use:
4040
`testrpc -l 8000000`.
4141

42+
## Testing contracts
43+
44+
- Run `npx hardhat compile` to compile the contracts.
45+
- Run `npx hardhat test` to run all test cases in test folder.
46+
- Run `npx hardhat test <location of test file>` to run the test cases for specific contract.
47+
48+
## Testing contracts on specific network
49+
50+
- Run `npx hardhat test --network <network name in hardhat.config.js>` to run all test cases in test folder.
51+
- Run `npx hardhat test <location of test file> --network <network name in hardhat.config.js>` to run the test cases for specific contract.
52+
- Add private keys for the roles needed to test the contracts according to hardhat.config.js.
53+
4254
## Contributing
4355

4456
See [contributing](https://kleros.gitbook.io/contributing-md/).

deploy/deploy.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module.exports = async ({ getNamedAccounts, deployments }) => {
2+
const { deploy } = deployments;
3+
const { deployer, governor } = await getNamedAccounts();
4+
const arbitratorExtraData = "0x85";
5+
const arbitrationCost = 1000;
6+
const appealTimeOut = 180;
7+
8+
// the following will deploy "EnhancedAppealableArbitrator" if the contract was never deployed or if the code changed since last deployment
9+
const EnhancedArbitrator = await deploy("EnhancedAppealableArbitrator", {
10+
from: governor,
11+
args: [arbitrationCost, governor, arbitratorExtraData, appealTimeOut],
12+
});
13+
console.log(EnhancedArbitrator.address, "EnhancedAppealableArbitrator");
14+
const GTCRFactory = await deploy("GTCRFactory", {
15+
from: deployer,
16+
args: [],
17+
});
18+
19+
console.log(GTCRFactory.address, "GTCRFactory address");
20+
const LGTCR = await deploy("LightGeneralizedTCR", {
21+
from: deployer,
22+
args: [],
23+
});
24+
console.log(LGTCR.address, "address of LGTCR");
25+
const LGTCRFactory = await deploy("LightGTCRFactory", {
26+
from: deployer,
27+
args: [LGTCR.address],
28+
});
29+
const RelayMock = await deploy("RelayMock", {
30+
from: governor,
31+
args: [],
32+
});
33+
console.log(RelayMock.address, "address of RelayMock");
34+
console.log(LGTCRFactory.address, "address of LGTCR factory");
35+
const LightGeneralizedTCRView = await deploy("LightGeneralizedTCRView", {
36+
from: governor,
37+
args: [],
38+
});
39+
console.log(LightGeneralizedTCRView.address, "address of LightGeneralizedTCRView");
40+
41+
const GeneralizedTCRView = await deploy("GeneralizedTCRView", {
42+
from: governor,
43+
args: [],
44+
});
45+
console.log(GeneralizedTCRView.address, "address of GeneralizedTCRView");
46+
47+
const BatchWithdraw = await deploy("BatchWithdraw", {
48+
from: governor,
49+
args: [],
50+
});
51+
console.log(BatchWithdraw.address, "address of BatchWithdraw");
52+
const LBatchWithdraw = await deploy("LightBatchWithdraw", {
53+
from: governor,
54+
args: [],
55+
});
56+
console.log(LBatchWithdraw.address, "address of LightBatchWithdraw");
57+
};
58+
module.exports.tags = ["gtcrContracts"];

deployments/goerli/.chainId

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5

deployments/mainnet/.chainId

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"address": "0x38aA214Dc986d0bAB53E5861071f3d5a56066b4D",
3+
"abi": [
4+
{
5+
"constant": false,
6+
"inputs": [
7+
{
8+
"internalType": "address",
9+
"name": "_address",
10+
"type": "address"
11+
},
12+
{
13+
"internalType": "address payable",
14+
"name": "_contributor",
15+
"type": "address"
16+
},
17+
{
18+
"internalType": "bytes32",
19+
"name": "_itemID",
20+
"type": "bytes32"
21+
},
22+
{
23+
"internalType": "uint256",
24+
"name": "_cursor",
25+
"type": "uint256"
26+
},
27+
{
28+
"internalType": "uint256",
29+
"name": "_count",
30+
"type": "uint256"
31+
},
32+
{
33+
"internalType": "uint256",
34+
"name": "_roundCursor",
35+
"type": "uint256"
36+
},
37+
{
38+
"internalType": "uint256",
39+
"name": "_roundCount",
40+
"type": "uint256"
41+
}
42+
],
43+
"name": "batchRequestWithdraw",
44+
"outputs": [],
45+
"payable": false,
46+
"stateMutability": "nonpayable",
47+
"type": "function"
48+
},
49+
{
50+
"constant": false,
51+
"inputs": [
52+
{
53+
"internalType": "address",
54+
"name": "_address",
55+
"type": "address"
56+
},
57+
{
58+
"internalType": "address payable",
59+
"name": "_contributor",
60+
"type": "address"
61+
},
62+
{
63+
"internalType": "bytes32",
64+
"name": "_itemID",
65+
"type": "bytes32"
66+
},
67+
{
68+
"internalType": "uint256",
69+
"name": "_request",
70+
"type": "uint256"
71+
},
72+
{
73+
"internalType": "uint256",
74+
"name": "_cursor",
75+
"type": "uint256"
76+
},
77+
{
78+
"internalType": "uint256",
79+
"name": "_count",
80+
"type": "uint256"
81+
}
82+
],
83+
"name": "batchRoundWithdraw",
84+
"outputs": [],
85+
"payable": false,
86+
"stateMutability": "nonpayable",
87+
"type": "function"
88+
}
89+
]
90+
}

0 commit comments

Comments
 (0)