Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosampler committed Dec 26, 2022
1 parent 95b5726 commit 39ebc3a
Show file tree
Hide file tree
Showing 28 changed files with 12,535 additions and 50 deletions.
23 changes: 23 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:prettier/recommended"
parser: "@typescript-eslint/parser"
parserOptions:
project: "tsconfig.json"
plugins:
- "@typescript-eslint"
root: true
rules:
"@typescript-eslint/no-floating-promises":
- error
- ignoreIIFE: true
ignoreVoid: true
"@typescript-eslint/no-inferrable-types": "off"
"@typescript-eslint/explicit-module-boundary-types": "off"
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-unused-vars":
- error
- argsIgnorePattern: _
varsIgnorePattern: _
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ out/
/broadcast/*/31337/
/broadcast/**/dry-run/

node_modules/

# Dotenv file
.env
28 changes: 28 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
out/
lib/
.run/
gasReporterOutput.json


# directories
.yarn/
**/.coverage_artifacts
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/build
**/cache
**/coverage
**/dist
**/node_modules
**/src/types

# files
*.env
*.log
*.tsbuildinfo
.pnp.*
coverage.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
12 changes: 12 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bracketSpacing: true
endOfLine: auto
printWidth: 120
singleQuote: false
tabWidth: 2
trailingComma: all
semi: true

overrides:
- files: "*.sol"
options:
tabWidth: 4
15 changes: 15 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"code-complexity": ["error", 7],
"prettier/prettier": ["error", { "endOfLine": "auto" }],
"compiler-version": ["warn", "0.8.13"],
"not-rely-on-time": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }],
"func-name-mixedcase": "off",
"max-states-count": "off",
"max-line-length": ["error", 120],
"reason-string": ["warn", { "maxLength": 64 }]
}
}
5 changes: 5 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
lib/openzeppelin-contracts
lib/forge-std
src/test
**/artifacts
61 changes: 61 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import * as dotenv from "dotenv";

import { HardhatUserConfig, task } from "hardhat/config";
import "@nomiclabs/hardhat-ethers";
import "hardhat-deploy";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-etherscan";

// import "./tasks/createCollection";

dotenv.config();

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

let accounts: any[] = [];
if (process.env.PRIVATE_KEY !== undefined) {
accounts = [process.env.PRIVATE_KEY];
} else {
throw new Error(`PRIVATE_KEY not set`);
}

const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.13",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
paths: {
artifacts: "./artifacts",
sources: "./src",
},
networks: {
goerli: {
url: process.env.GOERLI_URL || "",
accounts: accounts,
},
gnosis: {
url: process.env.GNOSIS_URL || "",
accounts: accounts,
},
},
namedAccounts: {
deployer: { default: 0 },
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: process.env.YOUR_ETHERSCAN_API_KEY,
},
};

export default config;
53 changes: 53 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "hardhat-project",
"scripts": {
"forge": "forge",
"build": "forge build",
"clean": "forge clean",
"test": "yarn forge test -vvv --fork-url https://rpc.ankr.com/gnosis --fork-block-number 19592773 --match-contract TheBadgeTest",
"test:all": "yarn forge test -vv --fork-url https://eth-goerli.alchemyapi.io/v2/QUuY7K6TSAGYCMXLBQiKwO43O9lLyrEE --fork-block-number 5744491",
"lint": "yarn lint:sol && yarn lint:ts && yarn prettier:check",
"lint:sol": "solhint --config ./.solhint.json \"src/**/*.sol\"",
"lint:ts": "eslint --config ./.eslintrc.js --ignore-path ./.eslintignore --ext .js,.ts .",
"prettier": "prettier --config ./.prettierrc.yaml --write \"**/*.{js,json,md,sol,ts,yaml,yml}\"",
"prettier:check": "prettier --check --config ./.prettierrc.yaml \"**/*.{js,json,md,sol,ts,yaml,yml}\"",
"deploy:goerli": "hardhat run --network goerli ./scripts/deploy.ts",
"deploy:gnosis": "hardhat run --network gnosis ./scripts/deploy.ts"
},
"dependencies": {
"@kleros/erc-792": "^8.0.0",
"@kleros/kathari": "^0.25.0",
"@openzeppelin/contracts": "^4.7.1"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
"@nomicfoundation/hardhat-toolbox": "^1.0.2",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers",
"@nomiclabs/hardhat-etherscan": "^3.1.0",
"@typechain/hardhat": "^6.1.3",
"@typechain/ethers-v5": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.27.0",
"chai": "^4.3.6",
"dotenv": "^16.0.2",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"hardhat": "^2.10.1",
"hardhat-gas-reporter": "^1.0.9",
"hardhat-deploy": "^0.11.10",
"prettier": "^2.6.2",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"solhint": "^3.3.7",
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.9.1",
"typechain": "^8.0.0",
"typescript": "^4.7.4"
}
}
12 changes: 0 additions & 12 deletions script/Counter.s.sol

This file was deleted.

29 changes: 29 additions & 0 deletions script/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as dotenv from "dotenv";
import hre from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";

async function main(hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts, ethers } = hre;
const { deploy } = deployments;

const { deployer } = await ethers.getNamedSigners();

const collection = await deploy("TheBadge", {
from: deployer.address,
contract: "TheBadge",
args: [],
log: true,
autoMine: true,
});

//await collection.deployed();

console.log("TheBadge:", collection.address);
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main(hre).catch((error) => {
console.error(error);
process.exitCode = 1;
});
14 changes: 0 additions & 14 deletions src/Counter.sol

This file was deleted.

Loading

0 comments on commit 39ebc3a

Please sign in to comment.