Skip to content

Commit 4ea6642

Browse files
committed
Setting up hardhat for beacon v2
Adding dependency libs and basic configuration for hardhat
1 parent 5d2a9f5 commit 4ea6642

File tree

10 files changed

+9423
-0
lines changed

10 files changed

+9423
-0
lines changed

solidity/random-beacon/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
yarn-error.log
2+
cache
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This is a template file. The file should be renamed to `networks.ts` and updated
2+
// with valid data. The properties will overwrite the ones defined in hardhat
3+
// project config file if hardhat.config.ts file contains `localNetworksConfig` property
4+
// pointing to this file.
5+
6+
import { LocalNetworksConfig } from "@keep-network/hardhat-local-networks-config"
7+
8+
const config: LocalNetworksConfig = {
9+
networks: {
10+
ropsten: {
11+
url: "url not set",
12+
from: "address not set",
13+
accounts: ["private key not set"],
14+
tags: ["tenderly"],
15+
},
16+
mainnet: {
17+
url: "url not set",
18+
from: "address not set",
19+
accounts: ["private key not set"],
20+
tags: ["tenderly"],
21+
},
22+
},
23+
}
24+
25+
module.exports = config

solidity/random-beacon/.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@keep-network:registry" "https://registry.yarnpkg.com"

solidity/random-beacon/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 keep.network
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

solidity/random-beacon/README.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= Random beacon v2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity 0.8.5;
4+
5+
import "@thesis/solidity-contracts/contracts/token/ERC20WithPermit.sol";
6+
7+
contract TestToken is ERC20WithPermit {
8+
/* solhint-disable-next-line no-empty-blocks */
9+
constructor() ERC20WithPermit("Test Token", "TT") {}
10+
}
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { HardhatUserConfig } from "hardhat/config"
2+
3+
import "@keep-network/hardhat-helpers"
4+
import "@keep-network/hardhat-local-networks-config"
5+
import "@nomiclabs/hardhat-waffle"
6+
import "@nomiclabs/hardhat-ethers"
7+
import "hardhat-deploy"
8+
import "@tenderly/hardhat-tenderly"
9+
10+
const config: HardhatUserConfig = {
11+
solidity: {
12+
compilers: [
13+
{
14+
version: "0.8.5",
15+
},
16+
],
17+
},
18+
paths: {
19+
artifacts: "./build",
20+
},
21+
networks: {
22+
hardhat: {
23+
forking: {
24+
// forking is enabled only if FORKING_URL env is provided
25+
enabled: !!process.env.FORKING_URL,
26+
// URL should point to a node with archival data (Alchemy recommended)
27+
url: process.env.FORKING_URL || "",
28+
// latest block is taken if FORKING_BLOCK env is not provided
29+
blockNumber: process.env.FORKING_BLOCK
30+
? parseInt(process.env.FORKING_BLOCK)
31+
: undefined,
32+
},
33+
tags: ["local"],
34+
},
35+
ropsten: {
36+
url: process.env.CHAIN_API_URL || "",
37+
chainId: 3,
38+
accounts: process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
39+
? [process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY]
40+
: undefined,
41+
tags: ["tenderly"],
42+
},
43+
},
44+
tenderly: {
45+
username: "thesis",
46+
project: "",
47+
},
48+
}
49+
50+
export default config

solidity/random-beacon/package.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "@keep-network/random-beacon-v2",
3+
"version": "0.0.1-dev",
4+
"description": "random beacon v2",
5+
"scripts": {
6+
"build": "hardhat compile",
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"dependencies": {
10+
"@openzeppelin/contracts": "^4.3.2",
11+
"@tenderly/hardhat-tenderly": "^1.0.12",
12+
"@thesis/solidity-contracts": "github:thesis/solidity-contracts#4985bcf"
13+
},
14+
"devDependencies": {
15+
"@keep-network/hardhat-helpers": "^0.1.0-pre.0",
16+
"@keep-network/hardhat-local-networks-config": "^0.1.0-pre.0",
17+
"@keep-network/prettier-config-keep": "github:keep-network/prettier-config-keep#a1a333e",
18+
"@nomiclabs/hardhat-ethers": "^2.0.2",
19+
"@nomiclabs/hardhat-waffle": "^2.0.1",
20+
"@types/chai": "^4.2.22",
21+
"eslint": "^7.30.0",
22+
"eslint-config-keep": "github:keep-network/eslint-config-keep#0c27ade",
23+
"ethereum-waffle": "^3.4.0",
24+
"ethers": "^5.4.7",
25+
"hardhat": "^2.6.4",
26+
"hardhat-deploy": "^0.9.1",
27+
"hardhat-gas-reporter": "^1.0.4",
28+
"prettier": "^2.4.1",
29+
"prettier-plugin-sh": "^0.7.1",
30+
"prettier-plugin-solidity": "^1.0.0-beta.18",
31+
"solhint": "^3.3.6",
32+
"solhint-config-keep": "github:keep-network/solhint-config-keep#5e1751e",
33+
"ts-node": "^10.2.1",
34+
"typescript": "^4.4.3"
35+
},
36+
"engines": {
37+
"node": ">= 14.0.0"
38+
}
39+
}

solidity/random-beacon/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"files": [
3+
"./hardhat.config.ts",
4+
"node_modules/@keep-network/hardhat-local-networks-config/src/type-extensions.d.ts"
5+
],
6+
"include": ["./deploy"]
7+
}

0 commit comments

Comments
 (0)