-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yashika Goyal
committed
Jan 3, 2024
1 parent
c841af4
commit 04e80e7
Showing
188 changed files
with
28,426 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
REPORT_GAS="true" | ||
|
||
ENV=testnet # alpha, testnet, mainnet | ||
|
||
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # dummy hardhat pk | ||
OWNER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 # dummy hardhat owner | ||
|
||
POLYGON_URL=https://polygon.llamarpc.com | ||
FANTOM_URL=https://rpc2.fantom.network | ||
ETH_MAINNET_URL=https://eth.llamarpc.com | ||
GOERLI_URL=https://rpc.ankr.com/eth_goerli | ||
HOLESKY_URL=https://ethereum-holesky.publicnode.com | ||
POLYGON_MUMBAI_URL=https://polygon-mumbai-bor.publicnode.com | ||
|
||
POLYGONSCAN_API_KEY=43A14UI3HB6DHBGGE3JRSZB4J9V3P1S9SE | ||
AVALANCHE_API_KEY=QAE2JD7XIBCYB6Z6GSKNJIHKZ8XGVYM8AI | ||
ETHERSCAN_API_KEY=FF9TZXKT2JWZ68M2EJH1FGCX13IB7ZKPUZ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
artifacts | ||
cache | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
env: { | ||
browser: false, | ||
es2021: true, | ||
mocha: true, | ||
node: true, | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
extends: [ | ||
"standard", | ||
"plugin:prettier/recommended", | ||
"plugin:node/recommended", | ||
"eslint:recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: 12, | ||
}, | ||
rules: { | ||
"node/no-unsupported-features/es-syntax": [ | ||
"error", | ||
{ ignores: ["modules"] }, | ||
], | ||
"node/no-missing-import": "off", | ||
"node/no-unpublished-import": "off", | ||
camelcase: "off", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
- name: Install yarn | ||
run: npm install -g yarn | ||
- name: Setup test env | ||
run: | | ||
touch .env | ||
echo REPORT_GAS=${{ secrets.REPORT_GAS }} >> .env | ||
echo ENV=${{ secrets.ENV }} >> .env | ||
echo PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} >> .env | ||
echo OWNER=${{ secrets.OWNER }} >> .env | ||
cat .env | ||
- name: Installing dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Test | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
node_modules | ||
.env | ||
.idea | ||
|
||
coverage | ||
coverage.json | ||
typechain | ||
gas-report.txt | ||
docs | ||
|
||
#Hardhat files | ||
cache | ||
artifacts | ||
|
||
#ignore .DS_Store recursively | ||
.DS_Store | ||
.certora_internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
# . "$(dirname -- "$0")/_/husky.sh" | ||
cd "$(dirname -- "$0")" | ||
|
||
npm run lint && git add . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
hardhat.config.ts | ||
scripts | ||
test | ||
artifacts | ||
cache | ||
coverage | ||
.env | ||
.env.* | ||
.secret | ||
.sol* | ||
.eslint* | ||
walletUtils.* | ||
coverage.json | ||
arguments.js | ||
src/utils/execution.ts | ||
src/utils/multisend.ts | ||
src/Create2Factory.ts | ||
typings/ | ||
.husky/pre-commit | ||
.prettierignore | ||
.prettierrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
artifacts | ||
cache | ||
coverage* | ||
gasReporterOutput.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "*.sol", | ||
"options": { | ||
"printWidth": 80, | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"singleQuote": false, | ||
"bracketSpacing": false | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
configureYulOptimizer: true, | ||
providerOptions: { | ||
allowUnlimitedContractSize: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"compiler-version": ["error", "^0.8.0"], | ||
"func-visibility": ["warn", { "ignoreConstructors": true }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"solidity.compileUsingRemoteVersion": "v0.8.18+commit.87f61d96" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Router Nitro Periphery Contracts | ||
|
||
Router Nitro Periphery Contracts contains smart contracts for various cross-chain products created using Router Nitro. | ||
|
||
Smart Contracts is designed in such a way that it is: | ||
|
||
- Modular => highly customizable and extendable. | ||
- Optimized => highly gas optimized. | ||
|
||
# How to run the project | ||
|
||
This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the ecosystem. | ||
|
||
## 1. Install | ||
|
||
```shell | ||
> npm install | ||
// or | ||
> yarn install | ||
``` | ||
|
||
## 2. Configure | ||
|
||
Place required fields in a `.env` file in the root folder of the project (requirements are stored in .env.example file). | ||
|
||
### 3. Run | ||
|
||
```shell | ||
npx hardhat test | ||
|
||
// other | ||
npx hardhat accounts | ||
npx hardhat compile | ||
npx hardhat clean | ||
npx hardhat node | ||
npx hardhat help | ||
REPORT_GAS=true npx hardhat test | ||
npx hardhat coverage | ||
npx hardhat run scripts/deploy.ts | ||
TS_NODE_FILES=true npx ts-node scripts/deploy.ts | ||
npx eslint '**/*.{js,ts}' | ||
npx eslint '**/*.{js,ts}' --fix | ||
npx prettier '**/*.{json,sol,md}' --check | ||
npx prettier '**/*.{json,sol,md}' --write | ||
npx solhint 'contracts/**/*.sol' | ||
npx solhint 'contracts/**/*.sol' --fix | ||
``` | ||
|
||
# Performance optimizations | ||
|
||
For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable `TS_NODE_TRANSPILE_ONLY` to `1` in hardhat's environment. For more details see [the documentation](https://hardhat.org/guides/typescript.html#performance-optimizations). |
Oops, something went wrong.