Skip to content

Commit

Permalink
fix: security issues (#22)
Browse files Browse the repository at this point in the history
* fix: security issues

* chore(linter): change max line len

* chore(docs): add addresses for other networks

* chore(yarn.lock): change registry
  • Loading branch information
krboktv authored Jun 24, 2024
1 parent c325012 commit 1433770
Show file tree
Hide file tree
Showing 27 changed files with 850 additions and 4,335 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

35 changes: 4 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
extends: ['@1inch'],
rules: {
'@typescript-eslint/member-ordering': 'error',
'lines-between-class-members': 'error',
'padding-line-between-statements': 'error',
'no-unused-vars': 'off',
'max-len': ['error', {code: 120}],
'max-depth': ['error', 3],
'max-lines-per-function': ['error', 70],
'max-params': ['error', 7],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': 0,
},
overrides: [
{
files: ['src/**/*.test.ts'],
rules: {
'max-lines-per-function': ['error', 400],
'max-len': ['error', {code: 130}],
},
},
],
};
'max-depth': ['error', 4]
}
}
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ jobs:

- name: CI
run: yarn run ci-pipeline

- name: Security
run: yarn audit
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "none",
"tabWidth": 4,
"bracketSpacing": false,
"singleQuote": true,
"semi": false,
"printWidth": 120
}
5 changes: 0 additions & 5 deletions .prettierrc.json

This file was deleted.

11 changes: 11 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"transform": {
"decoratorMetadata": true
}
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 1INCH LIMITED
Copyright 2024 1INCH LIMITED

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ yarn add @1inch/multicall

## Onchain addresses

- Ethereum mainnet: `0x8d035edd8e09c3283463dade67cc0d49d6868063`
- BSC mainnet: `0x804708de7af615085203fa2b18eae59c5738e2a9`
- Polygon mainnet: `0x0196e8a9455a90d392b46df8560c867e7df40b34`
- Arbitrum One: `0x11DEE30E710B8d4a8630392781Cc3c0046365d4c`
- Gnosis Chain: `0xE295aD71242373C37C5FdA7B57F26f9eA1088AFe`
- Avalanche: `0xC4A8B7e29E3C8ec560cd4945c1cF3461a85a148d`
- Fantom: `0xA31bB36c5164B165f9c36955EA4CcBaB42B3B28E`
- Optimism: `0xE295aD71242373C37C5FdA7B57F26f9eA1088AFe`
- Ethereum mainnet: `0x8d035edd8e09c3283463dade67cc0d49d6868063`
- BSC mainnet: `0x804708de7af615085203fa2b18eae59c5738e2a9`
- Polygon mainnet: `0x0196e8a9455a90d392b46df8560c867e7df40b34`
- Arbitrum One: `0x11DEE30E710B8d4a8630392781Cc3c0046365d4c`
- Gnosis Chain: `0xE295aD71242373C37C5FdA7B57F26f9eA1088AFe`
- Avalanche: `0xC4A8B7e29E3C8ec560cd4945c1cF3461a85a148d`
- Fantom: `0xA31bB36c5164B165f9c36955EA4CcBaB42B3B28E`
- Optimism: `0xE295aD71242373C37C5FdA7B57F26f9eA1088AFe`
- Base: `0x138ce40d675f9a23e4d6127a8600308cf7a93381`
- Aurora: `0xa0446d8804611944f1b527ecd37d7dcbe442caba`
- zkSync Era: `0xae1f66df155c611c15a23f31acf5a9bf1b87907e`
- Klaytn: `0xa31bb36c5164b165f9c36955ea4ccbab42b3b28e`

## Motivation
The **MultiCall** contract is designed to execute multiple view calls at one time.
Expand Down
6 changes: 0 additions & 6 deletions babel.config.js

This file was deleted.

13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
testTimeout: 200000,
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: 'src',
testRegex: '.*\\.(spec|test)\\.ts$',
transform: {
'^.+\\.(t|j)s$': '@swc/jest'
},
collectCoverageFrom: ['**/*.(t|j)s'],
coverageDirectory: '../coverage',
testEnvironment: 'node',
forceExit: true // For close all ws connections.
}
193 changes: 0 additions & 193 deletions jest.config.ts

This file was deleted.

27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,27 @@
"release": "standard-version"
},
"dependencies": {
"ethers": "5"
"ethers": "^6.13.1"
},
"devDependencies": {
"web3": "1.8.1",
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@1inch/eslint-config": "^1.4.2",
"@1inch/tsconfig": "^v1.0.2",
"@swc/core": "^1.3.102",
"@swc/jest": "0.2.26",
"@types/jest": "29.5.12",
"@typescript-eslint/eslint-plugin": "5",
"@typescript-eslint/eslint-plugin": "5.59",
"@typescript-eslint/parser": "5.51",
"babel-jest": "^29.7.0",
"create-ts-index": "^1.13.3",
"eslint": "8",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard-with-typescript": "^20.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "11",
"eslint": "8.41.0",
"eslint-config-prettier": "8.3",
"eslint-config-standard": "17",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-import": "2.26",
"eslint-plugin-n": "16",
"eslint-plugin-prettier": "4",
"eslint-plugin-promise": "6",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-unused-imports": "2",
"husky": "^6.0.0",
"istanbul-badges-readme": "^1.2.1",
"jest": "29.7.0",
Expand Down
4 changes: 2 additions & 2 deletions src/connector/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// created from 'create-ts-index'

export * from './provider.connector';
export * from './web3-provider.connector';
export * from './provider.connector'
export * from './web3-provider.connector'
Loading

0 comments on commit 1433770

Please sign in to comment.