Skip to content

chore: refactor repo #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
MNEMONIC="test test test test test test test test test test test test"
ALCHEMY_ID=
INFURA_ID=
DEPLOYER_PK=
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cache
dist
typechain
coverage
83 changes: 83 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true,
"mocha": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 12
},
// Typescript config
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": { "project": "./tsconfig.json" },
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"prettier"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": ["objectLiteralProperty"],
"format": ["camelCase", "PascalCase"]
},
{
"selector": ["classProperty"],
"modifiers": ["private", "static"],
"format": ["PascalCase", "UPPER_CASE"]
},
{
"selector": ["classProperty", "classMethod"],
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": ["classProperty", "classMethod"],
"modifiers": ["protected"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": ["enumMember"],
"format": ["camelCase", "PascalCase"]
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should", "has", "can", "did", "will"]
}
]
}
}
]
}
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
artifacts
cache
dist
coverage
typechain
yarn.lock
yarn-error.log
35 changes: 0 additions & 35 deletions .prettierrc.js

This file was deleted.

11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"compiler": "0.8.17"
}
}
],
"plugins": ["prettier-plugin-solidity"]
}
57 changes: 47 additions & 10 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
{
"extends": "solhint:default",
"rules": {
"avoid-suicide": "error",
"avoid-sha3": "warn",
"max-line-length": [
"warn",
300
]
}
}
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"code-complexity": ["error", 5],
"function-max-lines": ["error", 40],
"max-line-length": ["error", 100],
"max-states-count": ["error", 3],
"no-console": "error",
"no-empty-blocks": "error",
"no-global-import": "error",
"no-unused-vars": "error",
"payable-fallback": "off",
"reason-string": ["off", { "maxLength": 32 }],
"constructor-syntax": "off",
"comprehensive-interface": "off",
"quotes": ["error", "double"],
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": ["error", { "strict": false }],
"var-name-mixedcase": "error",
"imports-on-top": "error",
"ordering": "error",
"visibility-modifier-order": "error",
"avoid-call-value": "off",
"avoid-low-level-calls": "off",
"avoid-sha3": "error",
"avoid-suicide": "error",
"avoid-throw": "error",
"avoid-tx-origin": "off",
"check-send-result": "error",
"compiler-version": ["error", "0.8.21"],
"mark-callable-contracts": "off",
"func-visibility": ["error", { "ignoreConstructors": true }],
"multiple-sends": "error",
"no-complex-fallback": "error",
"no-inline-assembly": "off",
"not-rely-on-block-hash": "error",
"not-rely-on-time": "error",
"reentrancy": "error",
"state-visibility": "error"
}
}
2 changes: 2 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
contracts/vendor
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"solidity.compileUsingRemoteVersion": "latest",
"solidity.formatter": "prettier",
"solidity.linter": "solhint",
"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules",
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
10 changes: 5 additions & 5 deletions constants/blockExplorerApi.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ethereum": "https://api.etherscan.io/api",
"bsc": "https://api.bscscan.com/api",
"polygon": "https://api.polygonscan.com/api",
"coredao": "https://openapi.coredao.org/api"
}
"ethereum": "https://api.etherscan.io/api",
"bsc": "https://api.bscscan.com/api",
"polygon": "https://api.polygonscan.com/api",
"coredao": "https://openapi.coredao.org/api"
}
34 changes: 17 additions & 17 deletions constants/chainIds.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"ethereum": 101,
"bsc": 102,
"avalanche": 106,
"polygon": 109,
"arbitrum": 110,
"optimism": 111,
"fantom": 112,
"coredao": 153,
"ethereum": 101,
"bsc": 102,
"avalanche": 106,
"polygon": 109,
"arbitrum": 110,
"optimism": 111,
"fantom": 112,
"coredao": 153,

"goerli": 10121,
"bsc-testnet": 10102,
"fuji": 10106,
"mumbai": 10109,
"arbitrum-goerli": 10143,
"optimism-goerli": 10132,
"fantom-testnet": 10112,
"coredao-testnet": 10153
}
"goerli": 10121,
"bsc-testnet": 10102,
"fuji": 10106,
"mumbai": 10109,
"arbitrum-goerli": 10143,
"optimism-goerli": 10132,
"fantom-testnet": 10112,
"coredao-testnet": 10153
}
2 changes: 1 addition & 1 deletion constants/layerzeroEndpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"optimism-goerli": "0xae92d5aD7583AD66E49A0c67BAd18F6ba52dDDc1",
"fantom-testnet": "0x7dcAD72640F835B0FA36EFD3D6d3ec902C7E5acf",
"coredao-testnet": "0xae92d5aD7583AD66E49A0c67BAd18F6ba52dDDc1"
}
}
16 changes: 8 additions & 8 deletions constants/remoteChainIds.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"ethereum": 153,
"bsc": 153,
"polygon": 153,
"goerli": 10153,
"bsc-testnet": 10153,
"mumbai": 10153
}
"ethereum": 153,
"bsc": 153,
"polygon": 153,

"goerli": 10153,
"bsc-testnet": 10153,
"mumbai": 10153
}
8 changes: 4 additions & 4 deletions constants/sharedDecimals.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"WETH": 18,
"USDC": 6,
"USDT": 6
}
"WETH": 18,
"USDC": 6,
"USDT": 6
}
66 changes: 33 additions & 33 deletions constants/tokens.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"ethereum": {
"WETH": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"USDC": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"USDT": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
},
"bsc": {
"USDC": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
"USDT": "0x55d398326f99059fF775485246999027B3197955"
},
"polygon": {
"USDC": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"USDT": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F"
},
"coredao":{
"WETH": "0xeAB3aC417c4d6dF6b143346a46fEe1B847B50296",
"USDC": "0xa4151B2B3e269645181dCcF2D426cE75fcbDeca9",
"USDT": "0x900101d06A7426441Ae63e9AB3B9b0F63Be145F1"
},
"goerli": {
"WETH": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
"USDC": "0x122B8f9fAda7586072e76950c7a299523D1f3846"
},
"bsc-testnet": {
"USDC": "0x6795cbCF57760947b34eFf59E7465611B80A615b"
},
"mumbai": {
"USDC": "0x9ebF92a4b1615CcD5fd10E46adF509d6071345A9"
},
"coredao-testnet": {
"WETH": "0x2e3531Ad3C30d78e153e485FA5098ddF1524d79d",
"USDC": "0xE1B5004075CE96E5E59B3698BE29AF585e0F1c5C"
}
}
"ethereum": {
"WETH": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"USDC": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"USDT": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
},
"bsc": {
"USDC": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
"USDT": "0x55d398326f99059fF775485246999027B3197955"
},
"polygon": {
"USDC": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"USDT": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F"
},
"coredao": {
"WETH": "0xeAB3aC417c4d6dF6b143346a46fEe1B847B50296",
"USDC": "0xa4151B2B3e269645181dCcF2D426cE75fcbDeca9",
"USDT": "0x900101d06A7426441Ae63e9AB3B9b0F63Be145F1"
},
"goerli": {
"WETH": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
"USDC": "0x122B8f9fAda7586072e76950c7a299523D1f3846"
},
"bsc-testnet": {
"USDC": "0x6795cbCF57760947b34eFf59E7465611B80A615b"
},
"mumbai": {
"USDC": "0x9ebF92a4b1615CcD5fd10E46adF509d6071345A9"
},
"coredao-testnet": {
"WETH": "0x2e3531Ad3C30d78e153e485FA5098ddF1524d79d",
"USDC": "0xE1B5004075CE96E5E59B3698BE29AF585e0F1c5C"
}
}
Loading