Skip to content

Commit

Permalink
evm folder creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashika Goyal committed Jan 3, 2024
1 parent c841af4 commit 04e80e7
Show file tree
Hide file tree
Showing 188 changed files with 28,426 additions and 0 deletions.
17 changes: 17 additions & 0 deletions evm/.env.example
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
4 changes: 4 additions & 0 deletions evm/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
artifacts
cache
coverage
28 changes: 28 additions & 0 deletions evm/.eslintrc.js
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",
},
};
30 changes: 30 additions & 0 deletions evm/.github/workflows/build.yml
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
17 changes: 17 additions & 0 deletions evm/.gitignore
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
5 changes: 5 additions & 0 deletions evm/.husky/pre-commit
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 .
21 changes: 21 additions & 0 deletions evm/.npmignore
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
5 changes: 5 additions & 0 deletions evm/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
artifacts
cache
coverage*
gasReporterOutput.json
14 changes: 14 additions & 0 deletions evm/.prettierrc
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
}
}
]
}
6 changes: 6 additions & 0 deletions evm/.solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
configureYulOptimizer: true,
providerOptions: {
allowUnlimitedContractSize: true,
},
};
7 changes: 7 additions & 0 deletions evm/.solhint.json
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 }]
}
}
1 change: 1 addition & 0 deletions evm/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions evm/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"solidity.compileUsingRemoteVersion": "v0.8.18+commit.87f61d96"
}
51 changes: 51 additions & 0 deletions evm/README.md
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).
Loading

0 comments on commit 04e80e7

Please sign in to comment.