Skip to content

Commit

Permalink
chore: rename hardhat-package to contracts & import typechain-typ…
Browse files Browse the repository at this point in the history
…es from other package
  • Loading branch information
wottpal committed Sep 1, 2022
1 parent 63695b9 commit 3dac3a0
Show file tree
Hide file tree
Showing 30 changed files with 142 additions and 159 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ yarn-error.log*

# typescript
*.tsbuildinfo
dist

# turbo
.turbo
.turbo

# coverage
coverage
coverage.json
10 changes: 6 additions & 4 deletions .vscode/ethathon.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"path": "../packages/frontend"
},
{
"name": "Hardhat",
"path": "../packages/hardhat"
"name": "Contracts",
"path": "../packages/contracts"
}
],
"settings": {
Expand All @@ -23,9 +23,11 @@
"**/.yarn": true,
"**/.turbo": true,
"**/.next": true,
"packages/hardhat/cache/": true,
"packages/hardhat/deployments/": true
"**/packages/contracts/deployments": true
},
"search.useIgnoreFiles": true,
"search.useGlobalIgnoreFiles": true,
"search.useParentIgnoreFiles": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pnpm install

# Copy & fill environments
cp packages/frontend/.env.local.example packages/frontend/.env.local
cp packages/hardhat/.env.example packages/hardhat/.env
cp packages/contracts/.env.example packages/contracts/.env
```

## Development
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
cache
artifacts
node_modules
coverage
coverage.json
typechain
typechain-types
deployments/localhost
deployments/localhost
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions packages/contracts/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.exclude": {
"**/deployments": true
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ const config: HardhatUserConfig = {
networks: {
hardhat: {
chainId: 1337,
// chainId: 80001,
// allowUnlimitedContractSize: false,
// blockGasLimit: 20000000, // 20 million
// allowUnlimitedContractSize: false,
// blockGasLimit: 20000000,
// forking: {
// url: "https://polygon-mumbai.g.alchemy.com/v2/${process.env.ALCHEMY_API_MUMBAI}",
// url: "https://eth-rinkeby.alchemyapi.io/v2/${process.env.ALCHEMY_API_RINKEBY}",
Expand All @@ -43,8 +42,10 @@ const config: HardhatUserConfig = {
default: 0,
},
},
etherscan: {
apiKey: `${process.env.ETHERSCAN_API_KEY}`,
verify: {
etherscan: {
apiKey: `${process.env.ETHERSCAN_API_KEY}`,
},
},
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"name": "@ethathon/hardhat",
"name": "@ethathon/contracts",
"license": "MIT",
"version": "0.0.1",
"scripts": {
"clean": "pnpm hardhat clean",
"compile": "pnpm hardhat compile --no-typechain",
"build": "pnpm clean && pnpm compile && pnpm types",
"dev": "pnpm run build && pnpm run deploy",
"types": "pnpm typechain --target=ethers-v5 './artifacts/contracts/**/+([a-zA-Z0-9_]).json' --out-dir '../frontend/src/types/typechain/'",
"deploy": "pnpm hardhat node --export '../frontend/src/deployments/1337.json' --write true",
"deploy:mumbai": "pnpm hardhat deploy --network mumbai --export '../frontend/src/deployments/80001.json' --write true",
"deploy:goerli": "pnpm hardhat deploy --network goerli --export '../frontend/src/deployments/5.json' --write true",
"types": "pnpm typechain --target=ethers-v5 './artifacts/contracts/**/+([a-zA-Z0-9_]).json' --out-dir './typechain-types'",
"lint": "prettier . --check && pnpm eslint",
"lint:fix": "prettier . --write && pnpm eslint --fix",
"eslint": "eslint . --ext .js,.ts",
"solhint": "solhint 'contracts/**/*.sol'"
"solhint": "solhint 'contracts/**/*.sol'",
"deploy": "pnpm hardhat node --export '../frontend/src/deployments/1337.json' --write true",
"deploy:mumbai": "pnpm hardhat deploy --network mumbai --export '../frontend/src/deployments/80001.json' --write true",
"deploy:goerli": "pnpm hardhat deploy --network goerli --export '../frontend/src/deployments/5.json' --write true",
"verify:mumbai": "source .env && pnpm hardhat etherscan-verify --network mumbai --api-key $POLYGONSCAN_API_KEY",
"verify:goerli": "pnpm hardhat etherscan-verify --network goerli"
},
"devDependencies": {
"@ethersproject/abi": "^5.7.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"resolveJsonModule": true,
"baseUrl": "."
"baseUrl": ".",
"composite": true
},
"exclude": ["dist", "node_modules", "cache", "artifacts", "deployments"],
"include": ["./scripts/**/*.ts", "./deploy/**/*.ts", "./shared/**/*.ts", "./test/**/*.ts"],
"include": [
"./scripts/**/*.ts",
"./deploy/**/*.ts",
"./shared/**/*.ts",
"./test/**/*.ts",
"./typechain-types"
],
"files": ["./hardhat.config.ts"]
}
43 changes: 3 additions & 40 deletions packages/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,4 @@
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo

# Hardhat & Typechain
src/artifacts
src/types/typechain/**
.next/
out/
build
src/deployments/1337.json
5 changes: 4 additions & 1 deletion packages/frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ const nextConfig = {
/* config options here */
}

module.exports = nextConfig
// eslint-disable-next-line
const withTM = require('next-transpile-modules')(['@yieldgate/contracts'])

module.exports = withTM(nextConfig)
2 changes: 2 additions & 0 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"test": "jest --passWithNoTests"
},
"dependencies": {
"@ethathon/contracts": "workspace:*",
"@apollo/client": "^3.6.9",
"@chakra-ui/react": "^2.3.1",
"@emotion/css": "^11.10.0",
Expand All @@ -35,6 +36,7 @@
"graphql": "^16.6.0",
"graphql-request": "^5.0.0",
"next": "^12.2.5",
"next-transpile-modules": "^9.0.0",
"next-seo": "^5.5.0",
"next-themes": "^0.2.0",
"nprogress": "^0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"@shared/*": ["./src/shared/*"],
"@models/*": ["./src/models/*"],
"@styles/*": ["./src/styles/*"],
"@artifacts/*": ["./src/artifacts/*"],
"@deployments/*": ["./src/deployments/*"]
}
},
"references": [{ "path": "../contracts" }],
"include": ["next-env.d.ts", "**/*.js", "**/*.ts", "**/*.tsx", "**/*.json"],
"exclude": ["node_modules", ".next", "out"],
"types": ["src/types"]
Expand Down
Loading

0 comments on commit 3dac3a0

Please sign in to comment.