diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 380b4171..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true - }, - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": ["@typescript-eslint"], - "rules": {} -} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 9fa3e890..00000000 --- a/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -build -cache -coverage -dist - -src/constants/abis/** diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 5a18a5b1..00000000 --- a/.prettierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "jsxSingleQuote": true, - "quoteProps": "consistent" -} diff --git a/.vscode/settings.json b/.vscode/settings.json index b55450f6..4623c500 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,9 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "biomejs.biome", + "[javascript]": { + "editor.defaultFormatter": "biomejs.biome" + }, "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "biomejs.biome" } } diff --git a/biome.json b/biome.json index 9cb0a263..6d742f8a 100644 --- a/biome.json +++ b/biome.json @@ -1,12 +1,46 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "formatter": { - "enabled": false - }, - "linter": { - "enabled": false - }, - "organizeImports": { - "enabled": true - } + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "include": ["src/**"], + "ignoreUnknown": false, + "ignore": ["node_modules", "cache", "coverage", "dist", "build"] + }, + "formatter": { + "enabled": true, + "indentStyle": "space" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "complexity": { + "noForEach": "warn" + }, + "style": { + "noNonNullAssertion": "off", + "noUselessElse": "off" + }, + "suspicious": { + "noExplicitAny": "off", + "noFocusedTests": "off" + } + } + }, + "javascript": { + "formatter": { + "indentStyle": "space", + "indentWidth": 2, + "quoteProperties": "preserve", + "quoteStyle": "single", + "semicolons": "asNeeded" + } + } } diff --git a/package-lock.json b/package-lock.json index 8dfc7924..3f38174b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,18 +26,15 @@ "@babel/core": "^7.18.2", "@babel/preset-env": "^7.18.2", "@babel/preset-typescript": "^7.17.12", + "@biomejs/biome": "1.9.4", "@ethersproject/wallet": "^5.7.0", "@types/jest": "^28.1.3", "@types/node": "^17.0.42", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", "babel-jest": "^28.1.1", "cz-conventional-changelog": "^3.3.0", "dotenv": "^16.0.1", - "eslint": "^8.17.0", "hardhat": "^2.22.13", "jest": "^28.1.1", - "prettier": "^2.6.2", "semantic-release": "^24.0.0", "ts-node": "^10.8.1", "tsup": "^7.0.0", @@ -1842,6 +1839,161 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@biomejs/biome": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", + "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.9.4", + "@biomejs/cli-darwin-x64": "1.9.4", + "@biomejs/cli-linux-arm64": "1.9.4", + "@biomejs/cli-linux-arm64-musl": "1.9.4", + "@biomejs/cli-linux-x64": "1.9.4", + "@biomejs/cli-linux-x64-musl": "1.9.4", + "@biomejs/cli-win32-arm64": "1.9.4", + "@biomejs/cli-win32-x64": "1.9.4" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", + "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", + "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", + "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", + "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", + "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", + "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", + "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", + "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -2338,50 +2490,6 @@ "node": ">=12" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", - "dev": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -3058,26 +3166,6 @@ "@ethersproject/strings": "^5.7.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, "node_modules/@indexcoop/tokenlists": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@indexcoop/tokenlists/-/tokenlists-3.3.0.tgz", @@ -5024,12 +5112,6 @@ "pretty-format": "^28.0.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "node_modules/@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", @@ -5115,216 +5197,6 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@uniswap/lib": { "version": "4.0.1-alpha", "resolved": "https://registry.npmjs.org/@uniswap/lib/-/lib-4.0.1-alpha.tgz", @@ -5511,15 +5383,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -5582,6 +5445,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "optional": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -7093,12 +6957,6 @@ "node": ">=4.0.0" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, "node_modules/deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -7235,18 +7093,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -7705,121 +7551,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz", - "integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==", - "dev": true, - "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", - "dev": true, - "dependencies": { - "acorn": "^8.7.1", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -7833,39 +7564,6 @@ "node": ">=4" } }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -8070,7 +7768,8 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "optional": true }, "node_modules/fast-glob": { "version": "3.3.2", @@ -8106,12 +7805,6 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", @@ -8167,18 +7860,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -8275,25 +7956,6 @@ "flat": "cli.js" } }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, "node_modules/follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", @@ -8422,12 +8084,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -8545,18 +8201,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -8612,21 +8256,6 @@ "which": "bin/which" } }, - "node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globalthis": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", @@ -8680,12 +8309,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "node_modules/handlebars": { "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", @@ -10686,13 +10309,8 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "optional": true }, "node_modules/json-stream-stringify": { "version": "3.1.6", @@ -10800,19 +10418,6 @@ "node": ">=6" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -10933,12 +10538,6 @@ "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", "dev": true }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -11486,12 +11085,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -14294,23 +13887,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -14738,30 +14314,6 @@ "node": ">= 14" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/pretty-format": { "version": "28.1.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.1.tgz", @@ -15063,18 +14615,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/regexpu-core": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz", @@ -16516,12 +16056,6 @@ "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -16813,27 +16347,12 @@ "node_modules/tsup/node_modules/whatwg-url": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" } }, "node_modules/tweetnacl": { @@ -16846,18 +16365,6 @@ "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -17126,6 +16633,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "optional": true, "dependencies": { "punycode": "^2.1.0" } @@ -17165,12 +16673,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -18883,6 +18385,78 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@biomejs/biome": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", + "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "dev": true, + "requires": { + "@biomejs/cli-darwin-arm64": "1.9.4", + "@biomejs/cli-darwin-x64": "1.9.4", + "@biomejs/cli-linux-arm64": "1.9.4", + "@biomejs/cli-linux-arm64-musl": "1.9.4", + "@biomejs/cli-linux-x64": "1.9.4", + "@biomejs/cli-linux-x64-musl": "1.9.4", + "@biomejs/cli-win32-arm64": "1.9.4", + "@biomejs/cli-win32-x64": "1.9.4" + } + }, + "@biomejs/cli-darwin-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", + "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "dev": true, + "optional": true + }, + "@biomejs/cli-darwin-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", + "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", + "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-arm64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", + "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", + "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-x64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", + "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "dev": true, + "optional": true + }, + "@biomejs/cli-win32-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", + "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "dev": true, + "optional": true + }, + "@biomejs/cli-win32-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", + "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "dev": true, + "optional": true + }, "@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -19153,38 +18727,6 @@ "dev": true, "optional": true }, - "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^3.3.0" - } - }, - "@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", - "dev": true - }, - "@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, "@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -19561,23 +19103,6 @@ "@ethersproject/strings": "^5.7.0" } }, - "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, "@indexcoop/tokenlists": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@indexcoop/tokenlists/-/tokenlists-3.3.0.tgz", @@ -20964,12 +20489,6 @@ "pretty-format": "^28.0.0" } }, - "@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", @@ -21055,123 +20574,6 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, - "@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", - "dev": true, - "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - } - }, - "@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", - "dev": true, - "requires": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "dependencies": { - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - } - }, "@uniswap/lib": { "version": "4.0.1-alpha", "resolved": "https://registry.npmjs.org/@uniswap/lib/-/lib-4.0.1-alpha.tgz", @@ -21302,13 +20704,6 @@ "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "devOptional": true }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -21356,6 +20751,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "optional": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -22479,12 +21875,6 @@ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -22576,15 +21966,6 @@ "path-type": "^4.0.0" } }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, "dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -22923,123 +22304,12 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, - "eslint": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz", - "integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==", - "dev": true, - "requires": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - } - }, - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true - }, - "espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", - "dev": true, - "requires": { - "acorn": "^8.7.1", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - } - }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -23220,7 +22490,8 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "optional": true }, "fast-glob": { "version": "3.3.2", @@ -23252,12 +22523,6 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, "fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", @@ -23303,15 +22568,6 @@ } } }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -23384,22 +22640,6 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, "follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", @@ -23486,12 +22726,6 @@ "functions-have-names": "^1.2.3" } }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -23573,15 +22807,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -23627,15 +22852,6 @@ } } }, - "globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, "globalthis": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", @@ -23674,12 +22890,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, - "graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "handlebars": { "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", @@ -25121,13 +24331,8 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "optional": true }, "json-stream-stringify": { "version": "3.1.6", @@ -25203,16 +24408,6 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, "lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -25317,12 +24512,6 @@ "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", "dev": true }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -25725,12 +24914,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -27607,20 +26790,6 @@ "mimic-fn": "^2.1.0" } }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, "ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -27912,18 +27081,6 @@ } } }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", - "dev": true - }, "pretty-format": { "version": "28.1.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.1.tgz", @@ -28147,12 +27304,6 @@ "set-function-name": "^2.0.1" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "regexpu-core": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz", @@ -29188,12 +28339,6 @@ "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, "thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -29414,15 +28559,6 @@ } } }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -29433,15 +28569,6 @@ "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -29622,6 +28749,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "optional": true, "requires": { "punycode": "^2.1.0" } @@ -29651,12 +28779,6 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index 217298f5..3e789656 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "hardhat": "npx hardhat node --verbose", "hardhat:arbitrum": "npx hardhat node --config hardhat.arbitrum.config.js --port 8548", "hardhat:base": "npx hardhat node --config hardhat.base.config.js --port 8453", - "lint": "prettier -c . && eslint ./src", - "lint:fix": "prettier -w . && eslint ./src --fix", + "lint": "biome lint ./src", + "lint:fix": "biome check --write ./src", "test": "jest", "test:builders": "npm test src/flashmint/", "test:quotes": "npm test src/quote/", @@ -61,18 +61,15 @@ "@babel/core": "^7.18.2", "@babel/preset-env": "^7.18.2", "@babel/preset-typescript": "^7.17.12", + "@biomejs/biome": "1.9.4", "@ethersproject/wallet": "^5.7.0", "@types/jest": "^28.1.3", "@types/node": "^17.0.42", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", "babel-jest": "^28.1.1", "cz-conventional-changelog": "^3.3.0", "dotenv": "^16.0.1", - "eslint": "^8.17.0", "hardhat": "^2.22.13", "jest": "^28.1.1", - "prettier": "^2.6.2", "semantic-release": "^24.0.0", "ts-node": "^10.8.1", "tsup": "^7.0.0", diff --git a/src/constants/abis/DebtIssuanceModuleV2.json b/src/constants/abis/DebtIssuanceModuleV2.json index cdca4885..bfe7c3c4 100644 --- a/src/constants/abis/DebtIssuanceModuleV2.json +++ b/src/constants/abis/DebtIssuanceModuleV2.json @@ -1 +1,425 @@ -[{"inputs":[{"internalType":"contract IController","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":false,"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"FeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_newIssueFee","type":"uint256"}],"name":"IssueFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_newRedeemFee","type":"uint256"}],"name":"RedeemFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_issuer","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"address","name":"_hookContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"_quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_managerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"SetTokenIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_redeemer","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_managerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"SetTokenRedeemed","type":"event"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"bool","name":"_isIssue","type":"bool"}],"name":"calculateTotalFees","outputs":[{"internalType":"uint256","name":"totalQuantity","type":"uint256"},{"internalType":"uint256","name":"managerFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"getModuleIssuanceHooks","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"getRequiredComponentIssuanceUnits","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"getRequiredComponentRedemptionUnits","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_maxManagerFee","type":"uint256"},{"internalType":"uint256","name":"_managerIssueFee","type":"uint256"},{"internalType":"uint256","name":"_managerRedeemFee","type":"uint256"},{"internalType":"address","name":"_feeRecipient","type":"address"},{"internalType":"contract IManagerIssuanceHook","name":"_managerIssuanceHook","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_hook","type":"address"}],"name":"isModuleIssuanceHook","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"name":"issuanceSettings","outputs":[{"internalType":"uint256","name":"maxManagerFee","type":"uint256"},{"internalType":"uint256","name":"managerIssueFee","type":"uint256"},{"internalType":"uint256","name":"managerRedeemFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"contract IManagerIssuanceHook","name":"managerIssuanceHook","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"issue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"registerToIssuanceModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"unregisterFromIssuanceModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"updateFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_newIssueFee","type":"uint256"}],"name":"updateIssueFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_newRedeemFee","type":"uint256"}],"name":"updateRedeemFee","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[ + { + "inputs": [ + { + "internalType": "contract IController", + "name": "_controller", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_newFeeRecipient", + "type": "address" + } + ], + "name": "FeeRecipientUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_newIssueFee", + "type": "uint256" + } + ], + "name": "IssueFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_newRedeemFee", + "type": "uint256" + } + ], + "name": "RedeemFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_issuer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_hookContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_quantity", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_managerFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_protocolFee", + "type": "uint256" + } + ], + "name": "SetTokenIssued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_redeemer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_quantity", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_managerFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_protocolFee", + "type": "uint256" + } + ], + "name": "SetTokenRedeemed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_quantity", "type": "uint256" }, + { "internalType": "bool", "name": "_isIssue", "type": "bool" } + ], + "name": "calculateTotalFees", + "outputs": [ + { "internalType": "uint256", "name": "totalQuantity", "type": "uint256" }, + { "internalType": "uint256", "name": "managerFee", "type": "uint256" }, + { "internalType": "uint256", "name": "protocolFee", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "getModuleIssuanceHooks", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_quantity", "type": "uint256" } + ], + "name": "getRequiredComponentIssuanceUnits", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" }, + { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_quantity", "type": "uint256" } + ], + "name": "getRequiredComponentRedemptionUnits", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" }, + { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxManagerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_managerIssueFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_managerRedeemFee", + "type": "uint256" + }, + { "internalType": "address", "name": "_feeRecipient", "type": "address" }, + { + "internalType": "contract IManagerIssuanceHook", + "name": "_managerIssuanceHook", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "address", "name": "_hook", "type": "address" } + ], + "name": "isModuleIssuanceHook", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract ISetToken", "name": "", "type": "address" } + ], + "name": "issuanceSettings", + "outputs": [ + { "internalType": "uint256", "name": "maxManagerFee", "type": "uint256" }, + { + "internalType": "uint256", + "name": "managerIssueFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "managerRedeemFee", + "type": "uint256" + }, + { "internalType": "address", "name": "feeRecipient", "type": "address" }, + { + "internalType": "contract IManagerIssuanceHook", + "name": "managerIssuanceHook", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_quantity", "type": "uint256" }, + { "internalType": "address", "name": "_to", "type": "address" } + ], + "name": "issue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_quantity", "type": "uint256" }, + { "internalType": "address", "name": "_to", "type": "address" } + ], + "name": "redeem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "registerToIssuanceModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "removeModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "unregisterFromIssuanceModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_newFeeRecipient", + "type": "address" + } + ], + "name": "updateFeeRecipient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_newIssueFee", "type": "uint256" } + ], + "name": "updateIssueFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_newRedeemFee", "type": "uint256" } + ], + "name": "updateRedeemFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/constants/abis/ExchangeIssuanceLeveraged.json b/src/constants/abis/ExchangeIssuanceLeveraged.json index be52c22f..7f3c0a90 100644 --- a/src/constants/abis/ExchangeIssuanceLeveraged.json +++ b/src/constants/abis/ExchangeIssuanceLeveraged.json @@ -1 +1,578 @@ -[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_quickRouter","type":"address"},{"internalType":"address","name":"_sushiRouter","type":"address"},{"internalType":"address","name":"_uniV3Router","type":"address"},{"internalType":"address","name":"_uniV3Quoter","type":"address"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"contract IDebtIssuanceModule","name":"_debtIssuanceModule","type":"address"},{"internalType":"contract IAaveLeverageModule","name":"_aaveLeverageModule","type":"address"},{"internalType":"address","name":"_aaveAddressProvider","type":"address"},{"internalType":"address","name":"_curveAddressProvider","type":"address"},{"internalType":"address","name":"_curveCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"ExchangeIssue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"ExchangeRedeem","type":"event"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"contract ILendingPoolAddressesProviderV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LENDING_POOL","outputs":[{"internalType":"contract ILendingPoolV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUNDING_ERROR_MARGIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aaveLeverageModule","outputs":[{"internalType":"contract IAaveLeverageModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addresses","outputs":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"debtIssuanceModule","outputs":[{"internalType":"contract IDebtIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"premiums","type":"uint256[]"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"getIssueExactSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"bool","name":"_isIssuance","type":"bool"}],"name":"getLeveragedTokenData","outputs":[{"components":[{"internalType":"address","name":"collateralAToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"address","name":"debtToken","type":"address"},{"internalType":"uint256","name":"debtAmount","type":"uint256"}],"internalType":"struct ExchangeIssuanceLeveraged.LeveragedTokenData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"getRedeemExactSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"issueExactSetFromERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"issueExactSetFromETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"address","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_minAmountOutputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"redeemExactSetForERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"uint256","name":"_minAmountOutputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"redeemExactSetForETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] +[ + { + "inputs": [ + { "internalType": "address", "name": "_weth", "type": "address" }, + { "internalType": "address", "name": "_quickRouter", "type": "address" }, + { "internalType": "address", "name": "_sushiRouter", "type": "address" }, + { "internalType": "address", "name": "_uniV3Router", "type": "address" }, + { "internalType": "address", "name": "_uniV3Quoter", "type": "address" }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { + "internalType": "contract IDebtIssuanceModule", + "name": "_debtIssuanceModule", + "type": "address" + }, + { + "internalType": "contract IAaveLeverageModule", + "name": "_aaveLeverageModule", + "type": "address" + }, + { + "internalType": "address", + "name": "_aaveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "_curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "_curveCalculator", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "ExchangeIssue", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "ExchangeRedeem", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract ILendingPoolAddressesProviderV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LENDING_POOL", + "outputs": [ + { + "internalType": "contract ILendingPoolV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ROUNDING_ERROR_MARGIN", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "aaveLeverageModule", + "outputs": [ + { + "internalType": "contract IAaveLeverageModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "addresses", + "outputs": [ + { "internalType": "address", "name": "quickRouter", "type": "address" }, + { "internalType": "address", "name": "sushiRouter", "type": "address" }, + { "internalType": "address", "name": "uniV3Router", "type": "address" }, + { "internalType": "address", "name": "uniV3Quoter", "type": "address" }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract IERC20", "name": "_token", "type": "address" } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "approveTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "debtIssuanceModule", + "outputs": [ + { + "internalType": "contract IDebtIssuanceModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "premiums", "type": "uint256[]" }, + { "internalType": "address", "name": "initiator", "type": "address" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "executeOperation", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "getIssueExactSet", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "bool", "name": "_isIssuance", "type": "bool" } + ], + "name": "getLeveragedTokenData", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "collateralAToken", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { "internalType": "address", "name": "debtToken", "type": "address" }, + { "internalType": "uint256", "name": "debtAmount", "type": "uint256" } + ], + "internalType": "struct ExchangeIssuanceLeveraged.LeveragedTokenData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "getRedeemExactSet", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_maxAmountInputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "issueExactSetFromERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "issueExactSetFromETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_minAmountOutputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "redeemExactSetForERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_minAmountOutputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "redeemExactSetForETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/ExchangeIssuanceZeroEx.json b/src/constants/abis/ExchangeIssuanceZeroEx.json index 33efb9a1..05c20e3a 100644 --- a/src/constants/abis/ExchangeIssuanceZeroEx.json +++ b/src/constants/abis/ExchangeIssuanceZeroEx.json @@ -1 +1,425 @@ -[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"address","name":"_swapTarget","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"ExchangeIssue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"ExchangeRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_issuanceModule","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"},{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"}],"name":"getRequiredIssuanceComponents","outputs":[{"internalType":"address[]","name":"components","type":"address[]"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"},{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"}],"name":"getRequiredRedemptionComponents","outputs":[{"internalType":"address[]","name":"components","type":"address[]"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"issueExactSetFromETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"issueExactSetFromToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minEthReceive","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"redeemExactSetForETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minOutputReceive","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"redeemExactSetForToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTarget","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] +[ + { + "inputs": [ + { "internalType": "address", "name": "_weth", "type": "address" }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { "internalType": "address", "name": "_swapTarget", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "ExchangeIssue", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "ExchangeRedeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "ETH_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { "internalType": "address", "name": "_spender", "type": "address" } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address", "name": "_spender", "type": "address" } + ], + "name": "approveTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" }, + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + } + ], + "name": "getRequiredIssuanceComponents", + "outputs": [ + { + "internalType": "address[]", + "name": "components", + "type": "address[]" + }, + { "internalType": "uint256[]", "name": "positions", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" }, + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + } + ], + "name": "getRequiredRedemptionComponents", + "outputs": [ + { + "internalType": "address[]", + "name": "components", + "type": "address[]" + }, + { "internalType": "uint256[]", "name": "positions", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "issueExactSetFromETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxAmountInputToken", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "issueExactSetFromToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minEthReceive", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "redeemExactSetForETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOutputReceive", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "redeemExactSetForToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "swapTarget", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address payable", "name": "_to", "type": "address" } + ], + "name": "withdrawTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/FlashMintHyEth.json b/src/constants/abis/FlashMintHyEth.json index 16d87bb9..b5335f06 100644 --- a/src/constants/abis/FlashMintHyEth.json +++ b/src/constants/abis/FlashMintHyEth.json @@ -1 +1,718 @@ -[{"inputs":[{"components":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"balV2Vault","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"internalType":"struct DEXAdapterV3.Addresses","name":"_dexAddresses","type":"tuple"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"contract IDebtIssuanceModule","name":"_issuanceModule","type":"address"},{"internalType":"contract IStETH","name":"_stETH","type":"address"},{"internalType":"address","name":"_stEthETHPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"FlashMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"FlashRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ROUNDING_ERROR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acrossPool","outputs":[{"internalType":"contract IAcrossHubPoolV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acrossToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"agETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_allowance","type":"uint256"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dexAdapter","outputs":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"balV2Vault","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"erc4626Components","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"issuanceModule","outputs":[{"internalType":"contract IDebtIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_maxInputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_swapDataInputTokenToEth","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_swapDataEthToInputToken","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData[]","name":"_swapDataEthToComponent","type":"tuple[]"}],"name":"issueExactSetFromERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData[]","name":"_swapDataEthToComponent","type":"tuple[]"}],"name":"issueExactSetFromETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPendleMarketV3","name":"","type":"address"}],"name":"pendleMarketData","outputs":[{"internalType":"contract IPendlePrincipalToken","name":"pt","type":"address"},{"internalType":"contract IPendleStandardizedYield","name":"sy","type":"address"},{"internalType":"address","name":"underlying","type":"address"},{"internalType":"uint256","name":"exchangeRateFactor","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPendlePrincipalToken","name":"","type":"address"}],"name":"pendleMarkets","outputs":[{"internalType":"contract IPendleMarketV3","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_minOutputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_swapDataEthToOutputToken","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData[]","name":"_swapDataComponentToEth","type":"tuple[]"}],"name":"redeemExactSetForERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minETHOut","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData[]","name":"_swapDataComponentToEth","type":"tuple[]"}],"name":"redeemExactSetForETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rsEthAdapter","outputs":[{"internalType":"contract IRsEthAdapter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_component","type":"address"},{"internalType":"bool","name":"_isERC4626","type":"bool"}],"name":"setERC4626Component","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPendlePrincipalToken","name":"_pt","type":"address"},{"internalType":"contract IPendleStandardizedYield","name":"_sy","type":"address"},{"internalType":"address","name":"_underlying","type":"address"},{"internalType":"contract IPendleMarketV3","name":"_market","type":"address"},{"internalType":"uint256","name":"_exchangeRateFactor","type":"uint256"}],"name":"setPendleMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"address","name":"_outputToken","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_swapData","type":"tuple"}],"name":"setSwapData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stETH","outputs":[{"internalType":"contract IStETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_ptToAccount","type":"int256"},{"internalType":"int256","name":"_syToAccount","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"swapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"swapData","outputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "quickRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "sushiRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Router", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Quoter", + "type": "address" + }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { + "internalType": "address", + "name": "balV2Vault", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "internalType": "struct DEXAdapterV3.Addresses", + "name": "_dexAddresses", + "type": "tuple" + }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { + "internalType": "contract IDebtIssuanceModule", + "name": "_issuanceModule", + "type": "address" + }, + { + "internalType": "contract IStETH", + "name": "_stETH", + "type": "address" + }, + { "internalType": "address", "name": "_stEthETHPool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "FlashMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "FlashRedeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "ROUNDING_ERROR", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acrossPool", + "outputs": [ + { + "internalType": "contract IAcrossHubPoolV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acrossToken", + "outputs": [ + { "internalType": "contract IERC20", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "agETH", + "outputs": [ + { "internalType": "contract IERC20", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { "internalType": "address", "name": "_spender", "type": "address" }, + { "internalType": "uint256", "name": "_allowance", "type": "uint256" } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dexAdapter", + "outputs": [ + { "internalType": "address", "name": "quickRouter", "type": "address" }, + { "internalType": "address", "name": "sushiRouter", "type": "address" }, + { "internalType": "address", "name": "uniV3Router", "type": "address" }, + { "internalType": "address", "name": "uniV3Quoter", "type": "address" }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "balV2Vault", "type": "address" }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "erc4626Components", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "issuanceModule", + "outputs": [ + { + "internalType": "contract IDebtIssuanceModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxInputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_swapDataInputTokenToEth", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_swapDataEthToInputToken", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData[]", + "name": "_swapDataEthToComponent", + "type": "tuple[]" + } + ], + "name": "issueExactSetFromERC20", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData[]", + "name": "_swapDataEthToComponent", + "type": "tuple[]" + } + ], + "name": "issueExactSetFromETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPendleMarketV3", + "name": "", + "type": "address" + } + ], + "name": "pendleMarketData", + "outputs": [ + { + "internalType": "contract IPendlePrincipalToken", + "name": "pt", + "type": "address" + }, + { + "internalType": "contract IPendleStandardizedYield", + "name": "sy", + "type": "address" + }, + { "internalType": "address", "name": "underlying", "type": "address" }, + { + "internalType": "uint256", + "name": "exchangeRateFactor", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPendlePrincipalToken", + "name": "", + "type": "address" + } + ], + "name": "pendleMarkets", + "outputs": [ + { + "internalType": "contract IPendleMarketV3", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOutputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_swapDataEthToOutputToken", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData[]", + "name": "_swapDataComponentToEth", + "type": "tuple[]" + } + ], + "name": "redeemExactSetForERC20", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { "internalType": "uint256", "name": "_minETHOut", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData[]", + "name": "_swapDataComponentToEth", + "type": "tuple[]" + } + ], + "name": "redeemExactSetForETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rsEthAdapter", + "outputs": [ + { + "internalType": "contract IRsEthAdapter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_component", "type": "address" }, + { "internalType": "bool", "name": "_isERC4626", "type": "bool" } + ], + "name": "setERC4626Component", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPendlePrincipalToken", + "name": "_pt", + "type": "address" + }, + { + "internalType": "contract IPendleStandardizedYield", + "name": "_sy", + "type": "address" + }, + { "internalType": "address", "name": "_underlying", "type": "address" }, + { + "internalType": "contract IPendleMarketV3", + "name": "_market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_exchangeRateFactor", + "type": "uint256" + } + ], + "name": "setPendleMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_swapData", + "type": "tuple" + } + ], + "name": "setSwapData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stETH", + "outputs": [ + { "internalType": "contract IStETH", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "int256", "name": "_ptToAccount", "type": "int256" }, + { "internalType": "int256", "name": "_syToAccount", "type": "int256" }, + { "internalType": "bytes", "name": "_data", "type": "bytes" } + ], + "name": "swapCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "swapData", + "outputs": [ + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address payable", "name": "_to", "type": "address" } + ], + "name": "withdrawTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/FlashMintLeveragedExtended.json b/src/constants/abis/FlashMintLeveragedExtended.json index 8ab9b40a..0341c00a 100644 --- a/src/constants/abis/FlashMintLeveragedExtended.json +++ b/src/constants/abis/FlashMintLeveragedExtended.json @@ -1 +1,980 @@ -[{"inputs":[{"components":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"internalType":"struct DEXAdapter.Addresses","name":"_addresses","type":"tuple"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"contract IDebtIssuanceModule","name":"_debtIssuanceModule","type":"address"},{"internalType":"contract IAaveLeverageModule","name":"_aaveLeverageModule","type":"address"},{"internalType":"address","name":"_aaveV3Pool","type":"address"},{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"FlashMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"FlashRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"LENDING_POOL","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUNDING_ERROR_MARGIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aaveLeverageModule","outputs":[{"internalType":"contract IAaveLeverageModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addresses","outputs":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balancerV2Vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debtIssuanceModule","outputs":[{"internalType":"contract IDebtIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"getIssueExactSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"bool","name":"_isIssuance","type":"bool"}],"name":"getLeveragedTokenData","outputs":[{"components":[{"internalType":"address","name":"collateralAToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"address","name":"debtToken","type":"address"},{"internalType":"uint256","name":"debtAmount","type":"uint256"}],"internalType":"struct FlashMintLeveraged.LeveragedTokenData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"getRedeemExactSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"issueExactSetFromERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"issueExactSetFromETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_minSetAmount","type":"uint256"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_inputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputTokenForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputTokenForETH","type":"tuple"},{"internalType":"uint256","name":"_priceEstimateInflator","type":"uint256"},{"internalType":"uint256","name":"_maxDust","type":"uint256"}],"name":"issueSetFromExactERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_minSetAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputTokenForCollateral","type":"tuple"},{"internalType":"uint256","name":"_priceEstimateInflator","type":"uint256"},{"internalType":"uint256","name":"_maxDust","type":"uint256"}],"name":"issueSetFromExactETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"maxGasRebate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxIterations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"feeAmounts","type":"uint256[]"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"receiveFlashLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"address","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_minAmountOutputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"redeemExactSetForERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"uint256","name":"_minAmountOutputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"redeemExactSetForETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_maxSetAmount","type":"uint256"},{"internalType":"address","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_outputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForOutputToken","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputTokenForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputTokenForETH","type":"tuple"},{"internalType":"uint256","name":"_priceEstimateInflator","type":"uint256"},{"internalType":"uint256","name":"_maxDust","type":"uint256"}],"name":"redeemSetForExactERC20","outputs":[{"internalType":"uint256","name":"setAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_maxSetAmount","type":"uint256"},{"internalType":"uint256","name":"_outputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForOutputToken","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputTokenForCollateral","type":"tuple"},{"internalType":"uint256","name":"_priceEstimateInflator","type":"uint256"},{"internalType":"uint256","name":"_maxDust","type":"uint256"}],"name":"redeemSetForExactETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxGasRebate","type":"uint256"}],"name":"setMaxGasRebate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxIterations","type":"uint256"}],"name":"setMaxIterations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "quickRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "sushiRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Router", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Quoter", + "type": "address" + }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "internalType": "struct DEXAdapter.Addresses", + "name": "_addresses", + "type": "tuple" + }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { + "internalType": "contract IDebtIssuanceModule", + "name": "_debtIssuanceModule", + "type": "address" + }, + { + "internalType": "contract IAaveLeverageModule", + "name": "_aaveLeverageModule", + "type": "address" + }, + { "internalType": "address", "name": "_aaveV3Pool", "type": "address" }, + { "internalType": "address", "name": "_vault", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "FlashMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "FlashRedeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "LENDING_POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ROUNDING_ERROR_MARGIN", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "aaveLeverageModule", + "outputs": [ + { + "internalType": "contract IAaveLeverageModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "addresses", + "outputs": [ + { "internalType": "address", "name": "quickRouter", "type": "address" }, + { "internalType": "address", "name": "sushiRouter", "type": "address" }, + { "internalType": "address", "name": "uniV3Router", "type": "address" }, + { "internalType": "address", "name": "uniV3Quoter", "type": "address" }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract IERC20", "name": "_token", "type": "address" } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "approveTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "balancerV2Vault", + "outputs": [ + { "internalType": "contract IVault", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "debtIssuanceModule", + "outputs": [ + { + "internalType": "contract IDebtIssuanceModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "getIssueExactSet", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "bool", "name": "_isIssuance", "type": "bool" } + ], + "name": "getLeveragedTokenData", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "collateralAToken", + "type": "address" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { "internalType": "address", "name": "debtToken", "type": "address" }, + { "internalType": "uint256", "name": "debtAmount", "type": "uint256" } + ], + "internalType": "struct FlashMintLeveraged.LeveragedTokenData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "getRedeemExactSet", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_maxAmountInputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "issueExactSetFromERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "issueExactSetFromETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_minSetAmount", "type": "uint256" }, + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_inputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputTokenForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputTokenForETH", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_priceEstimateInflator", + "type": "uint256" + }, + { "internalType": "uint256", "name": "_maxDust", "type": "uint256" } + ], + "name": "issueSetFromExactERC20", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_minSetAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputTokenForCollateral", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_priceEstimateInflator", + "type": "uint256" + }, + { "internalType": "uint256", "name": "_maxDust", "type": "uint256" } + ], + "name": "issueSetFromExactETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "maxGasRebate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxIterations", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { + "internalType": "uint256[]", + "name": "feeAmounts", + "type": "uint256[]" + }, + { "internalType": "bytes", "name": "userData", "type": "bytes" } + ], + "name": "receiveFlashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_minAmountOutputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "redeemExactSetForERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_minAmountOutputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "redeemExactSetForETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_maxSetAmount", "type": "uint256" }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_outputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForOutputToken", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputTokenForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputTokenForETH", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_priceEstimateInflator", + "type": "uint256" + }, + { "internalType": "uint256", "name": "_maxDust", "type": "uint256" } + ], + "name": "redeemSetForExactERC20", + "outputs": [ + { "internalType": "uint256", "name": "setAmount", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_maxSetAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_outputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForOutputToken", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputTokenForCollateral", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_priceEstimateInflator", + "type": "uint256" + }, + { "internalType": "uint256", "name": "_maxDust", "type": "uint256" } + ], + "name": "redeemSetForExactETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_maxGasRebate", "type": "uint256" } + ], + "name": "setMaxGasRebate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_maxIterations", "type": "uint256" } + ], + "name": "setMaxIterations", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/FlashMintLeveragedForCompound.json b/src/constants/abis/FlashMintLeveragedForCompound.json index 15d68535..4ee473ee 100644 --- a/src/constants/abis/FlashMintLeveragedForCompound.json +++ b/src/constants/abis/FlashMintLeveragedForCompound.json @@ -1 +1,614 @@ -[{"inputs":[{"components":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"internalType":"struct DEXAdapter.Addresses","name":"_dexAddresses","type":"tuple"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"contract IDebtIssuanceModule","name":"_debtIssuanceModule","type":"address"},{"internalType":"contract ICompoundLeverageModule","name":"_compoundLeverageModule","type":"address"},{"internalType":"address","name":"_aaveAddressProvider","type":"address"},{"internalType":"address","name":"_cEther","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"FlashMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"FlashRedeem","type":"event"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"contract ILendingPoolAddressesProviderV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LENDING_POOL","outputs":[{"internalType":"contract ILendingPoolV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUNDING_ERROR_MARGIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addresses","outputs":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cEtherAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"compoundLeverageModule","outputs":[{"internalType":"contract ICompoundLeverageModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debtIssuanceModule","outputs":[{"internalType":"contract IDebtIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"premiums","type":"uint256[]"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"getIssueExactSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"bool","name":"_isMint","type":"bool"}],"name":"getLeveragedTokenData","outputs":[{"components":[{"internalType":"address","name":"collateralCToken","type":"address"},{"internalType":"uint256","name":"cTokenAmount","type":"uint256"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"address","name":"debtToken","type":"address"},{"internalType":"uint256","name":"debtAmount","type":"uint256"}],"internalType":"struct FlashMintLeveragedForCompound.LeveragedTokenData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"getRedeemExactSet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"issueExactSetFromERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataDebtForCollateral","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataInputToken","type":"tuple"}],"name":"issueExactSetFromETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"address","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_minAmountOutputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"redeemExactSetForERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"internalType":"uint256","name":"_minAmountOutputToken","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataCollateralForDebt","type":"tuple"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"enum DEXAdapter.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapter.SwapData","name":"_swapDataOutputToken","type":"tuple"}],"name":"redeemExactSetForETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "quickRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "sushiRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Router", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Quoter", + "type": "address" + }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "internalType": "struct DEXAdapter.Addresses", + "name": "_dexAddresses", + "type": "tuple" + }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { + "internalType": "contract IDebtIssuanceModule", + "name": "_debtIssuanceModule", + "type": "address" + }, + { + "internalType": "contract ICompoundLeverageModule", + "name": "_compoundLeverageModule", + "type": "address" + }, + { + "internalType": "address", + "name": "_aaveAddressProvider", + "type": "address" + }, + { "internalType": "address", "name": "_cEther", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "FlashMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "FlashRedeem", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract ILendingPoolAddressesProviderV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LENDING_POOL", + "outputs": [ + { + "internalType": "contract ILendingPoolV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ROUNDING_ERROR_MARGIN", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "addresses", + "outputs": [ + { "internalType": "address", "name": "quickRouter", "type": "address" }, + { "internalType": "address", "name": "sushiRouter", "type": "address" }, + { "internalType": "address", "name": "uniV3Router", "type": "address" }, + { "internalType": "address", "name": "uniV3Quoter", "type": "address" }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract IERC20", "name": "_token", "type": "address" } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "approveTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cEtherAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "compoundLeverageModule", + "outputs": [ + { + "internalType": "contract ICompoundLeverageModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "debtIssuanceModule", + "outputs": [ + { + "internalType": "contract IDebtIssuanceModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "premiums", "type": "uint256[]" }, + { "internalType": "address", "name": "initiator", "type": "address" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "executeOperation", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "getIssueExactSet", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "bool", "name": "_isMint", "type": "bool" } + ], + "name": "getLeveragedTokenData", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "collateralCToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "collateralToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { "internalType": "address", "name": "debtToken", "type": "address" }, + { "internalType": "uint256", "name": "debtAmount", "type": "uint256" } + ], + "internalType": "struct FlashMintLeveragedForCompound.LeveragedTokenData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "getRedeemExactSet", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_maxAmountInputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "issueExactSetFromERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataDebtForCollateral", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataInputToken", + "type": "tuple" + } + ], + "name": "issueExactSetFromETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_minAmountOutputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "redeemExactSetForERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_minAmountOutputToken", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataCollateralForDebt", + "type": "tuple" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "enum DEXAdapter.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapter.SwapData", + "name": "_swapDataOutputToken", + "type": "tuple" + } + ], + "name": "redeemExactSetForETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/FlashMintNav.json b/src/constants/abis/FlashMintNav.json index 2614de9e..a0e68ac0 100644 --- a/src/constants/abis/FlashMintNav.json +++ b/src/constants/abis/FlashMintNav.json @@ -1 +1,516 @@ -[{"inputs":[{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"contract INAVIssuanceModule","name":"_navIssuanceModule","type":"address"},{"components":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"balV2Vault","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"internalType":"struct DEXAdapterV3.Addresses","name":"_dexAddresses","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"}],"name":"FlashMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"FlashRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dexAdapter","outputs":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"balV2Vault","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_inputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_reserveAssetSwapData","type":"tuple"}],"name":"getIssueAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setTokenAmount","type":"uint256"},{"internalType":"address","name":"_outputToken","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_reserveAssetSwapData","type":"tuple"}],"name":"getRedeemAmountOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_minSetTokenAmount","type":"uint256"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_inputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_reserveAssetSwapData","type":"tuple"}],"name":"issueSetFromExactERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_minSetTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_reserveAssetSwapData","type":"tuple"}],"name":"issueSetFromExactETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"navIssuanceModule","outputs":[{"internalType":"contract INAVIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setTokenAmount","type":"uint256"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_minOutputTokenAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_reserveAssetSwapData","type":"tuple"}],"name":"redeemExactSetForERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_setTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_minEthAmount","type":"uint256"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"_reserveAssetSwapData","type":"tuple"}],"name":"redeemExactSetForETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { + "internalType": "contract INAVIssuanceModule", + "name": "_navIssuanceModule", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "quickRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "sushiRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Router", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Quoter", + "type": "address" + }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { + "internalType": "address", + "name": "balV2Vault", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "internalType": "struct DEXAdapterV3.Addresses", + "name": "_dexAddresses", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + } + ], + "name": "FlashMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "FlashRedeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "ETH_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dexAdapter", + "outputs": [ + { "internalType": "address", "name": "quickRouter", "type": "address" }, + { "internalType": "address", "name": "sushiRouter", "type": "address" }, + { "internalType": "address", "name": "uniV3Router", "type": "address" }, + { "internalType": "address", "name": "uniV3Quoter", "type": "address" }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "balV2Vault", "type": "address" }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { + "internalType": "uint256", + "name": "_inputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_reserveAssetSwapData", + "type": "tuple" + } + ], + "name": "getIssueAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_setTokenAmount", + "type": "uint256" + }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_reserveAssetSwapData", + "type": "tuple" + } + ], + "name": "getRedeemAmountOut", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minSetTokenAmount", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_inputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_reserveAssetSwapData", + "type": "tuple" + } + ], + "name": "issueSetFromExactERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minSetTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_reserveAssetSwapData", + "type": "tuple" + } + ], + "name": "issueSetFromExactETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "navIssuanceModule", + "outputs": [ + { + "internalType": "contract INAVIssuanceModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_setTokenAmount", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minOutputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_reserveAssetSwapData", + "type": "tuple" + } + ], + "name": "redeemExactSetForERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_setTokenAmount", + "type": "uint256" + }, + { "internalType": "uint256", "name": "_minEthAmount", "type": "uint256" }, + { + "components": [ + { "internalType": "address[]", "name": "path", "type": "address[]" }, + { "internalType": "uint24[]", "name": "fees", "type": "uint24[]" }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "_reserveAssetSwapData", + "type": "tuple" + } + ], + "name": "redeemExactSetForETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address payable", "name": "_to", "type": "address" } + ], + "name": "withdrawTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/FlashMintWrapped.json b/src/constants/abis/FlashMintWrapped.json index c588211f..3d9c44fc 100644 --- a/src/constants/abis/FlashMintWrapped.json +++ b/src/constants/abis/FlashMintWrapped.json @@ -1 +1,720 @@ -[{"inputs":[{"components":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"balV2Vault","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"internalType":"struct DEXAdapterV3.Addresses","name":"_dexAddresses","type":"tuple"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"contract IDebtIssuanceModule","name":"_issuanceModule","type":"address"},{"internalType":"address","name":"_wrapModule","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"FlashMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"FlashRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dexAdapter","outputs":[{"internalType":"address","name":"quickRouter","type":"address"},{"internalType":"address","name":"sushiRouter","type":"address"},{"internalType":"address","name":"uniV3Router","type":"address"},{"internalType":"address","name":"uniV3Quoter","type":"address"},{"internalType":"address","name":"curveAddressProvider","type":"address"},{"internalType":"address","name":"curveCalculator","type":"address"},{"internalType":"address","name":"balV2Vault","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address","name":"underlyingERC20","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"dexData","type":"tuple"},{"internalType":"uint256","name":"buyUnderlyingAmount","type":"uint256"}],"internalType":"struct FlashMintWrapped.ComponentSwapData[]","name":"_swapData","type":"tuple[]"}],"name":"getIssueExactSet","outputs":[{"internalType":"uint256","name":"amountInputNeeded","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_setAmount","type":"uint256"},{"components":[{"internalType":"address","name":"underlyingERC20","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"dexData","type":"tuple"},{"internalType":"uint256","name":"buyUnderlyingAmount","type":"uint256"}],"internalType":"struct FlashMintWrapped.ComponentSwapData[]","name":"_swapData","type":"tuple[]"}],"name":"getRedeemExactSet","outputs":[{"internalType":"uint256","name":"amountOutputReceived","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"issuanceModule","outputs":[{"internalType":"contract IDebtIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"components":[{"internalType":"address","name":"underlyingERC20","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"dexData","type":"tuple"},{"internalType":"uint256","name":"buyUnderlyingAmount","type":"uint256"}],"internalType":"struct FlashMintWrapped.ComponentSwapData[]","name":"_swapData","type":"tuple[]"},{"components":[{"internalType":"string","name":"integrationName","type":"string"},{"internalType":"bytes","name":"wrapData","type":"bytes"}],"internalType":"struct FlashMintWrapped.ComponentWrapData[]","name":"_wrapData","type":"tuple[]"}],"name":"issueExactSetFromERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"components":[{"internalType":"address","name":"underlyingERC20","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"dexData","type":"tuple"},{"internalType":"uint256","name":"buyUnderlyingAmount","type":"uint256"}],"internalType":"struct FlashMintWrapped.ComponentSwapData[]","name":"_swapData","type":"tuple[]"},{"components":[{"internalType":"string","name":"integrationName","type":"string"},{"internalType":"bytes","name":"wrapData","type":"bytes"}],"internalType":"struct FlashMintWrapped.ComponentWrapData[]","name":"_wrapData","type":"tuple[]"}],"name":"issueExactSetFromETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minOutputReceive","type":"uint256"},{"components":[{"internalType":"address","name":"underlyingERC20","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"dexData","type":"tuple"},{"internalType":"uint256","name":"buyUnderlyingAmount","type":"uint256"}],"internalType":"struct FlashMintWrapped.ComponentSwapData[]","name":"_swapData","type":"tuple[]"},{"components":[{"internalType":"string","name":"integrationName","type":"string"},{"internalType":"bytes","name":"wrapData","type":"bytes"}],"internalType":"struct FlashMintWrapped.ComponentWrapData[]","name":"_unwrapData","type":"tuple[]"}],"name":"redeemExactSetForERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minOutputReceive","type":"uint256"},{"components":[{"internalType":"address","name":"underlyingERC20","type":"address"},{"components":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"fees","type":"uint24[]"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"},{"internalType":"enum DEXAdapterV3.Exchange","name":"exchange","type":"uint8"}],"internalType":"struct DEXAdapterV3.SwapData","name":"dexData","type":"tuple"},{"internalType":"uint256","name":"buyUnderlyingAmount","type":"uint256"}],"internalType":"struct FlashMintWrapped.ComponentSwapData[]","name":"_swapData","type":"tuple[]"},{"components":[{"internalType":"string","name":"integrationName","type":"string"},{"internalType":"bytes","name":"wrapData","type":"bytes"}],"internalType":"struct FlashMintWrapped.ComponentWrapData[]","name":"_unwrapData","type":"tuple[]"}],"name":"redeemExactSetForETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"wrapModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "quickRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "sushiRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Router", + "type": "address" + }, + { + "internalType": "address", + "name": "uniV3Quoter", + "type": "address" + }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { + "internalType": "address", + "name": "balV2Vault", + "type": "address" + }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "internalType": "struct DEXAdapterV3.Addresses", + "name": "_dexAddresses", + "type": "tuple" + }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { + "internalType": "contract IDebtIssuanceModule", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "address", "name": "_wrapModule", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "FlashMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "FlashRedeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dexAdapter", + "outputs": [ + { "internalType": "address", "name": "quickRouter", "type": "address" }, + { "internalType": "address", "name": "sushiRouter", "type": "address" }, + { "internalType": "address", "name": "uniV3Router", "type": "address" }, + { "internalType": "address", "name": "uniV3Quoter", "type": "address" }, + { + "internalType": "address", + "name": "curveAddressProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "curveCalculator", + "type": "address" + }, + { "internalType": "address", "name": "balV2Vault", "type": "address" }, + { "internalType": "address", "name": "weth", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "address", "name": "_inputToken", "type": "address" }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingERC20", + "type": "address" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint24[]", + "name": "fees", + "type": "uint24[]" + }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "dexData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "buyUnderlyingAmount", + "type": "uint256" + } + ], + "internalType": "struct FlashMintWrapped.ComponentSwapData[]", + "name": "_swapData", + "type": "tuple[]" + } + ], + "name": "getIssueExactSet", + "outputs": [ + { + "internalType": "uint256", + "name": "amountInputNeeded", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { "internalType": "address", "name": "_outputToken", "type": "address" }, + { "internalType": "uint256", "name": "_setAmount", "type": "uint256" }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingERC20", + "type": "address" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint24[]", + "name": "fees", + "type": "uint24[]" + }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "dexData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "buyUnderlyingAmount", + "type": "uint256" + } + ], + "internalType": "struct FlashMintWrapped.ComponentSwapData[]", + "name": "_swapData", + "type": "tuple[]" + } + ], + "name": "getRedeemExactSet", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOutputReceived", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "issuanceModule", + "outputs": [ + { + "internalType": "contract IDebtIssuanceModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxAmountInputToken", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingERC20", + "type": "address" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint24[]", + "name": "fees", + "type": "uint24[]" + }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "dexData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "buyUnderlyingAmount", + "type": "uint256" + } + ], + "internalType": "struct FlashMintWrapped.ComponentSwapData[]", + "name": "_swapData", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "integrationName", + "type": "string" + }, + { "internalType": "bytes", "name": "wrapData", "type": "bytes" } + ], + "internalType": "struct FlashMintWrapped.ComponentWrapData[]", + "name": "_wrapData", + "type": "tuple[]" + } + ], + "name": "issueExactSetFromERC20", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingERC20", + "type": "address" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint24[]", + "name": "fees", + "type": "uint24[]" + }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "dexData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "buyUnderlyingAmount", + "type": "uint256" + } + ], + "internalType": "struct FlashMintWrapped.ComponentSwapData[]", + "name": "_swapData", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "integrationName", + "type": "string" + }, + { "internalType": "bytes", "name": "wrapData", "type": "bytes" } + ], + "internalType": "struct FlashMintWrapped.ComponentWrapData[]", + "name": "_wrapData", + "type": "tuple[]" + } + ], + "name": "issueExactSetFromETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOutputReceive", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingERC20", + "type": "address" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint24[]", + "name": "fees", + "type": "uint24[]" + }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "dexData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "buyUnderlyingAmount", + "type": "uint256" + } + ], + "internalType": "struct FlashMintWrapped.ComponentSwapData[]", + "name": "_swapData", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "integrationName", + "type": "string" + }, + { "internalType": "bytes", "name": "wrapData", "type": "bytes" } + ], + "internalType": "struct FlashMintWrapped.ComponentWrapData[]", + "name": "_unwrapData", + "type": "tuple[]" + } + ], + "name": "redeemExactSetForERC20", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOutputReceive", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "underlyingERC20", + "type": "address" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint24[]", + "name": "fees", + "type": "uint24[]" + }, + { "internalType": "address", "name": "pool", "type": "address" }, + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "enum DEXAdapterV3.Exchange", + "name": "exchange", + "type": "uint8" + } + ], + "internalType": "struct DEXAdapterV3.SwapData", + "name": "dexData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "buyUnderlyingAmount", + "type": "uint256" + } + ], + "internalType": "struct FlashMintWrapped.ComponentSwapData[]", + "name": "_swapData", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "string", + "name": "integrationName", + "type": "string" + }, + { "internalType": "bytes", "name": "wrapData", "type": "bytes" } + ], + "internalType": "struct FlashMintWrapped.ComponentWrapData[]", + "name": "_unwrapData", + "type": "tuple[]" + } + ], + "name": "redeemExactSetForETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address payable", "name": "_to", "type": "address" } + ], + "name": "withdrawTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "wrapModule", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/constants/abis/FlashMintZeroEx.json b/src/constants/abis/FlashMintZeroEx.json index bd0b364a..05c20e3a 100644 --- a/src/constants/abis/FlashMintZeroEx.json +++ b/src/constants/abis/FlashMintZeroEx.json @@ -1 +1,425 @@ -[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"address","name":"_swapTarget","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"ExchangeIssue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"ExchangeRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_issuanceModule","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"},{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"}],"name":"getRequiredIssuanceComponents","outputs":[{"internalType":"address[]","name":"components","type":"address[]"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"},{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"}],"name":"getRequiredRedemptionComponents","outputs":[{"internalType":"address[]","name":"components","type":"address[]"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"issueExactSetFromETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"issueExactSetFromToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minEthReceive","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"redeemExactSetForETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minOutputReceive","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"redeemExactSetForToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTarget","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { "internalType": "address", "name": "_weth", "type": "address" }, + { + "internalType": "contract IController", + "name": "_setController", + "type": "address" + }, + { "internalType": "address", "name": "_swapTarget", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountInputToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetIssued", + "type": "uint256" + } + ], + "name": "ExchangeIssue", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountSetRedeemed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutputToken", + "type": "uint256" + } + ], + "name": "ExchangeRedeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "ETH_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + } + ], + "name": "approveSetToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { "internalType": "address", "name": "_spender", "type": "address" } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address", "name": "_spender", "type": "address" } + ], + "name": "approveTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" }, + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + } + ], + "name": "getRequiredIssuanceComponents", + "outputs": [ + { + "internalType": "address[]", + "name": "components", + "type": "address[]" + }, + { "internalType": "uint256[]", "name": "positions", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" }, + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + } + ], + "name": "getRequiredRedemptionComponents", + "outputs": [ + { + "internalType": "address[]", + "name": "components", + "type": "address[]" + }, + { "internalType": "uint256[]", "name": "positions", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "issueExactSetFromETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_inputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxAmountInputToken", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "issueExactSetFromToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minEthReceive", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "redeemExactSetForETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISetToken", + "name": "_setToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountSetToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minOutputReceive", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_componentQuotes", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_issuanceModule", + "type": "address" + }, + { "internalType": "bool", "name": "_isDebtIssuance", "type": "bool" } + ], + "name": "redeemExactSetForToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setController", + "outputs": [ + { "internalType": "contract IController", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "swapTarget", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "_tokens", + "type": "address[]" + }, + { "internalType": "address payable", "name": "_to", "type": "address" } + ], + "name": "withdrawTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/src/flashmint/builders/hyeth.test.ts b/src/flashmint/builders/hyeth.test.ts index 0f85565e..e2ef93d2 100644 --- a/src/flashmint/builders/hyeth.test.ts +++ b/src/flashmint/builders/hyeth.test.ts @@ -4,14 +4,14 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { EthAddress } from 'constants/addresses' import { ChainId } from 'constants/chains' import { Contracts } from 'constants/contracts' +import { getComponentsSwapData } from 'quote/flashmint/hyeth/swap-data' import { getLocalHostProviderUrl, getTestRpcProvider } from 'tests/utils' import { getFlashMintHyEthContract } from 'utils/contracts' import { wei } from 'utils/numbers' import { Exchange } from 'utils/swap-data' -import { getComponentsSwapData } from 'quote/flashmint/hyeth/swap-data' import { - FlashMintHyEthBuildRequest, + type FlashMintHyEthBuildRequest, FlashMintHyEthTransactionBuilder, } from './hyeth' @@ -77,7 +77,7 @@ describe('FlashMintHyEthTransactionBuilder()', () => { buildRequest.inputTokenAmount, buildRequest.swapDataInputTokenToEth, buildRequest.swapDataEthToInputOutputToken, - buildRequest.componentsSwapData + buildRequest.componentsSwapData, ) const builder = new FlashMintHyEthTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -92,7 +92,7 @@ describe('FlashMintHyEthTransactionBuilder()', () => { buildRequest.outputToken, buildRequest.outputTokenAmount, buildRequest.componentsSwapData, - { value: buildRequest.inputTokenAmount } + { value: buildRequest.inputTokenAmount }, ) const builder = new FlashMintHyEthTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -108,7 +108,7 @@ describe('FlashMintHyEthTransactionBuilder()', () => { indexToken.address, 'hyETH', usdc.address, - usdc.symbol + usdc.symbol, ) const refTx = await contract.populateTransaction.redeemExactSetForERC20( buildRequest.inputToken, @@ -116,7 +116,7 @@ describe('FlashMintHyEthTransactionBuilder()', () => { buildRequest.outputToken, buildRequest.outputTokenAmount, buildRequest.swapDataEthToInputOutputToken, - buildRequest.componentsSwapData + buildRequest.componentsSwapData, ) const builder = new FlashMintHyEthTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -131,13 +131,13 @@ describe('FlashMintHyEthTransactionBuilder()', () => { indexToken.address, 'hyETH', eth, - 'ETH' + 'ETH', ) const refTx = await contract.populateTransaction.redeemExactSetForETH( buildRequest.inputToken, buildRequest.inputTokenAmount, buildRequest.outputTokenAmount, - buildRequest.componentsSwapData + buildRequest.componentsSwapData, ) const builder = new FlashMintHyEthTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -152,7 +152,7 @@ function createBuildRequest( inputToken: string = usdc.address, inputTokenSymbol: string = usdc.symbol, outputToken: string = indexToken.address, - outputTokenSymbol: string = indexToken.symbol + outputTokenSymbol: string = indexToken.symbol, ): FlashMintHyEthBuildRequest { const swapDataInputTokenToEth = { exchange: Exchange.UniV3, diff --git a/src/flashmint/builders/hyeth.ts b/src/flashmint/builders/hyeth.ts index 3e0e235f..01f58839 100644 --- a/src/flashmint/builders/hyeth.ts +++ b/src/flashmint/builders/hyeth.ts @@ -1,11 +1,11 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' -import { BigNumber } from '@ethersproject/bignumber' +import type { TransactionRequest } from '@ethersproject/abstract-provider' +import type { BigNumber } from '@ethersproject/bignumber' import { getFlashMintHyEthContract } from 'utils/contracts' import { getRpcProvider } from 'utils/rpc-provider' -import { Exchange, SwapData } from 'utils/swap-data' +import { Exchange, type SwapData } from 'utils/swap-data' -import { TransactionBuilder } from './interface' +import type { TransactionBuilder } from './interface' import { isEmptyString, isInvalidAmount } from './utils' export interface FlashMintHyEthBuildRequest { @@ -27,7 +27,7 @@ export class FlashMintHyEthTransactionBuilder constructor(private readonly rpcUrl: string) {} async build( - request: FlashMintHyEthBuildRequest + request: FlashMintHyEthBuildRequest, ): Promise { if (!this.isValidRequest(request)) return null const provider = getRpcProvider(this.rpcUrl) @@ -52,7 +52,7 @@ export class FlashMintHyEthTransactionBuilder ...componentSwapData, poolIds: [], } - } + }, ) if (isMinting) { if (inputTokenSymbol === 'ETH') { @@ -60,7 +60,7 @@ export class FlashMintHyEthTransactionBuilder indexToken, indexTokenAmount, componentsSwapData, - { value: inputTokenAmount } + { value: inputTokenAmount }, ) } else { const swapDataInputTokenToEth = { @@ -79,7 +79,7 @@ export class FlashMintHyEthTransactionBuilder inputTokenAmount, // _maxInputTokenAmount swapDataInputTokenToEth, swapDataEthToInputOutputToken, - componentsSwapData + componentsSwapData, ) } } else { @@ -88,7 +88,7 @@ export class FlashMintHyEthTransactionBuilder indexToken, indexTokenAmount, outputTokenAmount, // _minETHOut - componentsSwapData + componentsSwapData, ) } else { const swapDataEthToInputOutputToken = { @@ -101,7 +101,7 @@ export class FlashMintHyEthTransactionBuilder outputToken, outputTokenAmount, // _minOutputTokenAmount swapDataEthToInputOutputToken, - componentsSwapData + componentsSwapData, ) } } diff --git a/src/flashmint/builders/leveraged-extended.test.ts b/src/flashmint/builders/leveraged-extended.test.ts index a838b8aa..e93f2e2b 100644 --- a/src/flashmint/builders/leveraged-extended.test.ts +++ b/src/flashmint/builders/leveraged-extended.test.ts @@ -3,18 +3,18 @@ import { BigNumber } from '@ethersproject/bignumber' import { ChainId } from 'constants/chains' import { Contracts } from 'constants/contracts' -import { IndexCoopEthereum2xIndex, USDC, WETH } from 'constants/tokens' import { noopSwapData } from 'constants/swapdata' +import { IndexCoopEthereum2xIndex, USDC, WETH } from 'constants/tokens' import { getLocalHostProviderUrl } from 'tests/utils' +import { Exchange } from 'utils' import { getFlashMintLeveragedContractForToken } from 'utils/contracts' import { wei } from 'utils/numbers' -import { Exchange } from 'utils' +import { getRpcProvider } from 'utils/rpc-provider' import { - FlashMintLeveragedExtendedBuildRequest, + type FlashMintLeveragedExtendedBuildRequest, LeveragedExtendedTransactionBuilder, } from './leveraged-extended' -import { getRpcProvider } from 'utils/rpc-provider' const rpcUrl = getLocalHostProviderUrl(ChainId.Arbitrum) const rpcUrlBase = getLocalHostProviderUrl(ChainId.Base) @@ -33,12 +33,12 @@ describe('LeveragedTransactionBuilder()', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopEthereum2xIndex.symbol, provider, - ChainId.Arbitrum + ChainId.Arbitrum, ) const contractBase = getFlashMintLeveragedContractForToken( IndexCoopEthereum2xIndex.symbol, providerBase, - ChainId.Base + ChainId.Base, ) beforeEach((): void => { @@ -154,7 +154,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.inputToken, buildRequest.inputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataInputOutputToken + buildRequest.swapDataInputOutputToken, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -171,7 +171,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.outputTokenAmount, buildRequest.swapDataDebtCollateral, buildRequest.swapDataInputOutputToken, - { value: buildRequest.inputTokenAmount } + { value: buildRequest.inputTokenAmount }, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -187,7 +187,7 @@ describe('LeveragedTransactionBuilder()', () => { IndexCoopEthereum2xIndex.addressArbitrum!, IndexCoopEthereum2xIndex.symbol, usdcAddress, - 'USDC' + 'USDC', ) const refTx = await contract.populateTransaction.redeemExactSetForERC20( buildRequest.inputToken, @@ -195,7 +195,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.outputToken, buildRequest.outputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataInputOutputToken + buildRequest.swapDataInputOutputToken, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -210,14 +210,14 @@ describe('LeveragedTransactionBuilder()', () => { IndexCoopEthereum2xIndex.addressArbitrum!, IndexCoopEthereum2xIndex.symbol, eth, - 'ETH' + 'ETH', ) const refTx = await contract.populateTransaction.redeemExactSetForETH( buildRequest.inputToken, buildRequest.inputTokenAmount, buildRequest.outputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataInputOutputToken + buildRequest.swapDataInputOutputToken, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -232,7 +232,7 @@ describe('LeveragedTransactionBuilder()', () => { eth, 'ETH', IndexCoopEthereum2xIndex.addressBase!, - IndexCoopEthereum2xIndex.symbol + IndexCoopEthereum2xIndex.symbol, ) const indexToken = buildRequest.outputToken const refTx = await contractBase.populateTransaction.issueExactSetFromETH( @@ -240,7 +240,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.outputTokenAmount, buildRequest.swapDataDebtCollateral, buildRequest.swapDataInputOutputToken, - { value: buildRequest.inputTokenAmount } + { value: buildRequest.inputTokenAmount }, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrlBase) const tx = await builder.build(buildRequest) @@ -256,7 +256,7 @@ describe('LeveragedTransactionBuilder()', () => { IndexCoopEthereum2xIndex.addressBase!, IndexCoopEthereum2xIndex.symbol, usdcAddress, - 'USDC' + 'USDC', ) const refTx = await contractBase.populateTransaction.redeemExactSetForERC20( buildRequest.inputToken, @@ -264,7 +264,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.outputToken, buildRequest.outputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataInputOutputToken + buildRequest.swapDataInputOutputToken, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrlBase) const tx = await builder.build(buildRequest) @@ -279,14 +279,14 @@ describe('LeveragedTransactionBuilder()', () => { IndexCoopEthereum2xIndex.addressBase!, IndexCoopEthereum2xIndex.symbol, eth, - 'ETH' + 'ETH', ) const refTx = await contractBase.populateTransaction.redeemExactSetForETH( buildRequest.inputToken, buildRequest.inputTokenAmount, buildRequest.outputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataInputOutputToken + buildRequest.swapDataInputOutputToken, ) const builder = new LeveragedExtendedTransactionBuilder(rpcUrlBase) const tx = await builder.build(buildRequest) @@ -301,7 +301,7 @@ function createBuildRequest( inputToken: string = usdcAddress, inputTokenSymbol = 'USDC', outputToken: string = IndexCoopEthereum2xIndex.addressArbitrum!, - outputTokenSymbol: string = IndexCoopEthereum2xIndex.symbol + outputTokenSymbol: string = IndexCoopEthereum2xIndex.symbol, ): FlashMintLeveragedExtendedBuildRequest { const collateralDebtSwapData = { exchange: Exchange.UniV3, diff --git a/src/flashmint/builders/leveraged-extended.ts b/src/flashmint/builders/leveraged-extended.ts index b66ef38d..a3c954b6 100644 --- a/src/flashmint/builders/leveraged-extended.ts +++ b/src/flashmint/builders/leveraged-extended.ts @@ -1,11 +1,11 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' -import { BigNumber } from '@ethersproject/bignumber' +import type { TransactionRequest } from '@ethersproject/abstract-provider' +import type { BigNumber } from '@ethersproject/bignumber' +import { Exchange, type SwapData } from 'utils' import { getFlashMintLeveragedContractForToken } from 'utils/contracts' import { getRpcProvider } from 'utils/rpc-provider' -import { Exchange, SwapData } from 'utils' -import { TransactionBuilder } from './interface' +import type { TransactionBuilder } from './interface' import { isEmptyString, isInvalidAmount } from './utils' export interface FlashMintLeveragedExtendedBuildRequest { @@ -33,7 +33,7 @@ export class LeveragedExtendedTransactionBuilder constructor(private readonly rpcUrl: string) {} async build( - request: FlashMintLeveragedExtendedBuildRequest + request: FlashMintLeveragedExtendedBuildRequest, ): Promise { const isValidRequest = this.isValidRequest(request) if (!isValidRequest) return null @@ -58,7 +58,7 @@ export class LeveragedExtendedTransactionBuilder const contract = getFlashMintLeveragedContractForToken( indexTokenSymbol, provider, - chainId + chainId, ) if (isMinting) { const isInputTokenEth = inputTokenSymbol === 'ETH' @@ -68,7 +68,7 @@ export class LeveragedExtendedTransactionBuilder outputTokenAmount, swapDataDebtCollateral, swapDataInputOutputToken, - { value: inputTokenAmount } + { value: inputTokenAmount }, ) } else { return await contract.populateTransaction.issueExactSetFromERC20( @@ -77,7 +77,7 @@ export class LeveragedExtendedTransactionBuilder inputToken, inputTokenAmount, // _maxAmountInputToken swapDataDebtCollateral, - swapDataInputOutputToken + swapDataInputOutputToken, ) } } else { @@ -88,7 +88,7 @@ export class LeveragedExtendedTransactionBuilder inputTokenAmount, outputTokenAmount, // _minAmountOutputToken swapDataDebtCollateral, - swapDataInputOutputToken // _swapDataOutputToken + swapDataInputOutputToken, // _swapDataOutputToken ) } else { return await contract.populateTransaction.redeemExactSetForERC20( @@ -97,7 +97,7 @@ export class LeveragedExtendedTransactionBuilder outputToken, outputTokenAmount, // _minAmountOutputToken swapDataDebtCollateral, - swapDataInputOutputToken // _swapDataOutputToken + swapDataInputOutputToken, // _swapDataOutputToken ) } } @@ -119,7 +119,7 @@ export class LeveragedExtendedTransactionBuilder } private isValidRequest( - request: FlashMintLeveragedExtendedBuildRequest + request: FlashMintLeveragedExtendedBuildRequest, ): boolean { const { inputToken, diff --git a/src/flashmint/builders/leveraged.test.ts b/src/flashmint/builders/leveraged.test.ts index aac0d746..479a0183 100644 --- a/src/flashmint/builders/leveraged.test.ts +++ b/src/flashmint/builders/leveraged.test.ts @@ -1,5 +1,6 @@ import { BigNumber } from '@ethersproject/bignumber' +import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ExchangeIssuanceLeveragedMainnetAddress } from 'constants/contracts' import { collateralDebtSwapData, @@ -11,10 +12,9 @@ import { getLocalHostProviderUrl, getTestRpcProvider } from 'tests/utils' import { getFlashMintLeveragedContractForToken } from 'utils/contracts' import { wei } from 'utils/numbers' import { - FlashMintLeveragedBuildRequest, + type FlashMintLeveragedBuildRequest, LeveragedTransactionBuilder, } from './leveraged' -import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' const chainId = 1 const eth = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' @@ -25,7 +25,7 @@ describe('LeveragedTransactionBuilder()', () => { const contract = getFlashMintLeveragedContractForToken( indexToken.symbol, getTestRpcProvider(chainId), - chainId + chainId, ) const rpcUrl = getLocalHostProviderUrl(chainId) @@ -135,7 +135,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.inputOutputToken, buildRequest.inputOutputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataPaymentToken + buildRequest.swapDataPaymentToken, ) const builder = new LeveragedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -151,7 +151,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.indexTokenAmount, buildRequest.swapDataDebtCollateral, buildRequest.swapDataPaymentToken, - { value: buildRequest.inputOutputTokenAmount } + { value: buildRequest.inputOutputTokenAmount }, ) const builder = new LeveragedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -169,7 +169,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.inputOutputToken, buildRequest.inputOutputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataPaymentToken + buildRequest.swapDataPaymentToken, ) const builder = new LeveragedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -185,7 +185,7 @@ describe('LeveragedTransactionBuilder()', () => { buildRequest.indexTokenAmount, buildRequest.inputOutputTokenAmount, buildRequest.swapDataDebtCollateral, - buildRequest.swapDataPaymentToken + buildRequest.swapDataPaymentToken, ) const builder = new LeveragedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -198,7 +198,7 @@ describe('LeveragedTransactionBuilder()', () => { function createBuildRequest( isMinting = true, inputOutputToken: string = usdcAddress, - inputOutputTokenSymbol = 'USDC' + inputOutputTokenSymbol = 'USDC', ): FlashMintLeveragedBuildRequest { return { isMinting, @@ -212,7 +212,7 @@ function createBuildRequest( ? collateralDebtSwapData[indexToken.symbol] : debtCollateralSwapData[indexToken.symbol], swapDataPaymentToken: isMinting - ? inputSwapData[indexToken.symbol]['ETH'] - : outputSwapData[indexToken.symbol]['ETH'], + ? inputSwapData[indexToken.symbol].ETH + : outputSwapData[indexToken.symbol].ETH, } } diff --git a/src/flashmint/builders/leveraged.ts b/src/flashmint/builders/leveraged.ts index b08edb2e..fa852ad7 100644 --- a/src/flashmint/builders/leveraged.ts +++ b/src/flashmint/builders/leveraged.ts @@ -1,11 +1,11 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' -import { BigNumber } from '@ethersproject/bignumber' +import type { TransactionRequest } from '@ethersproject/abstract-provider' +import type { BigNumber } from '@ethersproject/bignumber' +import { Exchange, type SwapData } from 'utils' import { getFlashMintLeveragedContractForToken } from 'utils/contracts' import { getRpcProvider } from 'utils/rpc-provider' -import { Exchange, SwapData } from 'utils' -import { TransactionBuilder } from './interface' +import type { TransactionBuilder } from './interface' import { isEmptyString, isInvalidAmount } from './utils' export interface FlashMintLeveragedBuildRequest { @@ -27,7 +27,7 @@ export class LeveragedTransactionBuilder constructor(private readonly rpcUrl: string) {} async build( - request: FlashMintLeveragedBuildRequest + request: FlashMintLeveragedBuildRequest, ): Promise { const isValidRequest = this.isValidRequest(request) if (!isValidRequest) return null @@ -49,7 +49,7 @@ export class LeveragedTransactionBuilder const contract = getFlashMintLeveragedContractForToken( indexTokenSymbol, provider, - chainId + chainId, ) if (isMinting) { if (inputOutputTokenIsEth) { @@ -58,7 +58,7 @@ export class LeveragedTransactionBuilder indexTokenAmount, swapDataDebtCollateral, swapDataPaymentToken, - { value: inputOutputTokenAmount } + { value: inputOutputTokenAmount }, ) } else { return await contract.populateTransaction.issueExactSetFromERC20( @@ -67,7 +67,7 @@ export class LeveragedTransactionBuilder inputOutputToken, inputOutputTokenAmount, // _maxAmountInputToken swapDataDebtCollateral, - swapDataPaymentToken + swapDataPaymentToken, ) } } else { @@ -77,7 +77,7 @@ export class LeveragedTransactionBuilder indexTokenAmount, inputOutputTokenAmount, // _minAmountOutputToken swapDataDebtCollateral, - swapDataPaymentToken + swapDataPaymentToken, ) } else { return await contract.populateTransaction.redeemExactSetForERC20( @@ -86,7 +86,7 @@ export class LeveragedTransactionBuilder inputOutputToken, inputOutputTokenAmount, // _minAmountOutputToken swapDataDebtCollateral, - swapDataPaymentToken + swapDataPaymentToken, ) } } diff --git a/src/flashmint/builders/nav.test.ts b/src/flashmint/builders/nav.test.ts index 7ce55ca6..983b7db7 100644 --- a/src/flashmint/builders/nav.test.ts +++ b/src/flashmint/builders/nav.test.ts @@ -10,13 +10,13 @@ import { WETH, } from 'constants/tokens' import { - FlashMintNavBuildRequest, + type FlashMintNavBuildRequest, FlashMintNavTransactionBuilder, } from 'flashmint/builders/nav' import { getLocalHostProviderUrl, getTestRpcProvider } from 'tests/utils' +import { Exchange } from 'utils' import { getFlashMintNavContract } from 'utils/contracts' import { wei } from 'utils/numbers' -import { Exchange } from 'utils' const chainId = ChainId.Mainnet const provider = getTestRpcProvider(chainId) @@ -143,7 +143,7 @@ describe('FlashMintNavTransactionBuilder()', () => { buildRequest.outputTokenAmount, buildRequest.inputToken, buildRequest.inputTokenAmount, - buildRequest.reserveAssetSwapData + buildRequest.reserveAssetSwapData, ) const builder = new FlashMintNavTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -159,7 +159,7 @@ describe('FlashMintNavTransactionBuilder()', () => { indexToken, buildRequest.outputTokenAmount, buildRequest.reserveAssetSwapData, - { value: buildRequest.inputTokenAmount } + { value: buildRequest.inputTokenAmount }, ) const builder = new FlashMintNavTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -175,14 +175,14 @@ describe('FlashMintNavTransactionBuilder()', () => { TheUSDCYieldIndex.address!, TheUSDCYieldIndex.symbol, usdcAddress, - 'USDC' + 'USDC', ) const refTx = await contract.populateTransaction.redeemExactSetForERC20( buildRequest.inputToken, buildRequest.inputTokenAmount, buildRequest.outputToken, buildRequest.outputTokenAmount, - buildRequest.reserveAssetSwapData + buildRequest.reserveAssetSwapData, ) const builder = new FlashMintNavTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -197,13 +197,13 @@ describe('FlashMintNavTransactionBuilder()', () => { TheUSDCYieldIndex.address!, TheUSDCYieldIndex.symbol, eth, - 'ETH' + 'ETH', ) const refTx = await contract.populateTransaction.redeemExactSetForETH( buildRequest.inputToken, buildRequest.inputTokenAmount, buildRequest.outputTokenAmount, - buildRequest.reserveAssetSwapData + buildRequest.reserveAssetSwapData, ) const builder = new FlashMintNavTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -218,7 +218,7 @@ function createBuildRequest( inputToken: string = usdcAddress, inputTokenSymbol = 'USDC', outputToken: string = HighYieldETHIndex.address!, - outputTokenSymbol: string = HighYieldETHIndex.symbol + outputTokenSymbol: string = HighYieldETHIndex.symbol, ): FlashMintNavBuildRequest { const inputSwapData = { exchange: Exchange.UniV3, diff --git a/src/flashmint/builders/nav.ts b/src/flashmint/builders/nav.ts index d40c4863..34486b77 100644 --- a/src/flashmint/builders/nav.ts +++ b/src/flashmint/builders/nav.ts @@ -1,11 +1,11 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' -import { BigNumber } from '@ethersproject/bignumber' +import type { TransactionRequest } from '@ethersproject/abstract-provider' +import type { BigNumber } from '@ethersproject/bignumber' import { getRpcProvider } from 'utils/rpc-provider' -import { Exchange, SwapDataV3 } from 'utils/swap-data' +import { Exchange, type SwapDataV3 } from 'utils/swap-data' import { getFlashMintNavContract } from '../../utils/contracts' -import { TransactionBuilder } from './interface' +import type { TransactionBuilder } from './interface' import { isEmptyString, isInvalidAmount } from './utils' export interface FlashMintNavBuildRequest { @@ -25,7 +25,7 @@ export class FlashMintNavTransactionBuilder constructor(private readonly rpcUrl: string) {} async build( - request: FlashMintNavBuildRequest + request: FlashMintNavBuildRequest, ): Promise { if (!this.isValidRequest(request)) return null const provider = getRpcProvider(this.rpcUrl) @@ -48,7 +48,7 @@ export class FlashMintNavTransactionBuilder outputToken, indexTokenAmount, // _minSetTokenAmount reserveAssetSwapData, - { value: inputTokenAmount } + { value: inputTokenAmount }, ) } else { return await contract.populateTransaction.issueSetFromExactERC20( @@ -56,7 +56,7 @@ export class FlashMintNavTransactionBuilder indexTokenAmount, // _minSetTokenAmount inputToken, inputTokenAmount, // _maxAmountInputToken - reserveAssetSwapData + reserveAssetSwapData, ) } } else { @@ -66,7 +66,7 @@ export class FlashMintNavTransactionBuilder inputToken, indexTokenAmount, outputTokenAmount, // _minEthAmount - reserveAssetSwapData + reserveAssetSwapData, ) } else { return await contract.populateTransaction.redeemExactSetForERC20( @@ -74,7 +74,7 @@ export class FlashMintNavTransactionBuilder indexTokenAmount, outputToken, outputTokenAmount, // _minOutputTokenAmount - reserveAssetSwapData + reserveAssetSwapData, ) } } diff --git a/src/flashmint/builders/utils.ts b/src/flashmint/builders/utils.ts index daeaa030..e2f35a4c 100644 --- a/src/flashmint/builders/utils.ts +++ b/src/flashmint/builders/utils.ts @@ -1,7 +1,7 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' export function isEmptyString(data: string): boolean { - return typeof data === 'string' && data.trim().length == 0 + return typeof data === 'string' && data.trim().length === 0 } export function isInvalidAmount(amount: BigNumber): boolean { diff --git a/src/flashmint/builders/wrapped.test.ts b/src/flashmint/builders/wrapped.test.ts index b8048d8f..c7753a45 100644 --- a/src/flashmint/builders/wrapped.test.ts +++ b/src/flashmint/builders/wrapped.test.ts @@ -6,13 +6,13 @@ import { getLocalHostProviderUrl } from 'tests/utils' import { getFlashMintWrappedContract } from 'utils/contracts' import { wei } from 'utils/numbers' import { getRpcProvider } from 'utils/rpc-provider' -import { ComponentWrapData } from 'utils/wrap-data' +import type { ComponentWrapData } from 'utils/wrap-data' +import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { - FlashMintWrappedBuildRequest, + type FlashMintWrappedBuildRequest, WrappedTransactionBuilder, } from './wrapped' -import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' const chainId = ChainId.Base const rpcUrl = getLocalHostProviderUrl(chainId) @@ -90,7 +90,7 @@ describe('WrappedTransactionBuilder()', () => { buildRequest.indexTokenAmount, buildRequest.inputOutputTokenAmount, buildRequest.componentSwapData, - buildRequest.componentWrapData + buildRequest.componentWrapData, ) const builder = new WrappedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -108,7 +108,7 @@ describe('WrappedTransactionBuilder()', () => { buildRequest.indexTokenAmount, buildRequest.componentSwapData, buildRequest.componentWrapData, - { value: buildRequest.inputOutputTokenAmount } + { value: buildRequest.inputOutputTokenAmount }, ) const builder = new WrappedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -128,7 +128,7 @@ describe('WrappedTransactionBuilder()', () => { buildRequest.indexTokenAmount, buildRequest.inputOutputTokenAmount, buildRequest.componentSwapData, - buildRequest.componentWrapData + buildRequest.componentWrapData, ) const builder = new WrappedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -146,7 +146,7 @@ describe('WrappedTransactionBuilder()', () => { buildRequest.indexTokenAmount, buildRequest.inputOutputTokenAmount, buildRequest.componentSwapData, - buildRequest.componentWrapData + buildRequest.componentWrapData, ) const builder = new WrappedTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -159,7 +159,7 @@ describe('WrappedTransactionBuilder()', () => { function getDefaultBuildRequest( isMinting = true, inputOutputToken: string = usdcAddress, - inputOutputTokenSymbol = 'USDC' + inputOutputTokenSymbol = 'USDC', ): FlashMintWrappedBuildRequest { const wrapData: ComponentWrapData = { integrationName: '', diff --git a/src/flashmint/builders/wrapped.ts b/src/flashmint/builders/wrapped.ts index 909fdbc9..3bae250e 100644 --- a/src/flashmint/builders/wrapped.ts +++ b/src/flashmint/builders/wrapped.ts @@ -1,13 +1,13 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' -import { BigNumber } from '@ethersproject/bignumber' -import { PopulatedTransaction } from '@ethersproject/contracts' +import type { TransactionRequest } from '@ethersproject/abstract-provider' +import type { BigNumber } from '@ethersproject/bignumber' +import type { PopulatedTransaction } from '@ethersproject/contracts' -import { ComponentSwapData } from 'utils/component-swap-data' +import type { ComponentSwapData } from 'utils/component-swap-data' import { getFlashMintWrappedContract } from 'utils/contracts' import { getRpcProvider } from 'utils/rpc-provider' -import { ComponentWrapData } from 'utils/wrap-data' +import type { ComponentWrapData } from 'utils/wrap-data' -import { TransactionBuilder } from './interface' +import type { TransactionBuilder } from './interface' import { isEmptyString, isInvalidAmount } from './utils' export interface FlashMintWrappedBuildRequest { @@ -29,7 +29,7 @@ export class WrappedTransactionBuilder constructor(private readonly rpcUrl: string) {} async build( - request: FlashMintWrappedBuildRequest + request: FlashMintWrappedBuildRequest, ): Promise { const isValidRequest = this.isValidRequest(request) if (!isValidRequest) return null @@ -55,7 +55,7 @@ export class WrappedTransactionBuilder indexTokenAmount, componentSwapData, componentWrapData, - { value: inputOutputTokenAmount } + { value: inputOutputTokenAmount }, ) } else { tx = await contract.populateTransaction.issueExactSetFromERC20( @@ -64,7 +64,7 @@ export class WrappedTransactionBuilder indexTokenAmount, inputOutputTokenAmount, // _maxAmountInputToken componentSwapData, - componentWrapData + componentWrapData, ) } } else { @@ -74,7 +74,7 @@ export class WrappedTransactionBuilder indexTokenAmount, inputOutputTokenAmount, // _minOutputReceive componentSwapData, - componentWrapData + componentWrapData, ) } else { tx = await contract.populateTransaction.redeemExactSetForERC20( @@ -83,7 +83,7 @@ export class WrappedTransactionBuilder indexTokenAmount, inputOutputTokenAmount, // _minOutputReceive componentSwapData, - componentWrapData + componentWrapData, ) } } diff --git a/src/flashmint/builders/zeroex.test.ts b/src/flashmint/builders/zeroex.test.ts index 441f1391..eb047c38 100644 --- a/src/flashmint/builders/zeroex.test.ts +++ b/src/flashmint/builders/zeroex.test.ts @@ -1,12 +1,15 @@ import { BigNumber } from '@ethersproject/bignumber' +import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { FlashMintZeroExMainnetAddress } from 'constants/contracts' import { getLocalHostProviderUrl, getTestRpcProvider } from 'tests/utils' import { getFlashMintZeroExContractForToken } from 'utils/contracts' import { getIssuanceModule } from 'utils/issuanceModules' import { wei } from 'utils/numbers' -import { FlashMintZeroExBuildRequest, ZeroExTransactionBuilder } from './zeroex' -import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' +import { + type FlashMintZeroExBuildRequest, + ZeroExTransactionBuilder, +} from './zeroex' const chainId = 1 const eth = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' @@ -17,7 +20,7 @@ describe('ZeroExTransactionBuilder()', () => { const contract = getFlashMintZeroExContractForToken( indexToken.symbol, getTestRpcProvider(chainId), - chainId + chainId, ) const issuanceModule = getIssuanceModule(indexToken.symbol, chainId) const rpcUrl = getLocalHostProviderUrl(chainId) @@ -71,7 +74,7 @@ describe('ZeroExTransactionBuilder()', () => { buildRequest.inputOutputTokenAmount, buildRequest.componentQuotes, issuanceModule.address, - issuanceModule.isDebtIssuance + issuanceModule.isDebtIssuance, ) const builder = new ZeroExTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -88,7 +91,7 @@ describe('ZeroExTransactionBuilder()', () => { buildRequest.componentQuotes, issuanceModule.address, issuanceModule.isDebtIssuance, - { value: buildRequest.inputOutputTokenAmount } + { value: buildRequest.inputOutputTokenAmount }, ) const builder = new ZeroExTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -107,7 +110,7 @@ describe('ZeroExTransactionBuilder()', () => { buildRequest.inputOutputTokenAmount, buildRequest.componentQuotes, issuanceModule.address, - issuanceModule.isDebtIssuance + issuanceModule.isDebtIssuance, ) const builder = new ZeroExTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -124,7 +127,7 @@ describe('ZeroExTransactionBuilder()', () => { buildRequest.inputOutputTokenAmount, buildRequest.componentQuotes, issuanceModule.address, - issuanceModule.isDebtIssuance + issuanceModule.isDebtIssuance, ) const builder = new ZeroExTransactionBuilder(rpcUrl) const tx = await builder.build(buildRequest) @@ -137,7 +140,7 @@ describe('ZeroExTransactionBuilder()', () => { function createBuildRequest( isMinting = true, inputOutputToken: string = usdcAddress, - inputOutputTokenSymbol = 'USDC' + inputOutputTokenSymbol = 'USDC', ): FlashMintZeroExBuildRequest { return { isMinting, diff --git a/src/flashmint/builders/zeroex.ts b/src/flashmint/builders/zeroex.ts index 695cf105..5d655173 100644 --- a/src/flashmint/builders/zeroex.ts +++ b/src/flashmint/builders/zeroex.ts @@ -1,11 +1,11 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' -import { BigNumber } from '@ethersproject/bignumber' +import type { TransactionRequest } from '@ethersproject/abstract-provider' +import type { BigNumber } from '@ethersproject/bignumber' import { getRpcProvider } from 'utils/rpc-provider' import { getFlashMintZeroExContractForToken } from '../../utils/contracts' import { getIssuanceModule } from '../../utils/issuanceModules' -import { TransactionBuilder } from './interface' +import type { TransactionBuilder } from './interface' import { isEmptyString, isInvalidAmount } from './utils' export interface FlashMintZeroExBuildRequest { @@ -20,13 +20,12 @@ export interface FlashMintZeroExBuildRequest { } export class ZeroExTransactionBuilder - implements - TransactionBuilder + implements TransactionBuilder { constructor(private readonly rpcUrl: string) {} async build( - request: FlashMintZeroExBuildRequest + request: FlashMintZeroExBuildRequest, ): Promise { const isValidRequest = this.isValidRequest(request) if (!isValidRequest) return null @@ -48,7 +47,7 @@ export class ZeroExTransactionBuilder const contract = getFlashMintZeroExContractForToken( indexTokenSymbol, provider, - chainId + chainId, ) if (isMinting) { if (inputOutputTokenIsEth) { @@ -58,7 +57,7 @@ export class ZeroExTransactionBuilder componentQuotes, issuanceModule.address, issuanceModule.isDebtIssuance, - { value: inputOutputTokenAmount } + { value: inputOutputTokenAmount }, ) } else { return await contract.populateTransaction.issueExactSetFromToken( @@ -68,7 +67,7 @@ export class ZeroExTransactionBuilder inputOutputTokenAmount, // _maxAmountInputToken componentQuotes, issuanceModule.address, - issuanceModule.isDebtIssuance + issuanceModule.isDebtIssuance, ) } } else { @@ -79,7 +78,7 @@ export class ZeroExTransactionBuilder inputOutputTokenAmount, // _minEthReceive componentQuotes, issuanceModule.address, - issuanceModule.isDebtIssuance + issuanceModule.isDebtIssuance, ) } else { return await contract.populateTransaction.redeemExactSetForToken( @@ -89,7 +88,7 @@ export class ZeroExTransactionBuilder inputOutputTokenAmount, // _minOutputReceive componentQuotes, issuanceModule.address, - issuanceModule.isDebtIssuance + issuanceModule.isDebtIssuance, ) } } diff --git a/src/quote/flashmint/hyeth/component-quotes/Vault.json b/src/quote/flashmint/hyeth/component-quotes/Vault.json index bd320eb1..e0468dec 100644 --- a/src/quote/flashmint/hyeth/component-quotes/Vault.json +++ b/src/quote/flashmint/hyeth/component-quotes/Vault.json @@ -1,1732 +1,1732 @@ [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "status", - "type": "uint8" - } - ], - "name": "LogChangeStatus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "stEthAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "requestId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "protocolId", - "type": "uint256" - } - ], - "name": "LogClaimEthWithdrawal", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fromNFTId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ethClaimed", - "type": "uint256" - } - ], - "name": "LogClaimSteth", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fromNFTId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ethClaimed", - "type": "uint256" - } - ], - "name": "LogClaimStethAndPaybackFluid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "LogCollectRevenue", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ethAmount", - "type": "uint256" - } - ], - "name": "LogEthSweep", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "protocol", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - } - ], - "name": "LogFillVaultAvailability", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "iTokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "route", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "deleverageWethAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawStETHAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "userNetDeposit", - "type": "uint256" - } - ], - "name": "LogImportV1ETHVault", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "protocol", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "route", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wstETHflashAmt", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ethAmountBorrow", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "vaults", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "vaultAmts", - "type": "uint256[]" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "swapMode", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "unitAmt", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "vaultSwapAmt", - "type": "uint256" - } - ], - "name": "LogLeverage", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "fromProtocolId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "route", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wETHBorrowAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawStethAmount", - "type": "uint256" - } - ], - "name": "LogQueueSteth", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "protocolFrom", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "uint8", - "name": "protocolTo", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "route", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wstETHflashAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wETHBorrowAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - } - ], - "name": "LogRefinance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "oldAggrMaxVaultRatio", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "aggrMaxVaultRatio", - "type": "uint256" - } - ], - "name": "LogUpdateAggrMaxVaultRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "exchangePriceBefore", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "exchangePriceAfter", - "type": "uint256" - } - ], - "name": "LogUpdateExchangePrice", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "revenueFeePercentage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "withdrawalFeePercentage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "withdrawFeeAbsoluteMin", - "type": "uint256" - } - ], - "name": "LogUpdateFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "oldLimit", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "newLimit", - "type": "uint256" - } - ], - "name": "LogUpdateLeverageMaxUnitAmountLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "protocolId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newRiskRatio", - "type": "uint256" - } - ], - "name": "LogUpdateMaxRiskRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "rebalancer", - "type": "address" - }, - { - "indexed": true, - "internalType": "bool", - "name": "isRebalancer", - "type": "bool" - } - ], - "name": "LogUpdateRebalancer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldSecondaryAuth", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "secondaryAuth", - "type": "address" - } - ], - "name": "LogUpdateSecondaryAuth", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldTreasury", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "LogUpdateTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "protocol", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "depositAmount", - "type": "uint256" - } - ], - "name": "LogVaultToProtocolDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "protocolId", - "type": "uint256" - } - ], - "name": "LogWethPayback", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "wethAmount", - "type": "uint256" - } - ], - "name": "LogWethSweep", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "payer", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "LogWithdrawFeeCollected", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [ - { "internalType": "address", "name": "auth_", "type": "address" } - ], - "name": "addDSAAuth", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "aggrMaxVaultRatio", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "asset", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "underlying_", "type": "address" } - ], - "name": "borrowBalanceMorphoAaveV3", - "outputs": [ - { "internalType": "uint256", "name": "totalBalance_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint8", "name": "status_", "type": "uint8" }], - "name": "changeVaultStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "requestId_", "type": "uint256" }, - { "internalType": "uint8", "name": "toProtocolId_", "type": "uint8" } - ], - "name": "claimEthWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "fromNftID_", "type": "uint256" } - ], - "name": "claimSteth", - "outputs": [ - { "internalType": "uint256", "name": "claimed_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "fromNftID_", "type": "uint256" } - ], - "name": "claimStethAndPaybackFluid", - "outputs": [ - { "internalType": "uint256", "name": "ethClaimed_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "underlying_", "type": "address" } - ], - "name": "collateralBalanceMorphoAaveV3", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralBalance_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amount_", "type": "uint256" } - ], - "name": "collectRevenue", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "convertToAssets", - "outputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" } - ], - "name": "convertToShares", - "outputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets_", "type": "uint256" }, - { "internalType": "address", "name": "receiver_", "type": "address" } - ], - "name": "deposit", - "outputs": [ - { "internalType": "uint256", "name": "shares_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "exchangePrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "protocolId_", "type": "uint8" }, - { - "internalType": "uint256", - "name": "withdrawAmount_", - "type": "uint256" - } - ], - "name": "fillVaultAvailability", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getNetAssets", - "outputs": [ - { "internalType": "uint256", "name": "totalAssets_", "type": "uint256" }, - { "internalType": "uint256", "name": "totalDebt_", "type": "uint256" }, - { "internalType": "uint256", "name": "netAssets_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "aggregatedRatio_", - "type": "uint256" - }, - { - "components": [ - { - "components": [ - { "internalType": "uint256", "name": "stETH", "type": "uint256" }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInStETH", - "name": "aaveV2", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInWstETH", - "name": "aaveV3", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInWstETH", - "name": "compoundV3", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInWstETH", - "name": "euler", - "type": "tuple" - }, - { - "components": [ - { "internalType": "uint256", "name": "stETH", "type": "uint256" }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInStETH", - "name": "morphoAaveV2", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInWstETH", - "name": "morphoAaveV3", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInWstETH", - "name": "spark", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.ProtocolAssetsInWstETH", - "name": "fluid", - "type": "tuple" - }, - { - "components": [ - { "internalType": "uint256", "name": "stETH", "type": "uint256" }, - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.IdealBalances", - "name": "vaultBalances", - "type": "tuple" - }, - { - "components": [ - { "internalType": "uint256", "name": "stETH", "type": "uint256" }, - { - "internalType": "uint256", - "name": "wstETH", - "type": "uint256" - }, - { "internalType": "uint256", "name": "wETH", "type": "uint256" } - ], - "internalType": "struct IViewModule.IdealBalances", - "name": "dsaBalances", - "type": "tuple" - } - ], - "internalType": "struct IViewModule.NetAssetsHelper", - "name": "assets_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "protocolId_", "type": "uint8" } - ], - "name": "getProtocolRatio", - "outputs": [ - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRatioAaveV2", - "outputs": [ - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stEthPerWsteth_", - "type": "uint256" - } - ], - "name": "getRatioAaveV3", - "outputs": [ - { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stEthPerWsteth_", - "type": "uint256" - } - ], - "name": "getRatioCompoundV3", - "outputs": [ - { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stEthPerWsteth_", - "type": "uint256" - } - ], - "name": "getRatioEuler", - "outputs": [ - { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stEthPerWsteth_", - "type": "uint256" - } - ], - "name": "getRatioFluid", - "outputs": [ - { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRatioMorphoAaveV2", - "outputs": [ - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "stEthAmountPool_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stEthAmountP2P_", - "type": "uint256" - }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "ethAmountPool_", - "type": "uint256" - }, - { "internalType": "uint256", "name": "ethAmountP2P_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stEthPerWsteth_", - "type": "uint256" - } - ], - "name": "getRatioMorphoAaveV3", - "outputs": [ - { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stEthPerWsteth_", - "type": "uint256" - } - ], - "name": "getRatioSpark", - "outputs": [ - { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, - { "internalType": "uint256", "name": "ratio_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "stETHAmount_", "type": "uint256" } - ], - "name": "getWithdrawFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "route_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "deleverageWETHAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawStETHAmount_", - "type": "uint256" - }, - { "internalType": "address", "name": "receiver_", "type": "address" } - ], - "name": "importPosition", - "outputs": [ - { "internalType": "uint256", "name": "shares_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } - ], - "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "isRebalancer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "protocolId_", "type": "uint8" }, - { "internalType": "uint256", "name": "route_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "wstETHflashAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "wETHBorrowAmount_", - "type": "uint256" - }, - { "internalType": "address[]", "name": "vaults_", "type": "address[]" }, - { - "internalType": "uint256[]", - "name": "vaultAmounts_", - "type": "uint256[]" - }, - { "internalType": "uint256", "name": "swapMode_", "type": "uint256" }, - { "internalType": "uint256", "name": "unitAmount_", "type": "uint256" }, - { "internalType": "bytes", "name": "oneInchData_", "type": "bytes" } - ], - "name": "leverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "leverageMaxUnitAmountLimit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } - ], - "name": "maxRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "name": "maxRiskRatio", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } - ], - "name": "maxWithdraw", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares_", "type": "uint256" }, - { "internalType": "address", "name": "receiver_", "type": "address" } - ], - "name": "mint", - "outputs": [ - { "internalType": "uint256", "name": "assets_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "bytes", "name": "", "type": "bytes" } - ], - "name": "onERC721Received", - "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "toProtocolId_", "type": "uint8" } - ], - "name": "paybackDebt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" } - ], - "name": "previewDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "previewMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "previewRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" } - ], - "name": "previewWithdraw", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "fromProtocolId_", "type": "uint8" }, - { "internalType": "uint256", "name": "route_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "wETHBorrowAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawStethAmount_", - "type": "uint256" - } - ], - "name": "queueSteth", - "outputs": [ - { - "internalType": "uint256", - "name": "ratioFromProtocol_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "queuedWithdrawStEth", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "slot_", "type": "bytes32" } - ], - "name": "readFromStorage", - "outputs": [ - { "internalType": "uint256", "name": "result_", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares_", "type": "uint256" }, - { "internalType": "address", "name": "receiver_", "type": "address" }, - { "internalType": "address", "name": "owner_", "type": "address" } - ], - "name": "redeem", - "outputs": [ - { - "internalType": "uint256", - "name": "assetsAfterFee_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newAggrMaxVaultRatio_", - "type": "uint256" - } - ], - "name": "reduceAggrMaxVaultRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8[]", "name": "protocolId_", "type": "uint8[]" }, - { - "internalType": "uint256[]", - "name": "newRiskRatio_", - "type": "uint256[]" - } - ], - "name": "reduceMaxRiskRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "fromProtocolId_", "type": "uint8" }, - { "internalType": "uint8", "name": "toProtocolId_", "type": "uint8" }, - { "internalType": "uint256", "name": "route_", "type": "uint256" }, - { - "internalType": "uint256", - "name": "wstETHflashAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "wETHBorrowAmount_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawAmount_", - "type": "uint256" - } - ], - "name": "refinance", - "outputs": [ - { - "internalType": "uint256", - "name": "ratioFromProtocol_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratioToProtocol_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "revenue", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "revenueExchangePrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "revenueFeePercentage", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "secondaryAuth", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to_", "type": "address" }, - { "internalType": "bytes", "name": "calldata_", "type": "bytes" }, - { "internalType": "uint256", "name": "value_", "type": "uint256" }, - { "internalType": "uint256", "name": "operation_", "type": "uint256" } - ], - "name": "spell", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "sweepEthToSteth", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "sweepWethToSteth", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "treasury", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newAggrMaxVaultRatio_", - "type": "uint256" - } - ], - "name": "updateAggrMaxVaultRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "updateExchangePrice", - "outputs": [ - { - "internalType": "uint256", - "name": "newExchangePrice_", - "type": "uint256" - }, - { "internalType": "uint256", "name": "newRevenue_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "revenueFeePercent_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawalFeePercent_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAbsoluteMin_", - "type": "uint256" - } - ], - "name": "updateFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "newLimit_", "type": "uint256" } - ], - "name": "updateLeverageMaxUnitAmountLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8[]", "name": "protocolId_", "type": "uint8[]" }, - { - "internalType": "uint256[]", - "name": "newRiskRatio_", - "type": "uint256[]" - } - ], - "name": "updateMaxRiskRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "rebalancer_", "type": "address" }, - { "internalType": "bool", "name": "isRebalancer_", "type": "bool" } - ], - "name": "updateRebalancer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "secondaryAuth_", "type": "address" } - ], - "name": "updateSecondaryAuth", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "newTreasury_", "type": "address" } - ], - "name": "updateTreasury", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "vaultDSA", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "protocolId_", "type": "uint8" }, - { "internalType": "uint256", "name": "depositAmount_", "type": "uint256" } - ], - "name": "vaultToProtocolDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets_", "type": "uint256" }, - { "internalType": "address", "name": "receiver_", "type": "address" }, - { "internalType": "address", "name": "owner_", "type": "address" } - ], - "name": "withdraw", - "outputs": [ - { "internalType": "uint256", "name": "shares_", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawFeeAbsoluteMin", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalFeePercentage", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { "stateMutability": "payable", "type": "receive" } + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "status", + "type": "uint8" + } + ], + "name": "LogChangeStatus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "stEthAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "protocolId", + "type": "uint256" + } + ], + "name": "LogClaimEthWithdrawal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "fromNFTId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ethClaimed", + "type": "uint256" + } + ], + "name": "LogClaimSteth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "fromNFTId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ethClaimed", + "type": "uint256" + } + ], + "name": "LogClaimStethAndPaybackFluid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "LogCollectRevenue", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ethAmount", + "type": "uint256" + } + ], + "name": "LogEthSweep", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "protocol", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + } + ], + "name": "LogFillVaultAvailability", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "iTokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "route", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deleverageWethAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawStETHAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "userNetDeposit", + "type": "uint256" + } + ], + "name": "LogImportV1ETHVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "protocol", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "route", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wstETHflashAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ethAmountBorrow", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "vaults", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "vaultAmts", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "swapMode", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unitAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vaultSwapAmt", + "type": "uint256" + } + ], + "name": "LogLeverage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "fromProtocolId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "route", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wETHBorrowAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawStethAmount", + "type": "uint256" + } + ], + "name": "LogQueueSteth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "protocolFrom", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "uint8", + "name": "protocolTo", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "route", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wstETHflashAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wETHBorrowAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + } + ], + "name": "LogRefinance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "oldAggrMaxVaultRatio", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "aggrMaxVaultRatio", + "type": "uint256" + } + ], + "name": "LogUpdateAggrMaxVaultRatio", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "exchangePriceBefore", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "exchangePriceAfter", + "type": "uint256" + } + ], + "name": "LogUpdateExchangePrice", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "revenueFeePercentage", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "withdrawalFeePercentage", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "withdrawFeeAbsoluteMin", + "type": "uint256" + } + ], + "name": "LogUpdateFees", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "oldLimit", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "LogUpdateLeverageMaxUnitAmountLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "protocolId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newRiskRatio", + "type": "uint256" + } + ], + "name": "LogUpdateMaxRiskRatio", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rebalancer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "isRebalancer", + "type": "bool" + } + ], + "name": "LogUpdateRebalancer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldSecondaryAuth", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "secondaryAuth", + "type": "address" + } + ], + "name": "LogUpdateSecondaryAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldTreasury", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTreasury", + "type": "address" + } + ], + "name": "LogUpdateTreasury", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "protocol", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositAmount", + "type": "uint256" + } + ], + "name": "LogVaultToProtocolDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "protocolId", + "type": "uint256" + } + ], + "name": "LogWethPayback", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "wethAmount", + "type": "uint256" + } + ], + "name": "LogWethSweep", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "LogWithdrawFeeCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "auth_", "type": "address" } + ], + "name": "addDSAAuth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "aggrMaxVaultRatio", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "underlying_", "type": "address" } + ], + "name": "borrowBalanceMorphoAaveV3", + "outputs": [ + { "internalType": "uint256", "name": "totalBalance_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "status_", "type": "uint8" }], + "name": "changeVaultStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "requestId_", "type": "uint256" }, + { "internalType": "uint8", "name": "toProtocolId_", "type": "uint8" } + ], + "name": "claimEthWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "fromNftID_", "type": "uint256" } + ], + "name": "claimSteth", + "outputs": [ + { "internalType": "uint256", "name": "claimed_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "fromNftID_", "type": "uint256" } + ], + "name": "claimStethAndPaybackFluid", + "outputs": [ + { "internalType": "uint256", "name": "ethClaimed_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "underlying_", "type": "address" } + ], + "name": "collateralBalanceMorphoAaveV3", + "outputs": [ + { + "internalType": "uint256", + "name": "collateralBalance_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount_", "type": "uint256" } + ], + "name": "collectRevenue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "convertToAssets", + "outputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "name": "convertToShares", + "outputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets_", "type": "uint256" }, + { "internalType": "address", "name": "receiver_", "type": "address" } + ], + "name": "deposit", + "outputs": [ + { "internalType": "uint256", "name": "shares_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangePrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "protocolId_", "type": "uint8" }, + { + "internalType": "uint256", + "name": "withdrawAmount_", + "type": "uint256" + } + ], + "name": "fillVaultAvailability", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getNetAssets", + "outputs": [ + { "internalType": "uint256", "name": "totalAssets_", "type": "uint256" }, + { "internalType": "uint256", "name": "totalDebt_", "type": "uint256" }, + { "internalType": "uint256", "name": "netAssets_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "aggregatedRatio_", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { "internalType": "uint256", "name": "stETH", "type": "uint256" }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInStETH", + "name": "aaveV2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInWstETH", + "name": "aaveV3", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInWstETH", + "name": "compoundV3", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInWstETH", + "name": "euler", + "type": "tuple" + }, + { + "components": [ + { "internalType": "uint256", "name": "stETH", "type": "uint256" }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInStETH", + "name": "morphoAaveV2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInWstETH", + "name": "morphoAaveV3", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInWstETH", + "name": "spark", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.ProtocolAssetsInWstETH", + "name": "fluid", + "type": "tuple" + }, + { + "components": [ + { "internalType": "uint256", "name": "stETH", "type": "uint256" }, + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.IdealBalances", + "name": "vaultBalances", + "type": "tuple" + }, + { + "components": [ + { "internalType": "uint256", "name": "stETH", "type": "uint256" }, + { + "internalType": "uint256", + "name": "wstETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "wETH", "type": "uint256" } + ], + "internalType": "struct IViewModule.IdealBalances", + "name": "dsaBalances", + "type": "tuple" + } + ], + "internalType": "struct IViewModule.NetAssetsHelper", + "name": "assets_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "protocolId_", "type": "uint8" } + ], + "name": "getProtocolRatio", + "outputs": [ + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRatioAaveV2", + "outputs": [ + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stEthPerWsteth_", + "type": "uint256" + } + ], + "name": "getRatioAaveV3", + "outputs": [ + { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stEthPerWsteth_", + "type": "uint256" + } + ], + "name": "getRatioCompoundV3", + "outputs": [ + { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stEthPerWsteth_", + "type": "uint256" + } + ], + "name": "getRatioEuler", + "outputs": [ + { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stEthPerWsteth_", + "type": "uint256" + } + ], + "name": "getRatioFluid", + "outputs": [ + { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRatioMorphoAaveV2", + "outputs": [ + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "stEthAmountPool_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stEthAmountP2P_", + "type": "uint256" + }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "ethAmountPool_", + "type": "uint256" + }, + { "internalType": "uint256", "name": "ethAmountP2P_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stEthPerWsteth_", + "type": "uint256" + } + ], + "name": "getRatioMorphoAaveV3", + "outputs": [ + { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stEthPerWsteth_", + "type": "uint256" + } + ], + "name": "getRatioSpark", + "outputs": [ + { "internalType": "uint256", "name": "wstEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "stEthAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ethAmount_", "type": "uint256" }, + { "internalType": "uint256", "name": "ratio_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "stETHAmount_", "type": "uint256" } + ], + "name": "getWithdrawFee", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "route_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "deleverageWETHAmount_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawStETHAmount_", + "type": "uint256" + }, + { "internalType": "address", "name": "receiver_", "type": "address" } + ], + "name": "importPosition", + "outputs": [ + { "internalType": "uint256", "name": "shares_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isRebalancer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "protocolId_", "type": "uint8" }, + { "internalType": "uint256", "name": "route_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "wstETHflashAmount_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "wETHBorrowAmount_", + "type": "uint256" + }, + { "internalType": "address[]", "name": "vaults_", "type": "address[]" }, + { + "internalType": "uint256[]", + "name": "vaultAmounts_", + "type": "uint256[]" + }, + { "internalType": "uint256", "name": "swapMode_", "type": "uint256" }, + { "internalType": "uint256", "name": "unitAmount_", "type": "uint256" }, + { "internalType": "bytes", "name": "oneInchData_", "type": "bytes" } + ], + "name": "leverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "leverageMaxUnitAmountLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "maxDeposit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "maxMint", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "maxRedeem", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "name": "maxRiskRatio", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "maxWithdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares_", "type": "uint256" }, + { "internalType": "address", "name": "receiver_", "type": "address" } + ], + "name": "mint", + "outputs": [ + { "internalType": "uint256", "name": "assets_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "onERC721Received", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "toProtocolId_", "type": "uint8" } + ], + "name": "paybackDebt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "name": "previewDeposit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "previewMint", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "previewRedeem", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "name": "previewWithdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "fromProtocolId_", "type": "uint8" }, + { "internalType": "uint256", "name": "route_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "wETHBorrowAmount_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawStethAmount_", + "type": "uint256" + } + ], + "name": "queueSteth", + "outputs": [ + { + "internalType": "uint256", + "name": "ratioFromProtocol_", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "queuedWithdrawStEth", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "slot_", "type": "bytes32" } + ], + "name": "readFromStorage", + "outputs": [ + { "internalType": "uint256", "name": "result_", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares_", "type": "uint256" }, + { "internalType": "address", "name": "receiver_", "type": "address" }, + { "internalType": "address", "name": "owner_", "type": "address" } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "assetsAfterFee_", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newAggrMaxVaultRatio_", + "type": "uint256" + } + ], + "name": "reduceAggrMaxVaultRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8[]", "name": "protocolId_", "type": "uint8[]" }, + { + "internalType": "uint256[]", + "name": "newRiskRatio_", + "type": "uint256[]" + } + ], + "name": "reduceMaxRiskRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "fromProtocolId_", "type": "uint8" }, + { "internalType": "uint8", "name": "toProtocolId_", "type": "uint8" }, + { "internalType": "uint256", "name": "route_", "type": "uint256" }, + { + "internalType": "uint256", + "name": "wstETHflashAmount_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "wETHBorrowAmount_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawAmount_", + "type": "uint256" + } + ], + "name": "refinance", + "outputs": [ + { + "internalType": "uint256", + "name": "ratioFromProtocol_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ratioToProtocol_", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revenue", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revenueExchangePrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revenueFeePercentage", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "secondaryAuth", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to_", "type": "address" }, + { "internalType": "bytes", "name": "calldata_", "type": "bytes" }, + { "internalType": "uint256", "name": "value_", "type": "uint256" }, + { "internalType": "uint256", "name": "operation_", "type": "uint256" } + ], + "name": "spell", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "sweepEthToSteth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sweepWethToSteth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newAggrMaxVaultRatio_", + "type": "uint256" + } + ], + "name": "updateAggrMaxVaultRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateExchangePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "newExchangePrice_", + "type": "uint256" + }, + { "internalType": "uint256", "name": "newRevenue_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "revenueFeePercent_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawalFeePercent_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawFeeAbsoluteMin_", + "type": "uint256" + } + ], + "name": "updateFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newLimit_", "type": "uint256" } + ], + "name": "updateLeverageMaxUnitAmountLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8[]", "name": "protocolId_", "type": "uint8[]" }, + { + "internalType": "uint256[]", + "name": "newRiskRatio_", + "type": "uint256[]" + } + ], + "name": "updateMaxRiskRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "rebalancer_", "type": "address" }, + { "internalType": "bool", "name": "isRebalancer_", "type": "bool" } + ], + "name": "updateRebalancer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "secondaryAuth_", "type": "address" } + ], + "name": "updateSecondaryAuth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newTreasury_", "type": "address" } + ], + "name": "updateTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultDSA", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "protocolId_", "type": "uint8" }, + { "internalType": "uint256", "name": "depositAmount_", "type": "uint256" } + ], + "name": "vaultToProtocolDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets_", "type": "uint256" }, + { "internalType": "address", "name": "receiver_", "type": "address" }, + { "internalType": "address", "name": "owner_", "type": "address" } + ], + "name": "withdraw", + "outputs": [ + { "internalType": "uint256", "name": "shares_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawFeeAbsoluteMin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalFeePercentage", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } ] diff --git a/src/quote/flashmint/hyeth/component-quotes/across.ts b/src/quote/flashmint/hyeth/component-quotes/across.ts index 45ad2496..c8753982 100644 --- a/src/quote/flashmint/hyeth/component-quotes/across.ts +++ b/src/quote/flashmint/hyeth/component-quotes/across.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' import { WETH } from 'constants/tokens' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { isSameAddress } from 'utils/addresses' import { getRpcProvider } from 'utils/rpc-provider' @@ -15,7 +15,7 @@ export class AcrossQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} getPoolContract(): Contract { @@ -28,12 +28,12 @@ export class AcrossQuoteProvider { async getDepositQuote( acrossLpAmount: bigint, - inputToken: string + inputToken: string, ): Promise { const outputToken = this.weth const pool = this.getPoolContract() const exchangeRate: BigNumber = await pool.callStatic.exchangeRateCurrent( - this.weth + this.weth, ) const ethAmount = (exchangeRate.toBigInt() * acrossLpAmount) / BigInt(1e18) + @@ -51,12 +51,12 @@ export class AcrossQuoteProvider { async getWithdrawQuote( acrossLpAmount: bigint, - outputToken: string + outputToken: string, ): Promise { const inputToken = this.weth const pool = this.getPoolContract() const exchangeRate: BigNumber = await pool.callStatic.exchangeRateCurrent( - this.weth + this.weth, ) const ethAmount = (exchangeRate.toBigInt() * acrossLpAmount) / BigInt(1e18) if (isSameAddress(inputToken, outputToken)) return ethAmount diff --git a/src/quote/flashmint/hyeth/component-quotes/index.ts b/src/quote/flashmint/hyeth/component-quotes/index.ts index 05f15faf..a2417c20 100644 --- a/src/quote/flashmint/hyeth/component-quotes/index.ts +++ b/src/quote/flashmint/hyeth/component-quotes/index.ts @@ -1,11 +1,11 @@ import { BigNumber } from '@ethersproject/bignumber' import { isAddressEqual } from '@indexcoop/tokenlists' -import { Address } from 'viem' +import type { Address } from 'viem' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { slippageAdjustedTokenAmount } from 'utils' -import { QuoteToken } from '../../../interfaces' +import type { QuoteToken } from '../../../interfaces' import { AcrossQuoteProvider } from './across' import { InstadappQuoteProvider } from './instadapp' @@ -23,20 +23,20 @@ export class ComponentQuotesProvider { readonly slippage: number, readonly wethAddress: string, readonly rpcUrl: string, - readonly swapQuoteProvider: SwapQuoteProvider + readonly swapQuoteProvider: SwapQuoteProvider, ) {} isAcross(token: string) { return isAddressEqual( token as Address, - '0x28F77208728B0A45cAb24c4868334581Fe86F95B' + '0x28F77208728B0A45cAb24c4868334581Fe86F95B', ) } isInstdapp(token: string) { return isAddressEqual( token as Address, - '0xA0D3707c569ff8C87FA923d3823eC5D81c98Be78' + '0xA0D3707c569ff8C87FA923d3823eC5D81c98Be78', ) } @@ -47,7 +47,7 @@ export class ComponentQuotesProvider { '0xc554929a61d862F2741077F8aafa147479c0b308', ] return morphoTokens.some((morphoVault) => - isAddressEqual(morphoVault, token as Address) + isAddressEqual(morphoVault, token as Address), ) } @@ -59,7 +59,7 @@ export class ComponentQuotesProvider { '0x7aa68E84bCD8d1B4C9e10B1e565DB993f68a3E09', ] return pendleTokens.some((pendleToken) => - isAddressEqual(pendleToken, token as Address) + isAddressEqual(pendleToken, token as Address), ) } @@ -68,7 +68,7 @@ export class ComponentQuotesProvider { positions: BigNumber[], isMinting: boolean, inputToken: QuoteToken, - outputToken: QuoteToken + outputToken: QuoteToken, ): Promise { if (components.length === 0 || positions.length === 0) return null if (components.length !== positions.length) return null @@ -97,18 +97,18 @@ export class ComponentQuotesProvider { if (this.isAcross(component)) { const acrossQuoteProvider = new AcrossQuoteProvider( this.rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) if (isMinting) { const quotePromise = acrossQuoteProvider.getDepositQuote( amount, - inputTokenAddress + inputTokenAddress, ) quotePromises.push(quotePromise) } else { const quotePromise = acrossQuoteProvider.getWithdrawQuote( amount, - outputTokenAddress + outputTokenAddress, ) quotePromises.push(quotePromise) } @@ -117,20 +117,20 @@ export class ComponentQuotesProvider { if (this.isInstdapp(component)) { const instadappProvider = new InstadappQuoteProvider( this.rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) if (isMinting) { const quotePromise = instadappProvider.getMintQuote( component, amount, - inputTokenAddress + inputTokenAddress, ) quotePromises.push(quotePromise) } else { const quotePromise = instadappProvider.getRedeemQuote( component, amount, - outputTokenAddress + outputTokenAddress, ) quotePromises.push(quotePromise) } @@ -139,20 +139,20 @@ export class ComponentQuotesProvider { if (this.isMorpho(component)) { const morphoQuoteProvider = new MorphoQuoteProvider( this.rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) if (isMinting) { const quotePromise = morphoQuoteProvider.getMintQuote( component, amount, - inputTokenAddress + inputTokenAddress, ) quotePromises.push(quotePromise) } else { const quotePromise = morphoQuoteProvider.getRedeemQuote( component, amount, - outputTokenAddress + outputTokenAddress, ) quotePromises.push(quotePromise) } @@ -161,20 +161,20 @@ export class ComponentQuotesProvider { if (this.isPendle(component)) { const pendleQuoteProvider = new PendleQuoteProvider( this.rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) if (isMinting) { const quotePromise = pendleQuoteProvider.getDepositQuote( component, amount, - inputTokenAddress + inputTokenAddress, ) quotePromises.push(quotePromise) } else { const quotePromise = pendleQuoteProvider.getWithdrawQuote( component, amount, - outputTokenAddress + outputTokenAddress, ) quotePromises.push(quotePromise) } @@ -182,7 +182,7 @@ export class ComponentQuotesProvider { } const resultsWithNull = await Promise.all(quotePromises) const results: bigint[] = resultsWithNull.filter( - (e): e is Exclude => e !== null + (e): e is Exclude => e !== null, ) if (results.length !== resultsWithNull.length) return null // const componentQuotes = results.map((result) => result.callData) @@ -195,7 +195,7 @@ export class ComponentQuotesProvider { BigNumber.from(inputOutputTokenAmount.toString()), isMinting ? inputToken.decimals : outputToken.decimals, this.slippage, - isMinting + isMinting, ) return { componentQuotes: [], diff --git a/src/quote/flashmint/hyeth/component-quotes/instadapp.ts b/src/quote/flashmint/hyeth/component-quotes/instadapp.ts index ea109cbe..1c11173f 100644 --- a/src/quote/flashmint/hyeth/component-quotes/instadapp.ts +++ b/src/quote/flashmint/hyeth/component-quotes/instadapp.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' import { stETH } from 'constants/tokens' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { getRpcProvider } from 'utils/rpc-provider' import VAULT_ABI from './Vault.json' @@ -11,13 +11,13 @@ import VAULT_ABI from './Vault.json' export class InstadappQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getMintQuote( component: string, position: bigint, - inputToken: string + inputToken: string, ): Promise { const provider = getRpcProvider(this.rpcUrl) // https://etherscan.io/address/0xa0d3707c569ff8c87fa923d3823ec5d81c98be78#readProxyContract @@ -36,7 +36,7 @@ export class InstadappQuoteProvider { async getRedeemQuote( component: string, position: bigint, - outputToken: string + outputToken: string, ): Promise { const provider = getRpcProvider(this.rpcUrl) // https://etherscan.io/address/0xa0d3707c569ff8c87fa923d3823ec5d81c98be78#readProxyContract diff --git a/src/quote/flashmint/hyeth/component-quotes/morpho.ts b/src/quote/flashmint/hyeth/component-quotes/morpho.ts index fb64afc4..2a9895cd 100644 --- a/src/quote/flashmint/hyeth/component-quotes/morpho.ts +++ b/src/quote/flashmint/hyeth/component-quotes/morpho.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' import { WETH } from 'constants/tokens' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { isSameAddress } from 'utils/addresses' import { getRpcProvider } from 'utils/rpc-provider' @@ -11,7 +11,7 @@ export class MorphoQuoteProvider { readonly weth = WETH.address! constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} getTokenContract(address: string): Contract { @@ -26,7 +26,7 @@ export class MorphoQuoteProvider { async getMintQuote( component: string, position: bigint, - inputToken: string + inputToken: string, ): Promise { const tokenContract = this.getTokenContract(component) const ethAmount: BigNumber = await tokenContract.previewMint(position) @@ -44,7 +44,7 @@ export class MorphoQuoteProvider { async getRedeemQuote( component: string, position: bigint, - outputToken: string + outputToken: string, ): Promise { const tokenContract = this.getTokenContract(component) const ethAmount: BigNumber = await tokenContract.previewRedeem(position) diff --git a/src/quote/flashmint/hyeth/component-quotes/pendle.ts b/src/quote/flashmint/hyeth/component-quotes/pendle.ts index 9d3471f2..47b2e6c5 100644 --- a/src/quote/flashmint/hyeth/component-quotes/pendle.ts +++ b/src/quote/flashmint/hyeth/component-quotes/pendle.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' import FLASHMINT_HYETH_ABI from 'constants/abis/FlashMintHyEth.json' import { AddressZero } from 'constants/addresses' import { Contracts } from 'constants/contracts' import { WETH } from 'constants/tokens' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { isSameAddress } from 'utils/addresses' import { getRpcProvider } from 'utils/rpc-provider' @@ -16,7 +16,7 @@ export class PendleQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} getFlashMintHyEth(): Contract { @@ -50,7 +50,7 @@ export class PendleQuoteProvider { async getDepositQuote( component: string, position: bigint, - inputToken: string + inputToken: string, ): Promise { try { const outputToken = this.weth @@ -65,7 +65,7 @@ export class PendleQuoteProvider { let ethAmount = (position * assetRate.toBigInt()) / BigInt(1e18) const syAmountPreview: BigNumber = await syContract.previewDeposit( AddressZero, - ethAmount + ethAmount, ) if (syAmountPreview.toBigInt() < position) { ethAmount = @@ -91,7 +91,7 @@ export class PendleQuoteProvider { async getWithdrawQuote( component: string, position: bigint, - outputToken: string + outputToken: string, ): Promise { const inputToken = this.weth const fmHyEth = this.getFlashMintHyEth() diff --git a/src/quote/flashmint/hyeth/issuance.ts b/src/quote/flashmint/hyeth/issuance.ts index a4da62ef..b4e03c25 100644 --- a/src/quote/flashmint/hyeth/issuance.ts +++ b/src/quote/flashmint/hyeth/issuance.ts @@ -1,14 +1,14 @@ import { Contract } from '@ethersproject/contracts' import DEBT_ISSUANCE_MODULE_V2 from 'constants/abis/DebtIssuanceModuleV2.json' -import { getRpcProvider } from 'utils/rpc-provider' import { getIssuanceModule } from 'utils' +import { getRpcProvider } from 'utils/rpc-provider' -import { FlashMintHyEthQuoteRequest } from './provider' +import type { FlashMintHyEthQuoteRequest } from './provider' export async function getRequiredComponents( quoteRequest: FlashMintHyEthQuoteRequest, - rpcUrl: string + rpcUrl: string, ) { const { isMinting, indexTokenAmount, inputToken, outputToken } = quoteRequest const indexToken = isMinting ? outputToken : inputToken @@ -17,16 +17,16 @@ export async function getRequiredComponents( const contract = new Contract( issuance.address, DEBT_ISSUANCE_MODULE_V2, - provider + provider, ) const [components, positions] = isMinting ? await contract.getRequiredComponentIssuanceUnits( indexToken.address, - indexTokenAmount + indexTokenAmount, ) : await contract.getRequiredComponentRedemptionUnits( indexToken.address, - indexTokenAmount + indexTokenAmount, ) return { components, positions } } diff --git a/src/quote/flashmint/hyeth/provider.test.ts b/src/quote/flashmint/hyeth/provider.test.ts index ae0112a8..047c6c29 100644 --- a/src/quote/flashmint/hyeth/provider.test.ts +++ b/src/quote/flashmint/hyeth/provider.test.ts @@ -5,13 +5,13 @@ import { AddressZero, EthAddress } from 'constants/addresses' import { ChainId } from 'constants/chains' import { noopSwapData } from 'constants/swapdata' import { USDC, WETH } from 'constants/tokens' -import { wei } from 'utils/numbers' import { Exchange } from 'utils' +import { wei } from 'utils/numbers' import { + QuoteTokens, getLocalHostProviderUrl, getZeroExSwapQuoteProvider, - QuoteTokens, } from 'tests/utils' import { FlashMintHyEthQuoteProvider } from './provider' @@ -36,7 +36,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { } const quoteProvider = new FlashMintHyEthQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -58,7 +58,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { } const quoteProvider = new FlashMintHyEthQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -79,7 +79,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { exchange: Exchange.None, } expect(quote.swapDataEthToInputOutputToken).toStrictEqual( - swapDataEthToInputToken + swapDataEthToInputToken, ) }) @@ -93,7 +93,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { } const quoteProvider = new FlashMintHyEthQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -114,7 +114,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { exchange: Exchange.UniV3, } expect(quote.swapDataEthToInputOutputToken).toStrictEqual( - swapDataEthToInputToken + swapDataEthToInputToken, ) }) @@ -128,7 +128,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { } const quoteProvider = new FlashMintHyEthQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -149,7 +149,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { } const quoteProvider = new FlashMintHyEthQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -164,7 +164,7 @@ describe('FlashMintHyEthQuoteProvider()', () => { exchange: Exchange.UniV3, } expect(quote.swapDataEthToInputOutputToken).toStrictEqual( - swapDataEthToInputToken + swapDataEthToInputToken, ) }) }) diff --git a/src/quote/flashmint/hyeth/provider.ts b/src/quote/flashmint/hyeth/provider.ts index f173809a..52321015 100644 --- a/src/quote/flashmint/hyeth/provider.ts +++ b/src/quote/flashmint/hyeth/provider.ts @@ -1,9 +1,9 @@ import { BigNumber } from '@ethersproject/bignumber' import { WETH } from 'constants/tokens' -import { QuoteProvider, QuoteToken } from 'quote/interfaces' -import { SwapQuoteProvider } from 'quote/swap' -import { slippageAdjustedTokenAmount, SwapData } from 'utils' +import type { QuoteProvider, QuoteToken } from 'quote/interfaces' +import type { SwapQuoteProvider } from 'quote/swap' +import { type SwapData, slippageAdjustedTokenAmount } from 'utils' import { ComponentQuotesProvider } from './component-quotes' import { getRequiredComponents } from './issuance' @@ -39,11 +39,11 @@ export class FlashMintHyEthQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintHyEthQuoteRequest + request: FlashMintHyEthQuoteRequest, ): Promise { const { indexTokenAmount, inputToken, isMinting, outputToken, slippage } = request @@ -57,7 +57,7 @@ export class FlashMintHyEthQuoteProvider const { components, positions } = await getRequiredComponents( request, - this.rpcUrl + this.rpcUrl, ) const componentsSwapData = getComponentsSwapData(components) @@ -73,21 +73,21 @@ export class FlashMintHyEthQuoteProvider slippage, wethAddress, this.rpcUrl, - this.swapQuoteProvider + this.swapQuoteProvider, ) const quoteResult = await quoteProvider.getComponentQuotes( components, positions, isMinting, inputToken, - outputToken + outputToken, ) if (!quoteResult) return null const inputOutputTokenAmount = slippageAdjustedTokenAmount( BigNumber.from(quoteResult.inputOutputTokenAmount.toString()), isMinting ? inputToken.decimals : outputToken.decimals, slippage, - isMinting + isMinting, ) return { indexTokenAmount, diff --git a/src/quote/flashmint/hyeth/swap-data.ts b/src/quote/flashmint/hyeth/swap-data.ts index 8fab0374..1990d4fe 100644 --- a/src/quote/flashmint/hyeth/swap-data.ts +++ b/src/quote/flashmint/hyeth/swap-data.ts @@ -2,15 +2,15 @@ import { AddressZero, EthAddress } from 'constants/addresses' import { noopSwapData } from 'constants/swapdata' import { ETH, WETH } from 'constants/tokens' -import { QuoteToken } from 'quote/interfaces' -import { Exchange, SwapData } from 'utils' +import type { QuoteToken } from 'quote/interfaces' +import { Exchange, type SwapData } from 'utils' export function getComponentsSwapData(components: string[]): SwapData[] { return components.map(() => noopSwapData) } export function getEthToInputOutputTokenSwapData( - inputOutputToken: QuoteToken + inputOutputToken: QuoteToken, ): SwapData | null { if (inputOutputToken.symbol === ETH.symbol) return null if (inputOutputToken.symbol === WETH.symbol) { @@ -30,7 +30,7 @@ export function getEthToInputOutputTokenSwapData( } export function getInputTokenToEthSwapData( - inputToken: QuoteToken + inputToken: QuoteToken, ): SwapData | null { if (inputToken.symbol === ETH.symbol) return null if (inputToken.symbol === WETH.symbol) { diff --git a/src/quote/flashmint/leveraged-extended/provider.test.ts b/src/quote/flashmint/leveraged-extended/provider.test.ts index 9a9b7414..b5bcb7b7 100644 --- a/src/quote/flashmint/leveraged-extended/provider.test.ts +++ b/src/quote/flashmint/leveraged-extended/provider.test.ts @@ -6,9 +6,9 @@ import { Exchange } from 'utils' import { wei } from 'utils/numbers' import { + QuoteTokens, getLocalHostProviderUrl, getZeroExSwapQuoteProvider, - QuoteTokens, } from 'tests/utils' import { LeveragedExtendedQuoteProvider } from './provider' @@ -40,7 +40,7 @@ describe('LeveragedQuoteProvider()', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -50,10 +50,10 @@ describe('LeveragedQuoteProvider()', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) }) @@ -73,7 +73,7 @@ describe('LeveragedQuoteProvider()', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -83,10 +83,10 @@ describe('LeveragedQuoteProvider()', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) }) @@ -106,7 +106,7 @@ describe('LeveragedQuoteProvider()', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -116,10 +116,10 @@ describe('LeveragedQuoteProvider()', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) const swapDataOutputToken = noopSwapData noopSwapData.path = [ @@ -145,7 +145,7 @@ describe('LeveragedQuoteProvider()', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -155,10 +155,10 @@ describe('LeveragedQuoteProvider()', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressArbitrum!, quote.swapDataDebtCollateral.path), ).toBe(true) const swapDataOutputToken = noopSwapData noopSwapData.path = [ @@ -186,7 +186,7 @@ describe('LeveragedQuoteProvider() - Base', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrlBase, - swapQuoteProviderBase + swapQuoteProviderBase, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -196,10 +196,10 @@ describe('LeveragedQuoteProvider() - Base', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) }) @@ -223,7 +223,7 @@ describe('LeveragedQuoteProvider() - Base', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrlBase, - swapQuoteProviderBase + swapQuoteProviderBase, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -233,10 +233,10 @@ describe('LeveragedQuoteProvider() - Base', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) }) @@ -256,7 +256,7 @@ describe('LeveragedQuoteProvider() - Base', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrlBase, - swapQuoteProviderBase + swapQuoteProviderBase, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -266,10 +266,10 @@ describe('LeveragedQuoteProvider() - Base', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) const swapDataOutputToken = noopSwapData noopSwapData.path = [ @@ -295,7 +295,7 @@ describe('LeveragedQuoteProvider() - Base', () => { } const quoteProvider = new LeveragedExtendedQuoteProvider( rpcUrlBase, - swapQuoteProviderBase + swapQuoteProviderBase, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -305,10 +305,10 @@ describe('LeveragedQuoteProvider() - Base', () => { expect(quote.swapDataDebtCollateral.exchange).not.toBe(Exchange.None) expect(quote.swapDataDebtCollateral.fees.length).toBeGreaterThanOrEqual(1) expect( - pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(USDC.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) expect( - pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path) + pathContains(WETH.addressBase!, quote.swapDataDebtCollateral.path), ).toBe(true) const swapDataOutputToken = noopSwapData noopSwapData.path = [ diff --git a/src/quote/flashmint/leveraged-extended/provider.ts b/src/quote/flashmint/leveraged-extended/provider.ts index 2bf0af36..041dd17c 100644 --- a/src/quote/flashmint/leveraged-extended/provider.ts +++ b/src/quote/flashmint/leveraged-extended/provider.ts @@ -1,16 +1,16 @@ import { BigNumber } from '@ethersproject/bignumber' import { ETH, InterestCompoundingETHIndex } from 'constants/tokens' +import { Exchange, type SwapData } from 'utils' import { + type LeveragedTokenData, getLeveragedTokenData, - LeveragedTokenData, } from 'utils/leveraged-token-data' import { slippageAdjustedTokenAmount } from 'utils/slippage' -import { Exchange, SwapData } from 'utils' -import { QuoteProvider, QuoteToken } from '../../interfaces' -import { SwapQuoteProvider, SwapQuoteRequest } from '../../swap' import { getRpcProvider } from 'utils/rpc-provider' +import type { QuoteProvider, QuoteToken } from '../../interfaces' +import type { SwapQuoteProvider, SwapQuoteRequest } from '../../swap' export interface FlashMintLeveragedExtendedQuoteRequest { isMinting: boolean @@ -38,11 +38,11 @@ export class LeveragedExtendedQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintLeveragedExtendedQuoteRequest + request: FlashMintLeveragedExtendedQuoteRequest, ): Promise { const provider = getRpcProvider(this.rpcUrl) const { indexTokenAmount, inputToken, isMinting, outputToken, slippage } = @@ -58,7 +58,7 @@ export class LeveragedExtendedQuoteProvider indexTokenSymbol, isMinting, chainId, - provider + provider, ) if (leveragedTokenData === null) return null const debtCollateralResult = isMinting @@ -66,28 +66,28 @@ export class LeveragedExtendedQuoteProvider leveragedTokenData, sources, slippage, - chainId + chainId, ) : await this.getSwapDataCollateralToDebt( leveragedTokenData, sources, slippage, - chainId + chainId, ) if (!debtCollateralResult) return null const { collateralObtainedOrSold } = debtCollateralResult const { swapDataDebtCollateral } = debtCollateralResult // Relevant when issuing const collateralShortfall = leveragedTokenData.collateralAmount.sub( - collateralObtainedOrSold + collateralObtainedOrSold, ) // Relevant when redeeming const leftoverCollateral = leveragedTokenData.collateralAmount.sub( - collateralObtainedOrSold + collateralObtainedOrSold, ) const inputOutputTokenAddress = getPaymentTokenAddress( isMinting ? inputToken.address : outputToken.address, - isMinting ? inputToken.symbol : outputToken.symbol + isMinting ? inputToken.symbol : outputToken.symbol, ) const { swapDataPaymentToken, paymentTokenAmount } = await this.getSwapDataAndPaymentTokenAmount( @@ -99,7 +99,7 @@ export class LeveragedExtendedQuoteProvider isMinting, slippage, sources, - chainId + chainId, ) const estimatedInputOutputAmount = paymentTokenAmount @@ -110,7 +110,7 @@ export class LeveragedExtendedQuoteProvider estimatedInputOutputAmount, inputOuputTokenDecimals, slippage, - isMinting + isMinting, ) return { inputTokenAmount: isMinting ? inputOutputTokenAmount : indexTokenAmount, @@ -128,7 +128,7 @@ export class LeveragedExtendedQuoteProvider leveragedTokenData: LeveragedTokenData, includeSources: Exchange[], slippage: number, - chainId: number + chainId: number, ) { const quoteRequest: SwapQuoteRequest = { chainId, @@ -154,7 +154,7 @@ export class LeveragedExtendedQuoteProvider leveragedTokenData: LeveragedTokenData, includeSources: Exchange[], slippage: number, - chainId: number + chainId: number, ) { const quoteRequest: SwapQuoteRequest = { chainId, @@ -183,7 +183,7 @@ export class LeveragedExtendedQuoteProvider isMinting: boolean, slippage: number, includeSources: Exchange[], - chainId: number + chainId: number, ): Promise<{ swapDataPaymentToken: SwapData paymentTokenAmount: BigNumber @@ -222,7 +222,7 @@ export class LeveragedExtendedQuoteProvider quoteRequest.inputAmount = paymentTokenAmount.toString() } const result = await this.swapQuoteProvider.getSwapQuote(quoteRequest) - if (result && result.swapData) { + if (result?.swapData) { const { inputAmount, outputAmount, swapData } = result swapDataPaymentToken = swapData paymentTokenAmount = isMinting @@ -237,7 +237,7 @@ export class LeveragedExtendedQuoteProvider function getPaymentTokenAddress( paymentTokenAddress: string, - paymentTokenSymbol: string + paymentTokenSymbol: string, ): string { if (paymentTokenSymbol === ETH.symbol) { return 'ETH' diff --git a/src/quote/flashmint/leveraged/provider.test.ts b/src/quote/flashmint/leveraged/provider.test.ts index 266ff153..6173bdc3 100644 --- a/src/quote/flashmint/leveraged/provider.test.ts +++ b/src/quote/flashmint/leveraged/provider.test.ts @@ -5,15 +5,15 @@ import { inputSwapData, outputSwapData, } from 'constants/swapdata' -import { wei } from 'utils/numbers' import { + QuoteTokens, getLocalHostProviderUrl, getZeroExSwapQuoteProvider, - QuoteTokens, } from 'tests/utils' +import { wei } from 'utils/numbers' -import { LeveragedQuoteProvider } from './provider' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' +import { LeveragedQuoteProvider } from './provider' const chainId = ChainId.Mainnet const rpcUrl = getLocalHostProviderUrl(chainId) @@ -39,10 +39,10 @@ describe('LeveragedQuoteProvider()', () => { expect(quote.indexTokenAmount).toEqual(indexTokenAmount) expect(quote.inputOutputTokenAmount.gt(0)).toBe(true) expect(quote.swapDataDebtCollateral).toStrictEqual( - debtCollateralSwapData[indexToken.symbol] + debtCollateralSwapData[indexToken.symbol], ) expect(quote.swapDataPaymentToken).toStrictEqual( - inputSwapData[indexToken.symbol]['ETH'] + inputSwapData[indexToken.symbol].ETH, ) }) @@ -62,10 +62,10 @@ describe('LeveragedQuoteProvider()', () => { expect(quote.indexTokenAmount).toEqual(indexTokenAmount) expect(quote.inputOutputTokenAmount.gt(0)).toBe(true) expect(quote.swapDataDebtCollateral).toStrictEqual( - collateralDebtSwapData[indexToken.symbol] + collateralDebtSwapData[indexToken.symbol], ) expect(quote.swapDataPaymentToken).toStrictEqual( - outputSwapData[indexToken.symbol]['ETH'] + outputSwapData[indexToken.symbol].ETH, ) }) }) diff --git a/src/quote/flashmint/leveraged/provider.ts b/src/quote/flashmint/leveraged/provider.ts index 7ebf57c1..383841ea 100644 --- a/src/quote/flashmint/leveraged/provider.ts +++ b/src/quote/flashmint/leveraged/provider.ts @@ -13,16 +13,16 @@ import { MATIC, stETH, } from 'constants/tokens' +import { Exchange, type SwapData } from 'utils' import { + type LeveragedTokenData, getLeveragedTokenData, - LeveragedTokenData, } from 'utils/leveraged-token-data' import { getRpcProvider } from 'utils/rpc-provider' import { slippageAdjustedTokenAmount } from 'utils/slippage' -import { Exchange, SwapData } from 'utils' -import { QuoteProvider, QuoteToken } from '../../interfaces' -import { SwapQuoteProvider, SwapQuoteRequest } from '../../swap' +import type { QuoteProvider, QuoteToken } from '../../interfaces' +import type { SwapQuoteProvider, SwapQuoteRequest } from '../../swap' export interface FlashMintLeveragedQuoteRequest { isMinting: boolean @@ -45,11 +45,11 @@ export class LeveragedQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintLeveragedQuoteRequest + request: FlashMintLeveragedQuoteRequest, ): Promise { const provider = getRpcProvider(this.rpcUrl) const { inputToken, indexTokenAmount, isMinting, outputToken, slippage } = @@ -66,7 +66,7 @@ export class LeveragedQuoteProvider indexTokenSymbol, isMinting, chainId, - provider + provider, ) if (leveragedTokenData === null) return null const debtCollateralResult = isMinting @@ -74,13 +74,13 @@ export class LeveragedQuoteProvider leveragedTokenData, sources, slippage, - chainId + chainId, ) : await this.getSwapDataCollateralToDebt( leveragedTokenData, sources, slippage, - chainId + chainId, ) if (!debtCollateralResult) return null const { collateralObtainedOrSold } = debtCollateralResult @@ -93,16 +93,16 @@ export class LeveragedQuoteProvider } // Relevant when issuing const collateralShortfall = leveragedTokenData.collateralAmount.sub( - collateralObtainedOrSold + collateralObtainedOrSold, ) // Relevant when redeeming const leftoverCollateral = leveragedTokenData.collateralAmount.sub( - collateralObtainedOrSold + collateralObtainedOrSold, ) const inputOutputTokenAddress = getPaymentTokenAddress( isMinting ? inputToken : outputToken, isMinting, - chainId + chainId, ) const { swapDataPaymentToken, paymentTokenAmount } = await this.getSwapDataAndPaymentTokenAmount( @@ -114,7 +114,7 @@ export class LeveragedQuoteProvider isMinting, slippage, sources, - chainId + chainId, ) const estimatedInputOutputAmount = paymentTokenAmount @@ -125,7 +125,7 @@ export class LeveragedQuoteProvider estimatedInputOutputAmount, inputOuputTokenDecimals, slippage, - isMinting + isMinting, ) return { indexTokenAmount, @@ -141,7 +141,7 @@ export class LeveragedQuoteProvider leveragedTokenData: LeveragedTokenData, includeSources: Exchange[], slippage: number, - chainId: number + chainId: number, ) { const quoteRequest: SwapQuoteRequest = { chainId, @@ -167,7 +167,7 @@ export class LeveragedQuoteProvider leveragedTokenData: LeveragedTokenData, includeSources: Exchange[], slippage: number, - chainId: number + chainId: number, ) { const quoteRequest: SwapQuoteRequest = { chainId, @@ -196,7 +196,7 @@ export class LeveragedQuoteProvider isMinting: boolean, slippage: number, includeSources: Exchange[], - chainId: number + chainId: number, ): Promise<{ swapDataPaymentToken: SwapData paymentTokenAmount: BigNumber @@ -235,7 +235,7 @@ export class LeveragedQuoteProvider quoteRequest.inputAmount = paymentTokenAmount.toString() } const result = await this.swapQuoteProvider.getSwapQuote(quoteRequest) - if (result && result.swapData) { + if (result?.swapData) { const { inputAmount, outputAmount, swapData } = result swapDataPaymentToken = swapData paymentTokenAmount = isMinting @@ -267,7 +267,7 @@ function getSourcesToInclude(isIcEth: boolean): Exchange[] { function getPaymentTokenAddress( paymentToken: QuoteToken, isMinting: boolean, - chainId: number + chainId: number, ): string { if (paymentToken.symbol === ETH.symbol) { return 'ETH' diff --git a/src/quote/flashmint/nav/provider.test.ts b/src/quote/flashmint/nav/provider.test.ts index 53244490..0c4bf743 100644 --- a/src/quote/flashmint/nav/provider.test.ts +++ b/src/quote/flashmint/nav/provider.test.ts @@ -3,14 +3,17 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { AddressZero } from 'constants/addresses' import { ChainId } from 'constants/chains' import { + QuoteTokens, getLocalHostProviderUrl, getZeroExSwapQuoteProvider, - QuoteTokens, } from 'tests/utils' -import { wei } from 'utils/numbers' import { Exchange, isSameAddress } from 'utils' +import { wei } from 'utils/numbers' -import { FlashMintNavQuoteRequest, FlashMintNavQuoteProvider } from './provider' +import { + FlashMintNavQuoteProvider, + type FlashMintNavQuoteRequest, +} from './provider' describe('FlashMintNavQuoteProvider()', () => { const { usdc, weth } = QuoteTokens @@ -30,7 +33,7 @@ describe('FlashMintNavQuoteProvider()', () => { } const quoteProvider = new FlashMintNavQuoteProvider( provider, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -56,7 +59,7 @@ describe('FlashMintNavQuoteProvider()', () => { } const quoteProvider = new FlashMintNavQuoteProvider( provider, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -71,8 +74,8 @@ describe('FlashMintNavQuoteProvider()', () => { expect( isSameAddress( reserveAssetSwapData.path[reserveAssetSwapData.path.length - 1], - usdc.address - ) + usdc.address, + ), ).toBe(true) expect(reserveAssetSwapData.poolIds).toEqual([]) }) @@ -88,7 +91,7 @@ describe('FlashMintNavQuoteProvider()', () => { } const quoteProvider = new FlashMintNavQuoteProvider( provider, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -114,7 +117,7 @@ describe('FlashMintNavQuoteProvider()', () => { } const quoteProvider = new FlashMintNavQuoteProvider( provider, - swapQuoteProvider + swapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -129,8 +132,8 @@ describe('FlashMintNavQuoteProvider()', () => { expect( isSameAddress( reserveAssetSwapData.path[reserveAssetSwapData.path.length - 1], - weth.address - ) + weth.address, + ), ).toBe(true) expect(reserveAssetSwapData.poolIds).toEqual([]) }) diff --git a/src/quote/flashmint/nav/provider.ts b/src/quote/flashmint/nav/provider.ts index 9c8cddcc..a9970463 100644 --- a/src/quote/flashmint/nav/provider.ts +++ b/src/quote/flashmint/nav/provider.ts @@ -1,20 +1,20 @@ import { BigNumber } from '@ethersproject/bignumber' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' -import { Address } from 'viem' +import type { Address } from 'viem' import { AddressZero } from 'constants/addresses' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { Exchange, + type SwapDataV3, getFlashMintNavContract, isSameAddress, slippageAdjustedTokenAmount, - SwapDataV3, } from 'utils' import { getExpectedReserveRedeemQuantity } from 'utils/custom-oracle-nav-issuance-module' import { getRpcProvider } from 'utils/rpc-provider' -import { QuoteProvider, QuoteToken } from '../../interfaces' +import type { QuoteProvider, QuoteToken } from '../../interfaces' export interface FlashMintNavQuoteRequest { chainId: number @@ -37,11 +37,11 @@ export class FlashMintNavQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintNavQuoteRequest + request: FlashMintNavQuoteRequest, ): Promise { const { chainId, @@ -83,7 +83,7 @@ export class FlashMintNavQuoteProvider chainId, indexToken as Address, usdc as Address, - inputTokenAmount.toBigInt() + inputTokenAmount.toBigInt(), ) swapQuoteRequest.inputAmount = usdcAmountToSwap.toString() } @@ -103,14 +103,14 @@ export class FlashMintNavQuoteProvider outputToken.address, inputToken.address, inputTokenAmount, - reserveAssetSwapData + reserveAssetSwapData, ) } else { estimatedOutputAmount = await contract.callStatic.getRedeemAmountOut( inputToken.address, inputTokenAmount, outputToken.address, - reserveAssetSwapData + reserveAssetSwapData, ) } const outputTokenAmount = slippageAdjustedTokenAmount( @@ -120,7 +120,7 @@ export class FlashMintNavQuoteProvider // Usually, this function is used to have either input/output amount slippage // adjusted but since FlastMintNav only uses an input amount, we always have // the output amount as result. So we always want to substract slippage. - false + false, ) return { inputTokenAmount, diff --git a/src/quote/flashmint/wrapped/provider.test.ts b/src/quote/flashmint/wrapped/provider.test.ts index 32da61be..69000c7f 100644 --- a/src/quote/flashmint/wrapped/provider.test.ts +++ b/src/quote/flashmint/wrapped/provider.test.ts @@ -7,7 +7,7 @@ import { } from 'tests/utils' import { wei } from 'utils/numbers' -import { FlashMintWrappedQuoteRequest, WrappedQuoteProvider } from '.' +import { type FlashMintWrappedQuoteRequest, WrappedQuoteProvider } from '.' const chainId = ChainId.Base const indexToken = getTokenByChainAndSymbol(chainId, 'icUSD') diff --git a/src/quote/flashmint/wrapped/provider.ts b/src/quote/flashmint/wrapped/provider.ts index 74e8ddfc..7eeadcd8 100644 --- a/src/quote/flashmint/wrapped/provider.ts +++ b/src/quote/flashmint/wrapped/provider.ts @@ -1,9 +1,9 @@ import { BigNumber } from '@ethersproject/bignumber' -import { SwapQuoteProvider } from 'quote/swap' +import type { SwapQuoteProvider } from 'quote/swap' import { - ComponentSwapData, - ComponentWrapData, + type ComponentSwapData, + type ComponentWrapData, getFlashMintWrappedContract, getIssuanceComponentSwapData, getRedemptionComponentSwapData, @@ -12,7 +12,7 @@ import { } from 'utils' import { getRpcProvider } from 'utils/rpc-provider' -import { QuoteProvider, QuoteToken } from '../../interfaces' +import type { QuoteProvider, QuoteToken } from '../../interfaces' export interface FlashMintWrappedQuoteRequest { chainId: number @@ -35,11 +35,11 @@ export class WrappedQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintWrappedQuoteRequest + request: FlashMintWrappedQuoteRequest, ): Promise { const { chainId, @@ -61,7 +61,7 @@ export class WrappedQuoteProvider indexTokenAmount, }, this.rpcUrl, - this.swapQuoteProvider + this.swapQuoteProvider, ) : await getRedemptionComponentSwapData( { @@ -72,7 +72,7 @@ export class WrappedQuoteProvider indexTokenAmount, }, this.rpcUrl, - this.swapQuoteProvider + this.swapQuoteProvider, ) const componentWrapData = getWrapData(indexToken.symbol) if (componentSwapData.length !== componentWrapData.length) return null @@ -84,14 +84,14 @@ export class WrappedQuoteProvider indexToken.address, inputToken.address, indexTokenAmount, - componentSwapData + componentSwapData, ) } else { estimatedInputOutputAmount = await contract.callStatic.getRedeemExactSet( indexToken.address, outputToken.address, indexTokenAmount, - componentSwapData + componentSwapData, ) } // Apply slippage to the quote amount (minting: inputToken, redeeming: outputToken) @@ -99,7 +99,7 @@ export class WrappedQuoteProvider estimatedInputOutputAmount, isMinting ? inputToken.decimals : outputToken.decimals, slippage, - isMinting + isMinting, ) const quote: FlashMintWrappedQuote = { componentSwapData, diff --git a/src/quote/flashmint/zeroEx/componentsQuoteProvider.test.ts b/src/quote/flashmint/zeroEx/componentsQuoteProvider.test.ts index 4148a9cd..95922025 100644 --- a/src/quote/flashmint/zeroEx/componentsQuoteProvider.test.ts +++ b/src/quote/flashmint/zeroEx/componentsQuoteProvider.test.ts @@ -4,8 +4,8 @@ import { BigNumber } from '@ethersproject/bignumber' import { MetaverseIndex, WETH } from 'constants/tokens' -import { ComponentsQuoteProvider } from './componentsQuoteProvider' import { ZeroExSwapQuoteProvider } from 'quote/swap' +import { ComponentsQuoteProvider } from './componentsQuoteProvider' const index0xApiBaseUrl = process.env.INDEX_0X_API @@ -18,13 +18,13 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { index0xApiBaseUrl, '', { 'X-INDEXCOOP-API-KEY': process.env.INDEX_0X_API_KEY! }, - '/mainnet/swap/v1/quote' + '/mainnet/swap/v1/quote', ) const quoteProvider = new ComponentsQuoteProvider( chainId, slippage, WETH.address!, - zeroExApi + zeroExApi, ) test('returns component quotes', async () => { @@ -54,7 +54,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (!result) { fail() @@ -86,7 +86,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (!result) { fail() @@ -94,7 +94,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { const { componentQuotes, inputOutputTokenAmount } = result expect(componentQuotes.length).toEqual(components.length) expect(componentQuotes[1]).toEqual( - '0x0000000000000000000000000000000000000000' + '0x0000000000000000000000000000000000000000', ) // When the input token equals the component, the position amount should just be // added to the input/ouput token amount. So the result should be greater than that. @@ -120,7 +120,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (!result) { fail() @@ -128,7 +128,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { const { componentQuotes, inputOutputTokenAmount } = result expect(componentQuotes.length).toEqual(components.length) expect(componentQuotes[0]).not.toEqual( - '0x0000000000000000000000000000000000000000' + '0x0000000000000000000000000000000000000000', ) expect(inputOutputTokenAmount.gt(0)).toBe(true) }) @@ -152,7 +152,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (!result) { fail() @@ -160,7 +160,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { const { componentQuotes, inputOutputTokenAmount } = result expect(componentQuotes.length).toEqual(components.length) expect(componentQuotes[0]).toEqual( - '0x0000000000000000000000000000000000000000' + '0x0000000000000000000000000000000000000000', ) // When the input token equals the component, the position amount should just be // added to the input/ouput token amount. So the result should be equal to that. @@ -186,7 +186,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (result) { fail() @@ -213,7 +213,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (result) { fail() @@ -240,7 +240,7 @@ describe('ComponentsQuoteProvider - getComponentQuotes()', () => { positions, isMinting, inputToken, - outputToken + outputToken, ) if (result) { fail() @@ -257,13 +257,13 @@ describe('ComponentsQuoteProvider - getTokenAddressOrWeth()', () => { index0xApiBaseUrl, '', { 'X-INDEXCOOP-API-KEY': process.env.INDEX_0X_API_KEY! }, - '/mainnet/swap/v1/quote' + '/mainnet/swap/v1/quote', ) const quoteProvider = new ComponentsQuoteProvider( chainId, slippage, WETH.address!, - zeroExApi + zeroExApi, ) const token = { address: USDC, @@ -281,13 +281,13 @@ describe('ComponentsQuoteProvider - getTokenAddressOrWeth()', () => { index0xApiBaseUrl, '', { 'X-INDEXCOOP-API-KEY': process.env.INDEX_0X_API_KEY! }, - '/mainnet/swap/v1/quote' + '/mainnet/swap/v1/quote', ) const quoteProvider = new ComponentsQuoteProvider( chainId, slippage, WETH.address!, - zeroExApi + zeroExApi, ) const token = { address: '0xeeeeee', diff --git a/src/quote/flashmint/zeroEx/componentsQuoteProvider.ts b/src/quote/flashmint/zeroEx/componentsQuoteProvider.ts index 101e961c..c4eed16d 100644 --- a/src/quote/flashmint/zeroEx/componentsQuoteProvider.ts +++ b/src/quote/flashmint/zeroEx/componentsQuoteProvider.ts @@ -1,9 +1,9 @@ import { BigNumber } from '@ethersproject/bignumber' -import { SwapQuote, SwapQuoteProvider, SwapQuoteRequest } from 'quote/swap' +import type { SwapQuote, SwapQuoteProvider, SwapQuoteRequest } from 'quote/swap' import { Exchange } from 'utils' -import { QuoteToken } from '../../interfaces' +import type { QuoteToken } from '../../interfaces' export type ComponentQuotesResult = { componentQuotes: string[] @@ -14,7 +14,7 @@ export class ComponentsQuoteProvider { readonly chainId: number, readonly slippage: number, readonly wethAddress: string, - readonly swapQuoteProvider: SwapQuoteProvider + readonly swapQuoteProvider: SwapQuoteProvider, ) {} /** @@ -34,7 +34,7 @@ export class ComponentsQuoteProvider { positions: BigNumber[], isMinting: boolean, inputToken: QuoteToken, - outputToken: QuoteToken + outputToken: QuoteToken, ): Promise { if (components.length === 0 || positions.length === 0) return null if (components.length !== positions.length) return null @@ -77,13 +77,13 @@ export class ComponentsQuoteProvider { const resultsWithNull = await Promise.all(quotePromises) const results: SwapQuote[] = resultsWithNull.filter( - (e): e is Exclude => e !== null + (e): e is Exclude => e !== null, ) if (results.length !== resultsWithNull.length) return null const componentQuotes = results.map((result) => result.callData) const inputOutputTokenAmount = results .map((result) => - BigNumber.from(isMinting ? result.inputAmount : result.outputAmount) + BigNumber.from(isMinting ? result.inputAmount : result.outputAmount), ) .reduce((prevValue, currValue) => { return currValue.add(prevValue) diff --git a/src/quote/flashmint/zeroEx/provider.test.ts b/src/quote/flashmint/zeroEx/provider.test.ts index de4b2232..26297637 100644 --- a/src/quote/flashmint/zeroEx/provider.test.ts +++ b/src/quote/flashmint/zeroEx/provider.test.ts @@ -2,9 +2,9 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, getLocalHostProviderUrl, getZeroExSwapQuoteProvider, - QuoteTokens, } from 'tests/utils' import { wei } from 'utils' diff --git a/src/quote/flashmint/zeroEx/provider.ts b/src/quote/flashmint/zeroEx/provider.ts index 5ddcd1ff..bb83c8ac 100644 --- a/src/quote/flashmint/zeroEx/provider.ts +++ b/src/quote/flashmint/zeroEx/provider.ts @@ -1,17 +1,17 @@ -import { BigNumber } from '@ethersproject/bignumber' -import { JsonRpcProvider } from '@ethersproject/providers' +import type { BigNumber } from '@ethersproject/bignumber' +import type { JsonRpcProvider } from '@ethersproject/providers' import { WETH } from 'constants/tokens' -import { getRpcProvider } from 'utils/rpc-provider' import { getAddressForToken, getFlashMintZeroExContractForToken, getIssuanceModule, slippageAdjustedTokenAmount, } from 'utils' +import { getRpcProvider } from 'utils/rpc-provider' -import { QuoteProvider, QuoteToken } from '../../interfaces' -import { SwapQuoteProvider } from '../../swap' +import type { QuoteProvider, QuoteToken } from '../../interfaces' +import type { SwapQuoteProvider } from '../../swap' import { ComponentsQuoteProvider } from './componentsQuoteProvider' export interface FlashMintZeroExQuoteRequest { @@ -33,11 +33,11 @@ export class ZeroExQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintZeroExQuoteRequest + request: FlashMintZeroExQuoteRequest, ): Promise { const { rpcUrl, swapQuoteProvider } = this const provider = getRpcProvider(rpcUrl) @@ -58,20 +58,20 @@ export class ZeroExQuoteProvider indexTokenSymbol, indexTokenAmount, provider, - chainId + chainId, ) const quoteProvider = new ComponentsQuoteProvider( chainId, slippage, wethAddress, - swapQuoteProvider + swapQuoteProvider, ) const quoteResult = await quoteProvider.getComponentQuotes( components, positions, isMinting, inputToken, - outputToken + outputToken, ) if (!quoteResult) return null const { @@ -85,7 +85,7 @@ export class ZeroExQuoteProvider estimatedInputOutputAmount, inputOuputTokenDecimals, slippage, - isMinting + isMinting, ) return { componentQuotes, @@ -110,12 +110,12 @@ export async function getRequiredComponents( indexTokenSymbol: string, indexTokenAmount: BigNumber, provider: JsonRpcProvider, - chainId: number + chainId: number, ) { const contract = getFlashMintZeroExContractForToken( indexTokenSymbol, provider, - chainId + chainId, ) const issuanceModule = getIssuanceModule(indexTokenSymbol, chainId) const { components, positions } = isMinting @@ -123,13 +123,13 @@ export async function getRequiredComponents( issuanceModule.address, issuanceModule.isDebtIssuance, indexToken, - indexTokenAmount + indexTokenAmount, ) : await contract.getRequiredRedemptionComponents( issuanceModule.address, issuanceModule.isDebtIssuance, indexToken, - indexTokenAmount + indexTokenAmount, ) return { components, positions } } diff --git a/src/quote/provider/icusd.ts b/src/quote/provider/icusd.ts index 4aadb53e..74fda45b 100644 --- a/src/quote/provider/icusd.ts +++ b/src/quote/provider/icusd.ts @@ -2,18 +2,18 @@ import { BigNumber } from '@ethersproject/bignumber' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { - FlashMintWrappedBuildRequest, + type FlashMintWrappedBuildRequest, WrappedTransactionBuilder, } from 'flashmint' import { WrappedQuoteProvider } from '../flashmint/wrapped' -import { QuoteProvider, QuoteToken } from '../interfaces' +import type { QuoteProvider, QuoteToken } from '../interfaces' import { FlashMintContractType, - FlashMintQuote, - FlashMintQuoteRequest, + type FlashMintQuote, + type FlashMintQuoteRequest, } from '../provider' -import { SwapQuoteProvider } from '../swap' +import type { SwapQuoteProvider } from '../swap' import { buildQuoteResponse } from './utils' export interface IcUsdQuoteRequest extends FlashMintQuoteRequest { @@ -32,7 +32,7 @@ export class IcUsdQuoteRouter { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote(request: IcUsdQuoteRequest): Promise { @@ -104,7 +104,7 @@ export class IcUsdQuoteRouter const inputOutputToken = isMinting ? inputToken : outputToken const wrappedQuoteProvider = new WrappedQuoteProvider( this.rpcUrl, - this.swapQuoteProvider + this.swapQuoteProvider, ) const wrappedQuote = await wrappedQuoteProvider.getQuote({ ...request, @@ -131,7 +131,7 @@ export class IcUsdQuoteRouter chainId, FlashMintContractType.wrapped, wrappedQuote.inputOutputTokenAmount, - tx + tx, ) } } diff --git a/src/quote/provider/index.test.ts b/src/quote/provider/index.test.ts index df6d7388..55aa21e5 100644 --- a/src/quote/provider/index.test.ts +++ b/src/quote/provider/index.test.ts @@ -8,15 +8,15 @@ import { getFlashMintLeveragedContractForToken, wei } from 'utils' import { getRpcProvider } from 'utils/rpc-provider' import { + QuoteTokens, getLocalHostProviderUrl, getZeroExSwapQuoteProvider, - QuoteTokens, } from 'tests/utils' import { FlashMintContractType, FlashMintQuoteProvider, - FlashMintQuoteRequest, + type FlashMintQuoteRequest, } from '.' const chainId = ChainId.Mainnet @@ -48,10 +48,10 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( rpcUrl, - zeroexSwapQuoteProvider + zeroexSwapQuoteProvider, ) await expect(quoteProvider.getQuote(request)).rejects.toThrow( - 'Index token not supported' + 'Index token not supported', ) }) @@ -67,7 +67,7 @@ describe('FlashMintQuoteProvider()', () => { const contract = getFlashMintLeveragedContractForToken( outputToken.symbol, arbitrumProvider, - ChainId.Arbitrum + ChainId.Arbitrum, ) const request: FlashMintQuoteRequest = { isMinting: true, @@ -78,7 +78,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( rpcUrl, - getZeroExSwapQuoteProvider(ChainId.Arbitrum) + getZeroExSwapQuoteProvider(ChainId.Arbitrum), ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -109,7 +109,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( rpcUrl, - zeroexSwapQuoteProvider + zeroexSwapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -142,7 +142,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( getLocalHostProviderUrl(chainId), - getZeroExSwapQuoteProvider(chainId) + getZeroExSwapQuoteProvider(chainId), ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -175,7 +175,7 @@ describe('FlashMintQuoteProvider()', () => { const contract = getFlashMintLeveragedContractForToken( inputToken.symbol, arbitrumProvider, - ChainId.Arbitrum + ChainId.Arbitrum, ) const request: FlashMintQuoteRequest = { isMinting: false, @@ -186,7 +186,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( rpcUrl, - getZeroExSwapQuoteProvider(ChainId.Arbitrum) + getZeroExSwapQuoteProvider(ChainId.Arbitrum), ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -217,7 +217,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( rpcUrl, - zeroexSwapQuoteProvider + zeroexSwapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -244,7 +244,7 @@ describe('FlashMintQuoteProvider()', () => { const contract = getFlashMintLeveragedContractForToken( inputToken.symbol, undefined, - 1 + 1, ) const request: FlashMintQuoteRequest = { isMinting: false, @@ -255,7 +255,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( rpcUrl, - zeroexSwapQuoteProvider + zeroexSwapQuoteProvider, ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() @@ -290,7 +290,7 @@ describe('FlashMintQuoteProvider()', () => { } const quoteProvider = new FlashMintQuoteProvider( getLocalHostProviderUrl(chainId), - getZeroExSwapQuoteProvider(chainId) + getZeroExSwapQuoteProvider(chainId), ) const quote = await quoteProvider.getQuote(request) if (!quote) fail() diff --git a/src/quote/provider/index.ts b/src/quote/provider/index.ts index 06193b68..ed204013 100644 --- a/src/quote/provider/index.ts +++ b/src/quote/provider/index.ts @@ -1,39 +1,39 @@ -import { TransactionRequest } from '@ethersproject/abstract-provider' +import type { TransactionRequest } from '@ethersproject/abstract-provider' import { BigNumber } from '@ethersproject/bignumber' import { TheUSDCYieldIndex } from 'constants/tokens' import { FlashMintHyEthTransactionBuilder, - FlashMintLeveragedBuildRequest, - FlashMintLeveragedExtendedBuildRequest, - FlashMintWrappedBuildRequest, - FlashMintZeroExBuildRequest, + type FlashMintLeveragedBuildRequest, + type FlashMintLeveragedExtendedBuildRequest, + type FlashMintWrappedBuildRequest, + type FlashMintZeroExBuildRequest, LeveragedExtendedTransactionBuilder, LeveragedTransactionBuilder, WrappedTransactionBuilder, ZeroExTransactionBuilder, } from 'flashmint' -import { getRpcProvider } from 'utils/rpc-provider' import { wei } from 'utils' +import { getRpcProvider } from 'utils/rpc-provider' import { FlashMintHyEthQuoteProvider } from '../flashmint/hyeth' import { LeveragedQuoteProvider } from '../flashmint/leveraged' import { LeveragedExtendedQuoteProvider } from '../flashmint/leveraged-extended' import { WrappedQuoteProvider } from '../flashmint/wrapped' import { ZeroExQuoteProvider } from '../flashmint/zeroEx' -import { QuoteProvider, QuoteToken } from '../interfaces' -import { SwapQuoteProvider } from '../swap' +import type { QuoteProvider, QuoteToken } from '../interfaces' +import type { SwapQuoteProvider } from '../swap' import { IcUsdQuoteRouter } from './icusd' import { buildQuoteResponse, getContractType } from './utils' export enum FlashMintContractType { - hyeth, - leveraged, - leveragedExtended, - nav, - wrapped, - zeroEx, + hyeth = 0, + leveraged = 1, + leveragedExtended = 2, + nav = 3, + wrapped = 4, + zeroEx = 5, } export interface FlashMintQuoteRequest { @@ -65,11 +65,11 @@ export class FlashMintQuoteProvider { constructor( private readonly rpcUrl: string, - private readonly swapQuoteProvider: SwapQuoteProvider + private readonly swapQuoteProvider: SwapQuoteProvider, ) {} async getQuote( - request: FlashMintQuoteRequest + request: FlashMintQuoteRequest, ): Promise { const { rpcUrl, swapQuoteProvider } = this const provider = getRpcProvider(rpcUrl) @@ -100,7 +100,7 @@ export class FlashMintQuoteProvider case FlashMintContractType.hyeth: { const hyethQuoteProvider = new FlashMintHyEthQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const hyethQuote = await hyethQuoteProvider.getQuote({ isMinting, @@ -111,7 +111,7 @@ export class FlashMintQuoteProvider }) if (!hyethQuote) return null const inputOutputTokenAmount = BigNumber.from( - hyethQuote.inputOutputTokenAmount.toString() + hyethQuote.inputOutputTokenAmount.toString(), ) const builder = new FlashMintHyEthTransactionBuilder(rpcUrl) const txRequest = { @@ -138,13 +138,13 @@ export class FlashMintQuoteProvider chainId, contractType, inputOutputTokenAmount, - tx + tx, ) } case FlashMintContractType.leveraged: { const leveragedQuoteProvider = new LeveragedQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const leveragedQuote = await leveragedQuoteProvider.getQuote({ ...request, @@ -170,7 +170,7 @@ export class FlashMintQuoteProvider chainId, contractType, leveragedQuote.inputOutputTokenAmount, - tx + tx, ) } case FlashMintContractType.leveragedExtended: { @@ -206,13 +206,13 @@ export class FlashMintQuoteProvider chainId, contractType, leveragedExtendedQuote.inputOutputTokenAmount, - tx + tx, ) } case FlashMintContractType.wrapped: { const wrappedQuoteProvider = new WrappedQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const wrappedQuote = await wrappedQuoteProvider.getQuote({ ...request, @@ -239,13 +239,13 @@ export class FlashMintQuoteProvider chainId, contractType, wrappedQuote.inputOutputTokenAmount, - tx + tx, ) } case FlashMintContractType.zeroEx: { const zeroExQuoteProvider = new ZeroExQuoteProvider( rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) const zeroExQuote = await zeroExQuoteProvider.getQuote({ ...request, @@ -270,7 +270,7 @@ export class FlashMintQuoteProvider chainId, contractType, zeroExQuote.inputOutputTokenAmount, - tx + tx, ) } default: diff --git a/src/quote/provider/utils.test.ts b/src/quote/provider/utils.test.ts index 9c44e62c..d134d95d 100644 --- a/src/quote/provider/utils.test.ts +++ b/src/quote/provider/utils.test.ts @@ -21,7 +21,7 @@ import { import { QuoteTokens } from 'tests/utils' import { wei } from 'utils' -import { FlashMintContractType, FlashMintQuoteRequest } from './' +import { FlashMintContractType, type FlashMintQuoteRequest } from './' import { buildQuoteResponse, getContractType } from './utils' const { usdc } = QuoteTokens @@ -46,7 +46,7 @@ describe('buildQuoteResponse()', () => { 1, FlashMintContractType.wrapped, quoteAmount, - tx + tx, ) expect(response).toEqual({ chainId: 1, @@ -69,29 +69,29 @@ describe('getContractType()', () => { test('returns correct contract type for leveraged arbitrum tokens', async () => { const btc2xContractType = getContractType( IndexCoopBitcoin2xIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) const btc2xEthContractType = getContractType('BTC2xETH', ChainId.Arbitrum) const btc3xContractType = getContractType( IndexCoopBitcoin3xIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) const eth2xContractType = getContractType( IndexCoopEthereum2xIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) const eth2xBtcContractType = getContractType('ETH2xBTC', ChainId.Arbitrum) const eth3xContractType = getContractType( IndexCoopEthereum3xIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) const ibtc1xContractType = getContractType( IndexCoopInverseBitcoinIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) const ieth1xContractType = getContractType( IndexCoopInverseEthereumIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) expect(btc2xContractType).toBe(FlashMintContractType.leveragedExtended) expect(btc2xEthContractType).toBe(FlashMintContractType.leveragedExtended) @@ -106,7 +106,7 @@ describe('getContractType()', () => { test('returns correct contract type for BED', async () => { const contractType = getContractType( BanklessBEDIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.zeroEx) }) @@ -119,7 +119,7 @@ describe('getContractType()', () => { test('returns correct contract type for dsETH', async () => { const contractType = getContractType( DiversifiedStakedETHIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.zeroEx) }) @@ -132,7 +132,7 @@ describe('getContractType()', () => { test('returns correct contract type for BTC2X (mainnet)', async () => { const contractType = getContractType( IndexCoopBitcoin2xIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.leveraged) }) @@ -140,7 +140,7 @@ describe('getContractType()', () => { test('returns correct contract type for ETH2X (mainnet)', async () => { const contractType = getContractType( IndexCoopEthereum2xIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.leveraged) }) @@ -148,7 +148,7 @@ describe('getContractType()', () => { test('returns correct contract type for hyETH', async () => { const contractType = getContractType( HighYieldETHIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.hyeth) }) @@ -156,7 +156,7 @@ describe('getContractType()', () => { test('returns correct contract type for icETH', async () => { const contractType = getContractType( InterestCompoundingETHIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.leveraged) }) @@ -164,7 +164,7 @@ describe('getContractType()', () => { test('returns correct contract type for icUSD', async () => { const contractType = getContractType( TheUSDCYieldIndex.symbol, - ChainId.Mainnet + ChainId.Mainnet, ) expect(contractType).toBe(FlashMintContractType.wrapped) }) diff --git a/src/quote/provider/utils.ts b/src/quote/provider/utils.ts index 5b02dfb6..72018422 100644 --- a/src/quote/provider/utils.ts +++ b/src/quote/provider/utils.ts @@ -1,5 +1,5 @@ +import type { TransactionRequest } from '@ethersproject/abstract-provider' import { BigNumber } from '@ethersproject/bignumber' -import { TransactionRequest } from '@ethersproject/abstract-provider' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' @@ -22,8 +22,8 @@ import { import { FlashMintContractType, - FlashMintQuote, - FlashMintQuoteRequest, + type FlashMintQuote, + type FlashMintQuoteRequest, } from './index' export function buildQuoteResponse( @@ -31,7 +31,7 @@ export function buildQuoteResponse( chainId: number, contractType: FlashMintContractType, inputOutputTokenAmount: BigNumber, // quote amount - tx: TransactionRequest + tx: TransactionRequest, ): FlashMintQuote { const { isMinting, inputToken, outputToken, slippage } = request const indexTokenAmount = BigNumber.from(request.indexTokenAmount) @@ -55,7 +55,7 @@ export function buildQuoteResponse( // Returns contract type for token or null if not supported export function getContractType( token: string, - chainId: number + chainId: number, ): FlashMintContractType | null { if (chainId === ChainId.Arbitrum) { const btc2xEth = getTokenByChainAndSymbol(ChainId.Arbitrum, 'BTC2xETH') diff --git a/src/quote/swap/adapters/adapter.test.ts b/src/quote/swap/adapters/adapter.test.ts index 40b5496a..daf51f00 100644 --- a/src/quote/swap/adapters/adapter.test.ts +++ b/src/quote/swap/adapters/adapter.test.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { ETH, stETH, WETH } from 'constants/tokens' +import { ETH, WETH, stETH } from 'constants/tokens' import { getAlchemyProviderUrl } from 'tests/utils' -import { IndexSwapQuoteProvider } from './adapter' import { Exchange } from 'utils' +import { IndexSwapQuoteProvider } from './adapter' const rpcUrl = getAlchemyProviderUrl(1) diff --git a/src/quote/swap/adapters/adapter.ts b/src/quote/swap/adapters/adapter.ts index 48c527fd..7a4e8f6d 100644 --- a/src/quote/swap/adapters/adapter.ts +++ b/src/quote/swap/adapters/adapter.ts @@ -2,7 +2,7 @@ import { EthAddress } from 'constants/addresses' import { stETH } from 'constants/tokens' import { CurveSwapQuoteProvider } from 'quote/swap/adapters/curve' import { UniswapSwapQuoteProvider } from 'quote/swap/adapters/uniswap' -import { +import type { SwapQuote, SwapQuoteProvider, SwapQuoteRequest, @@ -13,7 +13,7 @@ export class IndexSwapQuoteProvider implements SwapQuoteProvider { constructor(readonly rpcUrl: string) {} public async getSwapQuote( - request: SwapQuoteRequest + request: SwapQuoteRequest, ): Promise { let inputToken = request.inputToken let outputToken = request.outputToken diff --git a/src/quote/swap/adapters/curve/index.test.ts b/src/quote/swap/adapters/curve/index.test.ts index 73050d56..b4c923c2 100644 --- a/src/quote/swap/adapters/curve/index.test.ts +++ b/src/quote/swap/adapters/curve/index.test.ts @@ -37,8 +37,8 @@ describe('CurveSwapQuoteProvider', () => { expect( isAddressEqual( quote.swapData?.path[quote.swapData.path.length - 1], - steth - ) + steth, + ), ).toBe(true) expect(quote.swapData?.pool).toBe(curvePool) // expect(quote.callData).not.toBe('0x') @@ -63,8 +63,8 @@ describe('CurveSwapQuoteProvider', () => { expect( isAddressEqual( quote.swapData?.path[quote.swapData.path.length - 1], - steth - ) + steth, + ), ).toBe(true) expect(quote.swapData?.pool).toBe(curvePool) // expect(quote.callData).not.toBe('0x') diff --git a/src/quote/swap/adapters/curve/index.ts b/src/quote/swap/adapters/curve/index.ts index 64367d56..8ed99c6f 100644 --- a/src/quote/swap/adapters/curve/index.ts +++ b/src/quote/swap/adapters/curve/index.ts @@ -1,10 +1,10 @@ import { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' -import { +import type { + SwapQuote, SwapQuoteProvider, SwapQuoteRequest, - SwapQuote, } from 'quote/swap/interfaces' import { getRpcProvider } from 'utils/rpc-provider' diff --git a/src/quote/swap/adapters/curve/swap-data.ts b/src/quote/swap/adapters/curve/swap-data.ts index 26995d14..53ba342a 100644 --- a/src/quote/swap/adapters/curve/swap-data.ts +++ b/src/quote/swap/adapters/curve/swap-data.ts @@ -1,5 +1,5 @@ -import { stETH, WETH } from 'constants/tokens' -import { Exchange, SwapData } from 'utils' +import { WETH, stETH } from 'constants/tokens' +import { Exchange, type SwapData } from 'utils' export function getSwapData(): SwapData { // The curve adapter is mostly just used for ETH/stETH swapping, so we can diff --git a/src/quote/swap/adapters/lifi/index.ts b/src/quote/swap/adapters/lifi/index.ts index 814f5a8b..190da70d 100644 --- a/src/quote/swap/adapters/lifi/index.ts +++ b/src/quote/swap/adapters/lifi/index.ts @@ -1,11 +1,11 @@ import { - ContractCallsQuoteRequest, + type ContractCallsQuoteRequest, + type LiFiStep, getContractCallsQuote, getQuote, - LiFiStep, } from '@lifi/sdk' -import { +import type { SwapQuote, SwapQuoteProvider, SwapQuoteRequest, @@ -14,7 +14,10 @@ import { import { getSwapData } from './swap-data' export class LiFiSwapQuoteProvider implements SwapQuoteProvider { - constructor(readonly apiKey: string, readonly integrator: string) {} + constructor( + readonly apiKey: string, + readonly integrator: string, + ) {} async getSwapQuote(request: SwapQuoteRequest): Promise { // This is not ideal but right now the only way to get only uniV2 and sushi quotes diff --git a/src/quote/swap/adapters/lifi/swap-data.ts b/src/quote/swap/adapters/lifi/swap-data.ts index d48074f1..cf1c6b6b 100644 --- a/src/quote/swap/adapters/lifi/swap-data.ts +++ b/src/quote/swap/adapters/lifi/swap-data.ts @@ -1,7 +1,7 @@ -import { LiFiStep } from '@lifi/sdk' +import type { LiFiStep } from '@lifi/sdk' import { AddressZero } from 'constants/addresses' -import { Exchange, SwapData } from 'utils' +import { Exchange, type SwapData } from 'utils' export function getSwapData(lifiResult: LiFiStep): SwapData | null { const feeCosts = lifiResult.estimate.feeCosts ?? null diff --git a/src/quote/swap/adapters/uniswap/index.test.ts b/src/quote/swap/adapters/uniswap/index.test.ts index 331767ea..d8b4aed7 100644 --- a/src/quote/swap/adapters/uniswap/index.test.ts +++ b/src/quote/swap/adapters/uniswap/index.test.ts @@ -4,8 +4,8 @@ import { ChainId } from 'constants/chains' import { USDC, WETH } from 'constants/tokens' import { getAlchemyProviderUrl } from 'tests/utils' -import { UniswapSwapQuoteProvider } from './' import { Exchange } from 'utils' +import { UniswapSwapQuoteProvider } from './' const rpcUrl = getAlchemyProviderUrl(ChainId.Mainnet) const rpcUrlArbitrum = getAlchemyProviderUrl(ChainId.Arbitrum) @@ -151,7 +151,7 @@ describe.skip('UniswapSwapQuoteProvider', () => { expect(path.length).toBeGreaterThanOrEqual(2) expect(path[0]).toEqual(request.inputToken) expect(path[path.length - 1]).toEqual( - '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' + '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', ) expect(quote.swapData?.fees.length).toBeGreaterThanOrEqual(1) // expect(quote.callData).not.toBe('0x') diff --git a/src/quote/swap/adapters/uniswap/index.ts b/src/quote/swap/adapters/uniswap/index.ts index f23624b3..bf06bddd 100644 --- a/src/quote/swap/adapters/uniswap/index.ts +++ b/src/quote/swap/adapters/uniswap/index.ts @@ -1,12 +1,12 @@ -import axios from 'axios' import { getTokenByChainAndAddress, getTokenByChainAndSymbol, } from '@indexcoop/tokenlists' -import { Token } from '@uniswap/sdk-core' +import type { Token } from '@uniswap/sdk-core' +import axios from 'axios' import { AddressZero, EthAddress } from 'constants/addresses' -import { +import type { SwapQuote, SwapQuoteProvider, SwapQuoteRequest, diff --git a/src/quote/swap/adapters/uniswap/utils/path.ts b/src/quote/swap/adapters/uniswap/utils/path.ts index 1bb9660f..fb32cad3 100644 --- a/src/quote/swap/adapters/uniswap/utils/path.ts +++ b/src/quote/swap/adapters/uniswap/utils/path.ts @@ -1,4 +1,4 @@ -import { Address, encodePacked } from 'viem' +import { type Address, encodePacked } from 'viem' import { isSameAddress } from 'utils' @@ -7,18 +7,18 @@ const weth = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' export function encodePathV3( path: string[], fees: number[], - reverseOrder: boolean + reverseOrder: boolean, ): string { if (reverseOrder) { let encodedPath = encodePacked( ['address'], - [path[path.length - 1] as Address] + [path[path.length - 1] as Address], ) for (let i = 0; i < fees.length; i++) { const index = fees.length - i - 1 encodedPath = encodePacked( ['bytes', 'uint24', 'address'], - [encodedPath as `0x${string}`, fees[index], path[index] as Address] + [encodedPath as `0x${string}`, fees[index], path[index] as Address], ) console.log(encodedPath, i) } @@ -29,7 +29,7 @@ export function encodePathV3( for (let i = 0; i < fees.length; i++) { encodedPath = encodePacked( ['bytes', 'uint24', 'address'], - [encodedPath as `0x${string}`, fees[i], path[i + 1] as Address] + [encodedPath as `0x${string}`, fees[i], path[i + 1] as Address], ) console.log(encodedPath, i) } diff --git a/src/quote/swap/adapters/uniswap/utils/pools.test.ts b/src/quote/swap/adapters/uniswap/utils/pools.test.ts index 54d26f48..df76696a 100644 --- a/src/quote/swap/adapters/uniswap/utils/pools.test.ts +++ b/src/quote/swap/adapters/uniswap/utils/pools.test.ts @@ -8,19 +8,11 @@ import { getPool } from './pools' const rpcUrl = getAlchemyProviderUrl(1) -export const weth = new Token( - 1, - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - 18 -) +const weth = new Token(1, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18) const wstEth = new Token(1, '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0', 18) -export const usdc = new Token( - 1, - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', - 6 -) +const usdc = new Token(1, '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 6) describe('getPool', () => { test('returns pool data for given tokens and fee (100)', async () => { diff --git a/src/quote/swap/adapters/uniswap/utils/pools.ts b/src/quote/swap/adapters/uniswap/utils/pools.ts index 0e2a570a..7d19094f 100644 --- a/src/quote/swap/adapters/uniswap/utils/pools.ts +++ b/src/quote/swap/adapters/uniswap/utils/pools.ts @@ -1,10 +1,10 @@ import { Contract } from '@ethersproject/contracts' -import { Token } from '@uniswap/sdk-core' +import type { Token } from '@uniswap/sdk-core' import IUniswapV3PoolABI from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Pool.sol/IUniswapV3Pool.json' -import { computePoolAddress, FeeAmount } from '@uniswap/v3-sdk' +import { type FeeAmount, computePoolAddress } from '@uniswap/v3-sdk' import { getRpcProvider } from 'utils/rpc-provider' -import { Pool } from '../types' +import type { Pool } from '../types' const POOL_FACTORY_CONTRACT_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984' @@ -16,7 +16,7 @@ export async function getPool( tokenA: Token, tokenB: Token, poolFee: FeeAmount, - rpcUrl: string + rpcUrl: string, ): Promise { const provider = getRpcProvider(rpcUrl) diff --git a/src/quote/swap/adapters/zeroex/0x.test.ts b/src/quote/swap/adapters/zeroex/0x.test.ts index 1252e6ec..8a6e4b41 100644 --- a/src/quote/swap/adapters/zeroex/0x.test.ts +++ b/src/quote/swap/adapters/zeroex/0x.test.ts @@ -115,7 +115,7 @@ describe('ZeroExApi', () => { index0xApiBaseUrl, '', indexApiHeader, - '/mainnet/swap/v1/quote' + '/mainnet/swap/v1/quote', ) const quote = await zeroExApi.getSwapQuote(params, chainId) if (!quote) fail() diff --git a/src/quote/swap/adapters/zeroex/0x.ts b/src/quote/swap/adapters/zeroex/0x.ts index aea5fe2a..1977bfc2 100644 --- a/src/quote/swap/adapters/zeroex/0x.ts +++ b/src/quote/swap/adapters/zeroex/0x.ts @@ -1,4 +1,4 @@ -import axios, { AxiosRequestHeaders } from 'axios' +import axios, { type AxiosRequestHeaders } from 'axios' import { ChainId } from 'constants/chains' @@ -76,7 +76,7 @@ export class ZeroExApi { private readonly baseUrl: string | null = null, private readonly affiliateAddress: string | null = null, private readonly headersOverride: AxiosRequestHeaders | null = null, - private readonly swapPathOverride: string | null = null + private readonly swapPathOverride: string | null = null, ) {} /** @@ -103,7 +103,7 @@ export class ZeroExApi { /* eslint-disable @typescript-eslint/no-explicit-any */ public async getSwapQuote( params: any, - chainId: number + chainId: number, ): Promise { /* eslint-enable @typescript-eslint/no-explicit-any */ const path = this.swapPathOverride ?? '/swap/v1/quote' diff --git a/src/quote/swap/adapters/zeroex/index.test.ts b/src/quote/swap/adapters/zeroex/index.test.ts index e00f56e4..5fe61939 100644 --- a/src/quote/swap/adapters/zeroex/index.test.ts +++ b/src/quote/swap/adapters/zeroex/index.test.ts @@ -88,7 +88,7 @@ describe('ZeroExApi', () => { const zeroExApi = new ZeroExSwapQuoteProvider( baseUrl, affiliateAddress, - indexApiHeader + indexApiHeader, ) const url = zeroExApi.buildUrl('/swap/v1/quote', query, chainId) expect(url).toEqual(expectedUrl) @@ -119,7 +119,7 @@ describe('ZeroExApi', () => { index0xApiBaseUrl, '', indexApiHeader, - '/mainnet/swap/v1/quote' + '/mainnet/swap/v1/quote', ) const quote = await zeroExApi.getSwapQuote(request) if (!quote) fail() diff --git a/src/quote/swap/adapters/zeroex/index.ts b/src/quote/swap/adapters/zeroex/index.ts index d08f1923..a16b6e39 100644 --- a/src/quote/swap/adapters/zeroex/index.ts +++ b/src/quote/swap/adapters/zeroex/index.ts @@ -1,7 +1,7 @@ -import axios, { AxiosRequestHeaders } from 'axios' +import axios, { type AxiosRequestHeaders } from 'axios' import { ChainId } from 'constants/chains' -import { +import type { SwapQuote, SwapQuoteProvider, SwapQuoteRequest, @@ -85,7 +85,7 @@ export class ZeroExSwapQuoteProvider implements SwapQuoteProvider { private readonly baseUrl: string | null = null, private readonly affiliateAddress: string | null = null, private readonly headersOverride: AxiosRequestHeaders | null = null, - private readonly swapPathOverride: string | null = null + private readonly swapPathOverride: string | null = null, ) {} /** @@ -110,7 +110,7 @@ export class ZeroExSwapQuoteProvider implements SwapQuoteProvider { * @param request An instance of type SwapQuoteRequest */ public async getSwapQuote( - request: SwapQuoteRequest + request: SwapQuoteRequest, ): Promise { const { chainId, inputToken, outputToken, slippage } = request const params = this.getParams(request) diff --git a/src/quote/swap/adapters/zeroex/swap-data.test.ts b/src/quote/swap/adapters/zeroex/swap-data.test.ts index 4d04ed75..ad704fb4 100644 --- a/src/quote/swap/adapters/zeroex/swap-data.test.ts +++ b/src/quote/swap/adapters/zeroex/swap-data.test.ts @@ -21,7 +21,7 @@ describe('getEchangeFrom0xKey()', () => { const sushi = getEchangeFrom0xKey('SushiSwap') const uniswap = getEchangeFrom0xKey('Uniswap_V3') expect( - Object.keys(Exchange).filter((key) => isNaN(Number(key))).length + Object.keys(Exchange).filter((key) => Number.isNaN(Number(key))).length, ).toEqual(6) expect(balancer).toEqual(Exchange.BalancerV2) expect(curve).toEqual(Exchange.Curve) @@ -113,7 +113,7 @@ describe('swapDataFrom0xQuote()', () => { expect(swapData).not.toBeNull() expect(swapData?.exchange).toEqual(Exchange.UniV3) expect(swapData?.path).toEqual( - zeroExQuote.orders[0].fillData.tokenAddressPath + zeroExQuote.orders[0].fillData.tokenAddressPath, ) expect(swapData?.pool).toEqual('0x0000000000000000000000000000000000000000') expect(swapData?.fees).toEqual([500]) diff --git a/src/quote/swap/adapters/zeroex/swap-data.ts b/src/quote/swap/adapters/zeroex/swap-data.ts index 920ef1a0..0c1a63c3 100644 --- a/src/quote/swap/adapters/zeroex/swap-data.ts +++ b/src/quote/swap/adapters/zeroex/swap-data.ts @@ -1,14 +1,14 @@ +import { Exchange, type SwapData } from 'utils' import { decodePool, extractPoolFees } from 'utils/UniswapPath' -import { Exchange, SwapData } from 'utils' -import { +import type { ZeroExApiSwapResponse, ZeroExApiSwapResponseOrder, ZeroExApiSwapResponseOrderSushi, } from './0x' export const getSwapData = async ( - zeroExQuote: ZeroExApiSwapResponse | null + zeroExQuote: ZeroExApiSwapResponse | null, ) => { if (!zeroExQuote) return null return swapDataFrom0xQuote(zeroExQuote) @@ -48,7 +48,7 @@ export function get0xEchangeKey(exchange: Exchange): string { } export function swapDataFrom0xQuote( - zeroExQuote: ZeroExApiSwapResponse + zeroExQuote: ZeroExApiSwapResponse, ): SwapData | null { if ( zeroExQuote === undefined || @@ -109,7 +109,7 @@ function swapDataFromCurve(order: ZeroExApiSwapResponseOrder): SwapData | null { } function swapDataFromSushi( - order: ZeroExApiSwapResponseOrderSushi + order: ZeroExApiSwapResponseOrderSushi, ): SwapData | null { const fillData = order.fillData if (!fillData) return null diff --git a/src/quote/swap/interfaces.ts b/src/quote/swap/interfaces.ts index f53d430a..f9296b7f 100644 --- a/src/quote/swap/interfaces.ts +++ b/src/quote/swap/interfaces.ts @@ -1,4 +1,4 @@ -import { Exchange, SwapData } from 'utils' +import type { Exchange, SwapData } from 'utils' // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface SwapQuote { diff --git a/src/tests/arbitrum/btc2x.test.ts b/src/tests/arbitrum/btc2x.test.ts index b9aa3829..e83da433 100644 --- a/src/tests/arbitrum/btc2x.test.ts +++ b/src/tests/arbitrum/btc2x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/btc2xeth.test.ts b/src/tests/arbitrum/btc2xeth.test.ts index a5856311..155ab354 100644 --- a/src/tests/arbitrum/btc2xeth.test.ts +++ b/src/tests/arbitrum/btc2xeth.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/btc3x.test.ts b/src/tests/arbitrum/btc3x.test.ts index 1d4d99a7..97e8f708 100644 --- a/src/tests/arbitrum/btc3x.test.ts +++ b/src/tests/arbitrum/btc3x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/eth2x.test.ts b/src/tests/arbitrum/eth2x.test.ts index a86af392..e718fb31 100644 --- a/src/tests/arbitrum/eth2x.test.ts +++ b/src/tests/arbitrum/eth2x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/eth2xbtc.test.ts b/src/tests/arbitrum/eth2xbtc.test.ts index eb63929e..7c7f6935 100644 --- a/src/tests/arbitrum/eth2xbtc.test.ts +++ b/src/tests/arbitrum/eth2xbtc.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/eth3x.test.ts b/src/tests/arbitrum/eth3x.test.ts index 21529345..ba06c10c 100644 --- a/src/tests/arbitrum/eth3x.test.ts +++ b/src/tests/arbitrum/eth3x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/ibtc1x.test.ts b/src/tests/arbitrum/ibtc1x.test.ts index e64d129e..a22722df 100644 --- a/src/tests/arbitrum/ibtc1x.test.ts +++ b/src/tests/arbitrum/ibtc1x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/arbitrum/ieth1x.test.ts b/src/tests/arbitrum/ieth1x.test.ts index 0ceebacc..70aa4ac2 100644 --- a/src/tests/arbitrum/ieth1x.test.ts +++ b/src/tests/arbitrum/ieth1x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getArbitrumTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/base/eth2x.test.ts b/src/tests/base/eth2x.test.ts index 865457c3..b0e31d92 100644 --- a/src/tests/base/eth2x.test.ts +++ b/src/tests/base/eth2x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getBaseTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/base/eth3x.test.ts b/src/tests/base/eth3x.test.ts index 58322fd1..91f2261c 100644 --- a/src/tests/base/eth3x.test.ts +++ b/src/tests/base/eth3x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + QuoteTokens, + type TestFactory, getBaseTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from 'tests/utils' diff --git a/src/tests/btc2x.test.ts b/src/tests/btc2x.test.ts index 03c4591e..9631a657 100644 --- a/src/tests/btc2x.test.ts +++ b/src/tests/btc2x.test.ts @@ -1,10 +1,10 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { + QuoteTokens, getMainnetTestFactory, getMainnetTestFactoryUniswap, getSignerAccount, getTestRpcProvider, - QuoteTokens, wei, } from './utils' diff --git a/src/tests/dseth/index.test.ts b/src/tests/dseth/index.test.ts index 10b8e210..7fd899ca 100644 --- a/src/tests/dseth/index.test.ts +++ b/src/tests/dseth/index.test.ts @@ -1,16 +1,16 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { + QuoteTokens, + type TestFactory, addLiquidityToLido, getMainnetTestFactory, - QuoteTokens, - TestFactory, + getSignerAccount, + getTestRpcProvider, swapExactInput, transferFromWhale, wei, wrapETH, - getSignerAccount, - getTestRpcProvider, } from '../utils' describe('dsETH (mainnet)', () => { @@ -82,7 +82,7 @@ describe('dsETH (mainnet)', () => { factory.getSigner().address, quote.inputOutputAmount, quote.inputToken.address, - factory.getProvider() + factory.getProvider(), ) await factory.executeTx() }) @@ -118,7 +118,7 @@ describe('dsETH (mainnet)', () => { amountOutMin: wei('1.5'), }, factory.getProvider(), - factory.getSigner() + factory.getSigner(), ) await factory.executeTx() }) @@ -171,7 +171,7 @@ describe('dsETH (mainnet)', () => { factory.getSigner().address, wei('10000', quote.inputToken.decimals), quote.inputToken.address, - factory.getProvider() + factory.getProvider(), ) await factory.executeTx() }) diff --git a/src/tests/eth2x.test.ts b/src/tests/eth2x.test.ts index 675a5055..e00bfb4f 100644 --- a/src/tests/eth2x.test.ts +++ b/src/tests/eth2x.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { + QuoteTokens, + type TestFactory, getMainnetTestFactory, getMainnetTestFactoryUniswap, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, } from './utils' diff --git a/src/tests/hyeth.test.ts b/src/tests/hyeth.test.ts index 8e22fd13..7e673af1 100644 --- a/src/tests/hyeth.test.ts +++ b/src/tests/hyeth.test.ts @@ -1,11 +1,11 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { + QuoteTokens, + type TestFactory, balanceOf, getMainnetTestFactory, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, transferFromWhale, wei, wrapETH, @@ -70,11 +70,11 @@ describe('hyETH', () => { factory.getSigner().address, wei('100000', quote.inputToken.decimals), quote.inputToken.address, - factory.getProvider() + factory.getProvider(), ) const usdcBalance = await balanceOf( factory.getSigner(), - quote.inputToken.address + quote.inputToken.address, ) console.log('usdc balance:', usdcBalance.toString()) await factory.executeTx() diff --git a/src/tests/iceth.test.ts b/src/tests/iceth.test.ts index e73dec0d..0e5f52d7 100644 --- a/src/tests/iceth.test.ts +++ b/src/tests/iceth.test.ts @@ -2,12 +2,12 @@ import { BigNumber } from '@ethersproject/bignumber' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { + QuoteTokens, + type TestFactory, getMainnetTestFactory, getMainnetTestFactoryUniswap, getSignerAccount, getTestRpcProvider, - QuoteTokens, - TestFactory, wei, wrapETH, } from './utils' diff --git a/src/tests/icusd.test.ts b/src/tests/icusd.test.ts index cfa87510..68e01870 100644 --- a/src/tests/icusd.test.ts +++ b/src/tests/icusd.test.ts @@ -3,10 +3,10 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' import { + type TestFactory, getBaseTestFactory, getSignerAccount, getTestRpcProvider, - TestFactory, transferFromWhale, wei, wrapETH, @@ -39,7 +39,7 @@ describe('icUSD (Base)', () => { factory.getSigner().address, wei('10000', quote.inputToken.decimals), quote.inputToken.address, - factory.getProvider() + factory.getProvider(), ) await factory.executeTx() }) @@ -57,7 +57,7 @@ describe('icUSD (Base)', () => { await wrapETH( BigNumber.from(quote.inputAmount.mul(BigNumber.from('2'))), factory.getSigner(), - chainId + chainId, ) await factory.executeTx() }) @@ -77,7 +77,7 @@ describe('icUSD (Base)', () => { factory.getSigner().address, wei('10000', quote.inputToken.decimals), quote.inputToken.address, - factory.getProvider() + factory.getProvider(), ) await factory.executeTx() }) diff --git a/src/tests/utils/UniswapV3PoolAbi.json b/src/tests/utils/UniswapV3PoolAbi.json index 773ce150..d8e7f4cf 100644 --- a/src/tests/utils/UniswapV3PoolAbi.json +++ b/src/tests/utils/UniswapV3PoolAbi.json @@ -1,692 +1,692 @@ [ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "int24", - "name": "tickLower", - "type": "int24" - }, - { - "indexed": true, - "internalType": "int24", - "name": "tickUpper", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "amount", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - } - ], - "name": "Burn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": true, - "internalType": "int24", - "name": "tickLower", - "type": "int24" - }, - { - "indexed": true, - "internalType": "int24", - "name": "tickUpper", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "amount0", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "amount1", - "type": "uint128" - } - ], - "name": "Collect", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "amount0", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "amount1", - "type": "uint128" - } - ], - "name": "CollectProtocol", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "paid0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "paid1", - "type": "uint256" - } - ], - "name": "Flash", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "observationCardinalityNextOld", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "observationCardinalityNextNew", - "type": "uint16" - } - ], - "name": "IncreaseObservationCardinalityNext", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint160", - "name": "sqrtPriceX96", - "type": "uint160" - }, - { - "indexed": false, - "internalType": "int24", - "name": "tick", - "type": "int24" - } - ], - "name": "Initialize", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "int24", - "name": "tickLower", - "type": "int24" - }, - { - "indexed": true, - "internalType": "int24", - "name": "tickUpper", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "amount", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - } - ], - "name": "Mint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "feeProtocol0Old", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "feeProtocol1Old", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "feeProtocol0New", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "feeProtocol1New", - "type": "uint8" - } - ], - "name": "SetFeeProtocol", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "int256", - "name": "amount0", - "type": "int256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "amount1", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint160", - "name": "sqrtPriceX96", - "type": "uint160" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidity", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "int24", - "name": "tick", - "type": "int24" - } - ], - "name": "Swap", - "type": "event" - }, - { - "inputs": [ - { "internalType": "int24", "name": "tickLower", "type": "int24" }, - { "internalType": "int24", "name": "tickUpper", "type": "int24" }, - { "internalType": "uint128", "name": "amount", "type": "uint128" } - ], - "name": "burn", - "outputs": [ - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "int24", "name": "tickLower", "type": "int24" }, - { "internalType": "int24", "name": "tickUpper", "type": "int24" }, - { - "internalType": "uint128", - "name": "amount0Requested", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "amount1Requested", - "type": "uint128" - } - ], - "name": "collect", - "outputs": [ - { "internalType": "uint128", "name": "amount0", "type": "uint128" }, - { "internalType": "uint128", "name": "amount1", "type": "uint128" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { - "internalType": "uint128", - "name": "amount0Requested", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "amount1Requested", - "type": "uint128" - } - ], - "name": "collectProtocol", - "outputs": [ - { "internalType": "uint128", "name": "amount0", "type": "uint128" }, - { "internalType": "uint128", "name": "amount1", "type": "uint128" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fee", - "outputs": [{ "internalType": "uint24", "name": "", "type": "uint24" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "feeGrowthGlobal0X128", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "feeGrowthGlobal1X128", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "flash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "observationCardinalityNext", - "type": "uint16" - } - ], - "name": "increaseObservationCardinalityNext", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "liquidity", - "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxLiquidityPerTick", - "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "int24", "name": "tickLower", "type": "int24" }, - { "internalType": "int24", "name": "tickUpper", "type": "int24" }, - { "internalType": "uint128", "name": "amount", "type": "uint128" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "mint", - "outputs": [ - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "observations", - "outputs": [ - { "internalType": "uint32", "name": "blockTimestamp", "type": "uint32" }, - { "internalType": "int56", "name": "tickCumulative", "type": "int56" }, - { - "internalType": "uint160", - "name": "secondsPerLiquidityCumulativeX128", - "type": "uint160" - }, - { "internalType": "bool", "name": "initialized", "type": "bool" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint32[]", "name": "secondsAgos", "type": "uint32[]" } - ], - "name": "observe", - "outputs": [ - { - "internalType": "int56[]", - "name": "tickCumulatives", - "type": "int56[]" - }, - { - "internalType": "uint160[]", - "name": "secondsPerLiquidityCumulativeX128s", - "type": "uint160[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "name": "positions", - "outputs": [ - { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, - { - "internalType": "uint256", - "name": "feeGrowthInside0LastX128", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeGrowthInside1LastX128", - "type": "uint256" - }, - { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, - { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolFees", - "outputs": [ - { "internalType": "uint128", "name": "token0", "type": "uint128" }, - { "internalType": "uint128", "name": "token1", "type": "uint128" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint8", "name": "feeProtocol0", "type": "uint8" }, - { "internalType": "uint8", "name": "feeProtocol1", "type": "uint8" } - ], - "name": "setFeeProtocol", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "slot0", - "outputs": [ - { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" }, - { "internalType": "int24", "name": "tick", "type": "int24" }, - { - "internalType": "uint16", - "name": "observationIndex", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "observationCardinality", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "observationCardinalityNext", - "type": "uint16" - }, - { "internalType": "uint8", "name": "feeProtocol", "type": "uint8" }, - { "internalType": "bool", "name": "unlocked", "type": "bool" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "int24", "name": "tickLower", "type": "int24" }, - { "internalType": "int24", "name": "tickUpper", "type": "int24" } - ], - "name": "snapshotCumulativesInside", - "outputs": [ - { - "internalType": "int56", - "name": "tickCumulativeInside", - "type": "int56" - }, - { - "internalType": "uint160", - "name": "secondsPerLiquidityInsideX128", - "type": "uint160" - }, - { "internalType": "uint32", "name": "secondsInside", "type": "uint32" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "bool", "name": "zeroForOne", "type": "bool" }, - { "internalType": "int256", "name": "amountSpecified", "type": "int256" }, - { - "internalType": "uint160", - "name": "sqrtPriceLimitX96", - "type": "uint160" - }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "swap", - "outputs": [ - { "internalType": "int256", "name": "amount0", "type": "int256" }, - { "internalType": "int256", "name": "amount1", "type": "int256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "int16", "name": "", "type": "int16" }], - "name": "tickBitmap", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tickSpacing", - "outputs": [{ "internalType": "int24", "name": "", "type": "int24" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "int24", "name": "", "type": "int24" }], - "name": "ticks", - "outputs": [ - { - "internalType": "uint128", - "name": "liquidityGross", - "type": "uint128" - }, - { "internalType": "int128", "name": "liquidityNet", "type": "int128" }, - { - "internalType": "uint256", - "name": "feeGrowthOutside0X128", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeGrowthOutside1X128", - "type": "uint256" - }, - { - "internalType": "int56", - "name": "tickCumulativeOutside", - "type": "int56" - }, - { - "internalType": "uint160", - "name": "secondsPerLiquidityOutsideX128", - "type": "uint160" - }, - { "internalType": "uint32", "name": "secondsOutside", "type": "uint32" }, - { "internalType": "bool", "name": "initialized", "type": "bool" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token0", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - } + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount0", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount1", + "type": "uint128" + } + ], + "name": "Collect", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount0", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount1", + "type": "uint128" + } + ], + "name": "CollectProtocol", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paid0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paid1", + "type": "uint256" + } + ], + "name": "Flash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "observationCardinalityNextOld", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "observationCardinalityNextNew", + "type": "uint16" + } + ], + "name": "IncreaseObservationCardinalityNext", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + }, + { + "indexed": false, + "internalType": "int24", + "name": "tick", + "type": "int24" + } + ], + "name": "Initialize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol0Old", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol1Old", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol0New", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol1New", + "type": "uint8" + } + ], + "name": "SetFeeProtocol", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount0", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount1", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidity", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int24", + "name": "tick", + "type": "int24" + } + ], + "name": "Swap", + "type": "event" + }, + { + "inputs": [ + { "internalType": "int24", "name": "tickLower", "type": "int24" }, + { "internalType": "int24", "name": "tickUpper", "type": "int24" }, + { "internalType": "uint128", "name": "amount", "type": "uint128" } + ], + "name": "burn", + "outputs": [ + { "internalType": "uint256", "name": "amount0", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "int24", "name": "tickLower", "type": "int24" }, + { "internalType": "int24", "name": "tickUpper", "type": "int24" }, + { + "internalType": "uint128", + "name": "amount0Requested", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount1Requested", + "type": "uint128" + } + ], + "name": "collect", + "outputs": [ + { "internalType": "uint128", "name": "amount0", "type": "uint128" }, + { "internalType": "uint128", "name": "amount1", "type": "uint128" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { + "internalType": "uint128", + "name": "amount0Requested", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount1Requested", + "type": "uint128" + } + ], + "name": "collectProtocol", + "outputs": [ + { "internalType": "uint128", "name": "amount0", "type": "uint128" }, + { "internalType": "uint128", "name": "amount1", "type": "uint128" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fee", + "outputs": [{ "internalType": "uint24", "name": "", "type": "uint24" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeGrowthGlobal0X128", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeGrowthGlobal1X128", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount0", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1", "type": "uint256" }, + { "internalType": "bytes", "name": "data", "type": "bytes" } + ], + "name": "flash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "observationCardinalityNext", + "type": "uint16" + } + ], + "name": "increaseObservationCardinalityNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidity", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLiquidityPerTick", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "int24", "name": "tickLower", "type": "int24" }, + { "internalType": "int24", "name": "tickUpper", "type": "int24" }, + { "internalType": "uint128", "name": "amount", "type": "uint128" }, + { "internalType": "bytes", "name": "data", "type": "bytes" } + ], + "name": "mint", + "outputs": [ + { "internalType": "uint256", "name": "amount0", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "observations", + "outputs": [ + { "internalType": "uint32", "name": "blockTimestamp", "type": "uint32" }, + { "internalType": "int56", "name": "tickCumulative", "type": "int56" }, + { + "internalType": "uint160", + "name": "secondsPerLiquidityCumulativeX128", + "type": "uint160" + }, + { "internalType": "bool", "name": "initialized", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint32[]", "name": "secondsAgos", "type": "uint32[]" } + ], + "name": "observe", + "outputs": [ + { + "internalType": "int56[]", + "name": "tickCumulatives", + "type": "int56[]" + }, + { + "internalType": "uint160[]", + "name": "secondsPerLiquidityCumulativeX128s", + "type": "uint160[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "name": "positions", + "outputs": [ + { "internalType": "uint128", "name": "liquidity", "type": "uint128" }, + { + "internalType": "uint256", + "name": "feeGrowthInside0LastX128", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeGrowthInside1LastX128", + "type": "uint256" + }, + { "internalType": "uint128", "name": "tokensOwed0", "type": "uint128" }, + { "internalType": "uint128", "name": "tokensOwed1", "type": "uint128" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolFees", + "outputs": [ + { "internalType": "uint128", "name": "token0", "type": "uint128" }, + { "internalType": "uint128", "name": "token1", "type": "uint128" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "feeProtocol0", "type": "uint8" }, + { "internalType": "uint8", "name": "feeProtocol1", "type": "uint8" } + ], + "name": "setFeeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "slot0", + "outputs": [ + { "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" }, + { "internalType": "int24", "name": "tick", "type": "int24" }, + { + "internalType": "uint16", + "name": "observationIndex", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "observationCardinality", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "observationCardinalityNext", + "type": "uint16" + }, + { "internalType": "uint8", "name": "feeProtocol", "type": "uint8" }, + { "internalType": "bool", "name": "unlocked", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "int24", "name": "tickLower", "type": "int24" }, + { "internalType": "int24", "name": "tickUpper", "type": "int24" } + ], + "name": "snapshotCumulativesInside", + "outputs": [ + { + "internalType": "int56", + "name": "tickCumulativeInside", + "type": "int56" + }, + { + "internalType": "uint160", + "name": "secondsPerLiquidityInsideX128", + "type": "uint160" + }, + { "internalType": "uint32", "name": "secondsInside", "type": "uint32" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bool", "name": "zeroForOne", "type": "bool" }, + { "internalType": "int256", "name": "amountSpecified", "type": "int256" }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + }, + { "internalType": "bytes", "name": "data", "type": "bytes" } + ], + "name": "swap", + "outputs": [ + { "internalType": "int256", "name": "amount0", "type": "int256" }, + { "internalType": "int256", "name": "amount1", "type": "int256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "int16", "name": "", "type": "int16" }], + "name": "tickBitmap", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tickSpacing", + "outputs": [{ "internalType": "int24", "name": "", "type": "int24" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "int24", "name": "", "type": "int24" }], + "name": "ticks", + "outputs": [ + { + "internalType": "uint128", + "name": "liquidityGross", + "type": "uint128" + }, + { "internalType": "int128", "name": "liquidityNet", "type": "int128" }, + { + "internalType": "uint256", + "name": "feeGrowthOutside0X128", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeGrowthOutside1X128", + "type": "uint256" + }, + { + "internalType": "int56", + "name": "tickCumulativeOutside", + "type": "int56" + }, + { + "internalType": "uint160", + "name": "secondsPerLiquidityOutsideX128", + "type": "uint160" + }, + { "internalType": "uint32", "name": "secondsOutside", "type": "uint32" }, + { "internalType": "bool", "name": "initialized", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token0", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token1", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } ] diff --git a/src/tests/utils/erc20.ts b/src/tests/utils/erc20.ts index 1bdd8020..9184282e 100644 --- a/src/tests/utils/erc20.ts +++ b/src/tests/utils/erc20.ts @@ -1,13 +1,13 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' -import { JsonRpcProvider, JsonRpcSigner } from '@ethersproject/providers' -import { Wallet } from '@ethersproject/wallet' +import type { JsonRpcProvider, JsonRpcSigner } from '@ethersproject/providers' +import type { Wallet } from '@ethersproject/wallet' export { wei } from 'utils/numbers' export function createERC20Contract( erc20Address: string, - providerOrSigner: JsonRpcProvider | JsonRpcSigner | Wallet + providerOrSigner: JsonRpcProvider | JsonRpcSigner | Wallet, ): Contract { const abi = [ // Read-Only Functions @@ -26,7 +26,7 @@ export async function approveErc20( erc20Address: string, spender: string, amount: BigNumber, - signer: Wallet + signer: Wallet, ) { const contract = createERC20Contract(erc20Address, signer) const approveTx = await contract.approve(spender, amount, { @@ -38,7 +38,7 @@ export async function approveErc20( export async function allowanceOf( erc20Address: string, spender: string, - signer: Wallet + signer: Wallet, ): Promise { const contract = createERC20Contract(erc20Address, signer) return await contract.allowance(signer.address, spender) @@ -46,7 +46,7 @@ export async function allowanceOf( export async function balanceOf( signer: Wallet, - erc20Address: string + erc20Address: string, ): Promise { const contract = createERC20Contract(erc20Address, signer) return await contract.balanceOf(signer.address) @@ -57,14 +57,14 @@ export async function transferFromWhale( to: string, amount: BigNumber, erc20Address: string, - provider: JsonRpcProvider + provider: JsonRpcProvider, ) { const signer = await provider.getSigner(whale) const contract = createERC20Contract(erc20Address, signer) const balance = await contract.balanceOf(whale) if (balance.lt(amount)) { throw new Error( - `Not enough balance to steal ${amount} ${erc20Address} from ${whale}: ${balance}` + `Not enough balance to steal ${amount} ${erc20Address} from ${whale}: ${balance}`, ) } await provider.send('hardhat_impersonateAccount', [whale]) diff --git a/src/tests/utils/factories.ts b/src/tests/utils/factories.ts index b38d41d4..606b04cf 100644 --- a/src/tests/utils/factories.ts +++ b/src/tests/utils/factories.ts @@ -10,7 +10,7 @@ import { TestFactory } from 'tests/utils/factory' // Pre-configured TestFactories export function getArbitrumTestFactory( signer: any, - rpcUrl: string = getLocalHostProviderUrl(ChainId.Arbitrum) + rpcUrl: string = getLocalHostProviderUrl(ChainId.Arbitrum), ) { const swapQuoteProvider = getZeroExSwapQuoteProvider(ChainId.Arbitrum) return new TestFactory(rpcUrl, signer, swapQuoteProvider) @@ -18,7 +18,7 @@ export function getArbitrumTestFactory( export function getBaseTestFactory( signer: any, - rpcUrl: string = getLocalHostProviderUrl(ChainId.Base) + rpcUrl: string = getLocalHostProviderUrl(ChainId.Base), ) { const swapQuoteProvider = getZeroExSwapQuoteProvider(ChainId.Base) return new TestFactory(rpcUrl, signer, swapQuoteProvider) @@ -26,7 +26,7 @@ export function getBaseTestFactory( export function getMainnetTestFactory( signer: any, - rpcUrl: string = getLocalHostProviderUrl(ChainId.Mainnet) + rpcUrl: string = getLocalHostProviderUrl(ChainId.Mainnet), ) { const swapQuoteProvider = getZeroExSwapQuoteProvider(ChainId.Mainnet) return new TestFactory(rpcUrl, signer, swapQuoteProvider) @@ -34,7 +34,7 @@ export function getMainnetTestFactory( export function getMainnetTestFactoryUniswap( signer: any, - rpcUrl: string = getLocalHostProviderUrl(ChainId.Mainnet) + rpcUrl: string = getLocalHostProviderUrl(ChainId.Mainnet), ) { const swapQuoteProvider = new IndexSwapQuoteProvider(rpcUrl) return new TestFactory(rpcUrl, signer, swapQuoteProvider) diff --git a/src/tests/utils/factory.ts b/src/tests/utils/factory.ts index c05b8824..187cfd06 100644 --- a/src/tests/utils/factory.ts +++ b/src/tests/utils/factory.ts @@ -1,18 +1,21 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { JsonRpcProvider } from '@ethersproject/providers' -import { Wallet } from '@ethersproject/wallet' +import type { Wallet } from '@ethersproject/wallet' import { - FlashMintQuote, + type FlashMintQuote, FlashMintQuoteProvider, - FlashMintQuoteRequest, - SwapQuoteProvider, + type FlashMintQuoteRequest, + type SwapQuoteProvider, } from 'quote' import { approveErc20, balanceOf } from './' class TxTestFactory { - constructor(readonly provider: JsonRpcProvider, readonly signer: Wallet) {} + constructor( + readonly provider: JsonRpcProvider, + readonly signer: Wallet, + ) {} /** * Tests minting a given flash mint quote. @@ -29,7 +32,7 @@ class TxTestFactory { quote.inputToken.address, quote.contract, quote.inputOutputAmount, - signer + signer, ) } // Automatically adding from as it seems like estimateGas won't recognize @@ -41,7 +44,7 @@ class TxTestFactory { res.wait() const balanceAfter: BigNumber = await balanceOf(signer, indexToken.address) expect(balanceAfter.gte(balanceBefore.add(quote.indexTokenAmount))).toBe( - true + true, ) } @@ -58,7 +61,7 @@ class TxTestFactory { indexToken.address, quote.contract, quote.indexTokenAmount, - signer + signer, ) const tx = quote.tx if (!tx) fail() @@ -74,7 +77,7 @@ class TxTestFactory { res.wait() const balanceAfter: BigNumber = await balanceOf(signer, indexToken.address) expect(balanceAfter.lte(balanceBefore.sub(quote.indexTokenAmount))).toBe( - true + true, ) } } @@ -86,7 +89,7 @@ export class TestFactory { constructor( rpcUrl: string, signer: Wallet, - swapQuoteProvider: SwapQuoteProvider + swapQuoteProvider: SwapQuoteProvider, ) { const provider = new JsonRpcProvider(rpcUrl) this.quoteProvider = new FlashMintQuoteProvider(rpcUrl, swapQuoteProvider) diff --git a/src/tests/utils/lido.ts b/src/tests/utils/lido.ts index 7c317bbf..e3863921 100644 --- a/src/tests/utils/lido.ts +++ b/src/tests/utils/lido.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' -import { Wallet } from '@ethersproject/wallet' +import type { Wallet } from '@ethersproject/wallet' const LIDO = '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84' @@ -9,7 +9,7 @@ export async function addLiquidityToLido(amount: BigNumber, signer: Wallet) { const contract = new Contract(LIDO, LIDO_ABI, signer) const gasEstimate = await contract.estimateGas.submit( '0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B', - { value: amount } + { value: amount }, ) await contract.submit('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B', { gasLimit: gasEstimate, diff --git a/src/tests/utils/quoteTokens.ts b/src/tests/utils/quoteTokens.ts index 7b6527bb..5e4080e3 100644 --- a/src/tests/utils/quoteTokens.ts +++ b/src/tests/utils/quoteTokens.ts @@ -6,7 +6,7 @@ import { WETH, stETH, } from 'constants/tokens' -import { QuoteToken } from 'quote/interfaces' +import type { QuoteToken } from 'quote/interfaces' const btc2x: QuoteToken = { address: IndexCoopBitcoin2xIndex.address!, diff --git a/src/tests/utils/signers.ts b/src/tests/utils/signers.ts index 8156a755..dcd5c9fc 100644 --- a/src/tests/utils/signers.ts +++ b/src/tests/utils/signers.ts @@ -1,9 +1,9 @@ -import { JsonRpcProvider } from '@ethersproject/providers' +import type { JsonRpcProvider } from '@ethersproject/providers' import { Wallet } from '@ethersproject/wallet' export { wei } from 'utils/numbers' -export function getSignerAccount(num = 0, provider: JsonRpcProvider) { +export function getSignerAccount(num: number, provider: JsonRpcProvider) { let privateKey = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' switch (num) { diff --git a/src/tests/utils/uniswap.ts b/src/tests/utils/uniswap.ts index 7c0bc41b..32f9db05 100644 --- a/src/tests/utils/uniswap.ts +++ b/src/tests/utils/uniswap.ts @@ -1,7 +1,7 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' -import { JsonRpcProvider } from '@ethersproject/providers' -import { Wallet } from '@ethersproject/wallet' +import type { JsonRpcProvider } from '@ethersproject/providers' +import type { Wallet } from '@ethersproject/wallet' import { createERC20Contract } from '.' // import UniswapV3PoolAbi from './UniswapV3PoolAbi.json' @@ -28,7 +28,7 @@ export async function swapExactInput( poolAddress: string, swapParams: SwapExactInputParams, provider: JsonRpcProvider, - signer: Wallet + signer: Wallet, ) { // Get pool state to fetch the `sqrtPriceX96` // const poolContract = new Contract(poolAddress, UniswapV3PoolAbi, provider) @@ -39,7 +39,7 @@ export async function swapExactInput( const uniswap = new Contract( UNISWAPV3_SWAPROUTER_ADDRESS, UNISWAPV3_SWAPROUTER_ABI, - signer + signer, ) // On UniswapV3 the input token amount has to be approved before swapping diff --git a/src/tests/utils/weth.ts b/src/tests/utils/weth.ts index 59d33440..823abd40 100644 --- a/src/tests/utils/weth.ts +++ b/src/tests/utils/weth.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' -import { Wallet } from '@ethersproject/wallet' +import type { Wallet } from '@ethersproject/wallet' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { ChainId } from 'constants/chains' @@ -10,7 +10,7 @@ export { wei } from 'utils/numbers' export async function wrapETH( amount: BigNumber, signer: Wallet, - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ) { const abi = ['function deposit() public payable'] const WETH9 = getTokenByChainAndSymbol(chainId, 'WETH')!.address diff --git a/src/tests/utils/zeroex.ts b/src/tests/utils/zeroex.ts index aa2d3242..b54d682a 100644 --- a/src/tests/utils/zeroex.ts +++ b/src/tests/utils/zeroex.ts @@ -19,6 +19,6 @@ export function getZeroExSwapQuoteProvider(chainId: number) { '', // eslint-disable-next-line @typescript-eslint/no-non-null-assertion { 'X-INDEXCOOP-API-KEY': process.env.INDEX_0X_API_KEY! }, - get0xSwapPathOverride(chainId) + get0xSwapPathOverride(chainId), ) } diff --git a/src/utils/UniswapPath.ts b/src/utils/UniswapPath.ts index de0e415b..0b3a9e73 100644 --- a/src/utils/UniswapPath.ts +++ b/src/utils/UniswapPath.ts @@ -3,7 +3,7 @@ const ADDR_SIZE = 40 const FEE_SIZE = 6 // 0001f47 -const hexToDecimal = (hex: string) => parseInt(hex, 16) +const hexToDecimal = (hex: string) => Number.parseInt(hex, 16) /** * Returns tokens and fees for pool diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index 79e92611..1e0df9f3 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -1,4 +1,4 @@ -import { Address, isAddressEqual } from 'viem' +import { type Address, isAddressEqual } from 'viem' export function isSameAddress(address1: string, address2: string): boolean { return isAddressEqual(address1 as Address, address2 as Address) diff --git a/src/utils/clients.ts b/src/utils/clients.ts index 154cf02e..581bbda4 100644 --- a/src/utils/clients.ts +++ b/src/utils/clients.ts @@ -1,4 +1,4 @@ -import { createPublicClient, http } from 'viem' +import { http, createPublicClient } from 'viem' import { base, mainnet } from 'viem/chains' import { ChainId } from 'constants/chains' diff --git a/src/utils/component-swap-data.test.ts b/src/utils/component-swap-data.test.ts index e9be7644..a9786645 100644 --- a/src/utils/component-swap-data.test.ts +++ b/src/utils/component-swap-data.test.ts @@ -1,19 +1,19 @@ import { AddressZero } from 'constants/addresses' import { ChainId } from 'constants/chains' -import { - getIssuanceComponentSwapData, - getRedemptionComponentSwapData, -} from 'utils/component-swap-data' -import { wei } from 'utils/numbers' +import { BigNumber } from '@ethersproject/bignumber' +import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import { getLocalHostProviderUrl, getZeroExSwapQuoteProvider, } from 'tests/utils' import { isSameAddress } from 'utils/addresses' +import { + getIssuanceComponentSwapData, + getRedemptionComponentSwapData, +} from 'utils/component-swap-data' +import { wei } from 'utils/numbers' import { Exchange } from 'utils/swap-data' -import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' -import { BigNumber } from '@ethersproject/bignumber' const chainId = ChainId.Base const rpcUrl = getLocalHostProviderUrl(chainId) @@ -36,12 +36,12 @@ describe('getIssuanceComponentSwapData()', () => { indexTokenAmount: wei(1), }, rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) expect(componentSwapData.length).toBe(8) for (let i = 0; i < componentSwapData.length; i++) { expect(isSameAddress(componentSwapData[i].underlyingERC20, usdc)).toBe( - true + true, ) // Should be empty as input token is equal to output token (underlying erc20) const dexData = componentSwapData[i].dexData @@ -51,7 +51,7 @@ describe('getIssuanceComponentSwapData()', () => { expect(dexData.pool).toEqual(AddressZero) expect(dexData.poolIds).toEqual([]) expect( - componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)) + componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)), ).toBe(true) } }) @@ -66,12 +66,12 @@ describe('getIssuanceComponentSwapData()', () => { indexTokenAmount: wei(1), }, rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) expect(componentSwapData.length).toBe(8) for (let i = 0; i < componentSwapData.length; i++) { expect(isSameAddress(componentSwapData[i].underlyingERC20, usdc)).toBe( - true + true, ) const dexData = componentSwapData[i].dexData expect(dexData.exchange).toEqual(Exchange.UniV3) @@ -81,7 +81,7 @@ describe('getIssuanceComponentSwapData()', () => { expect(dexData.pool).toEqual(AddressZero) expect(dexData.poolIds).toEqual([]) expect( - componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)) + componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)), ).toBe(true) } }) @@ -98,12 +98,12 @@ describe('getRedemptionComponentSwapData()', () => { indexTokenAmount: wei(1), }, rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) expect(componentSwapData.length).toBe(8) for (let i = 0; i < componentSwapData.length; i++) { expect(isSameAddress(componentSwapData[i].underlyingERC20, usdc)).toBe( - true + true, ) // Should be empty as input token is equal to output token (underlying erc20) const dexData = componentSwapData[i].dexData @@ -113,7 +113,7 @@ describe('getRedemptionComponentSwapData()', () => { expect(dexData.pool).toEqual(AddressZero) expect(dexData.poolIds).toEqual([]) expect( - componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)) + componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)), ).toBe(true) } }) @@ -128,12 +128,12 @@ describe('getRedemptionComponentSwapData()', () => { indexTokenAmount: wei(1), }, rpcUrl, - swapQuoteProvider + swapQuoteProvider, ) expect(componentSwapData.length).toBe(8) for (let i = 0; i < componentSwapData.length; i++) { expect(isSameAddress(componentSwapData[i].underlyingERC20, usdc)).toBe( - true + true, ) const dexData = componentSwapData[i].dexData expect(dexData.exchange).toEqual(Exchange.UniV3) @@ -143,7 +143,7 @@ describe('getRedemptionComponentSwapData()', () => { expect(dexData.pool).toEqual(AddressZero) expect(dexData.poolIds).toEqual([]) expect( - componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)) + componentSwapData[i].buyUnderlyingAmount.gt(BigNumber.from(0)), ).toBe(true) } }) diff --git a/src/utils/component-swap-data.ts b/src/utils/component-swap-data.ts index 27311082..bf5b86b5 100644 --- a/src/utils/component-swap-data.ts +++ b/src/utils/component-swap-data.ts @@ -1,15 +1,15 @@ import { BigNumber } from '@ethersproject/bignumber' import { Contract } from '@ethersproject/contracts' import { getTokenByChainAndSymbol, isAddressEqual } from '@indexcoop/tokenlists' -import { Address, parseAbi } from 'viem' +import { type Address, parseAbi } from 'viem' import { AddressZero } from 'constants/addresses' -import { SwapQuote, SwapQuoteProvider } from 'quote' +import type { SwapQuote, SwapQuoteProvider } from 'quote' import { isSameAddress } from 'utils/addresses' import { createClientWithUrl } from 'utils/clients' import { getIssuanceModule } from 'utils/issuanceModules' import { getRpcProvider } from 'utils/rpc-provider' -import { Exchange, SwapDataV3 } from 'utils/swap-data' +import { Exchange, type SwapDataV3 } from 'utils/swap-data' // const DEFAULT_SLIPPAGE = 0.0015 @@ -56,7 +56,7 @@ interface IssuanceRequest extends ComponentSwapDataRequest { export async function getIssuanceComponentSwapData( request: IssuanceRequest, rpcUrl: string, - swapQuoteProvider: SwapQuoteProvider + swapQuoteProvider: SwapQuoteProvider, ): Promise { const { chainId, @@ -69,16 +69,16 @@ export async function getIssuanceComponentSwapData( const [issuanceComponents, issuanceUnits] = await issuance.getRequiredComponentIssuanceUnits( indexToken, - indexTokenAmount + indexTokenAmount, ) const underlyingERC20sPromises: Promise[] = issuanceComponents.map((component: string) => - getUnderlyingErc20(component, chainId, rpcUrl) + getUnderlyingErc20(component, chainId, rpcUrl), ) const units = issuanceUnits.map((unit: BigNumber) => unit.toString()) const amountPromises = issuanceComponents.map( (component: Address, index: number) => - getAmount(true, component, BigInt(units[index]), chainId, rpcUrl) + getAmount(true, component, BigInt(units[index]), chainId, rpcUrl), ) const wrappedTokens = await Promise.all(underlyingERC20sPromises) const amounts: bigint[] = await Promise.all(amountPromises) @@ -94,14 +94,14 @@ export async function getIssuanceComponentSwapData( outputAmount: amounts[index].toString(), sources: [Exchange.UniV3], }) - } + }, ) const swapData = await Promise.all(swapPromises) return buildComponentSwapData( issuanceComponents, wrappedTokens, amounts, - swapData + swapData, ) } @@ -112,7 +112,7 @@ interface RedemptionRequest extends ComponentSwapDataRequest { export async function getRedemptionComponentSwapData( request: RedemptionRequest, rpcUrl: string, - swapQuoteProvider: SwapQuoteProvider + swapQuoteProvider: SwapQuoteProvider, ): Promise { const { chainId, @@ -125,11 +125,11 @@ export async function getRedemptionComponentSwapData( const [issuanceComponents, issuanceUnits] = await issuance.getRequiredComponentRedemptionUnits( indexToken, - indexTokenAmount + indexTokenAmount, ) const underlyingERC20sPromises: Promise[] = issuanceComponents.map((component: string) => - getUnderlyingErc20(component, chainId, rpcUrl) + getUnderlyingErc20(component, chainId, rpcUrl), ) const amountPromises = issuanceComponents.map( (component: Address, index: number) => @@ -138,8 +138,8 @@ export async function getRedemptionComponentSwapData( component, issuanceUnits[index].toBigInt(), chainId, - rpcUrl - ) + rpcUrl, + ), ) const wrappedTokens = await Promise.all(underlyingERC20sPromises) const amounts = await Promise.all(amountPromises) @@ -155,14 +155,14 @@ export async function getRedemptionComponentSwapData( outputToken, sources: [Exchange.UniV3], }) - } + }, ) const swapData = await Promise.all(swapPromises) return buildComponentSwapData( issuanceComponents, wrappedTokens, amounts, - swapData + swapData, ) } @@ -170,7 +170,7 @@ function buildComponentSwapData( issuanceComponents: string[], wrappedTokens: WrappedToken[], buyAmounts: bigint[], - swapDataResults: (SwapQuote | null)[] + swapDataResults: (SwapQuote | null)[], ): ComponentSwapData[] { return issuanceComponents.map((_: string, index: number) => { const wrappedToken = wrappedTokens[index] @@ -198,7 +198,7 @@ async function getAmount( component: Address, issuanceUnits: bigint, chainId: number, - rpcUrl: string + rpcUrl: string, ): Promise { try { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -232,7 +232,7 @@ async function getAmount( function getIssuanceContract( chainId: number, indexTokenSymbol: string, - rpcUrl: string + rpcUrl: string, ): Contract { const abi = [ 'function getRequiredComponentIssuanceUnits(address _setToken, uint256 _quantity) external view returns (address[] memory, uint256[] memory, uint256[] memory)', @@ -246,7 +246,7 @@ function getIssuanceContract( async function getUnderlyingErc20( token: string, chainId: number, - rpcUrl: string + rpcUrl: string, ): Promise { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const publicClient = createClientWithUrl(chainId, rpcUrl)! diff --git a/src/utils/contracts.test.ts b/src/utils/contracts.test.ts index ede59b52..1f64ae12 100644 --- a/src/utils/contracts.test.ts +++ b/src/utils/contracts.test.ts @@ -11,26 +11,26 @@ import { } from 'constants/contracts' import { DiversifiedStakedETHIndex, - InterestCompoundingETHIndex, - IndexCoopEthereum2xIndex, IndexCoopBitcoin2xIndex, - IndexCoopEthereum3xIndex, IndexCoopBitcoin3xIndex, - IndexCoopInverseEthereumIndex, + IndexCoopEthereum2xIndex, + IndexCoopEthereum3xIndex, IndexCoopInverseBitcoinIndex, + IndexCoopInverseEthereumIndex, + InterestCompoundingETHIndex, } from 'constants/tokens' import { getExchangeIssuanceLeveragedContractAddress, + getExchangeIssuanceZeroExContractAddress, + getFlashMintHyEthContract, getFlashMintLeveragedContract, + getFlashMintLeveragedContractForToken, getFlashMintLeveragedForCompoundContract, - getExchangeIssuanceZeroExContractAddress, + getFlashMintNavContract, + getFlashMintWrappedContract, getFlashMintZeroExContract, getFlashMintZeroExContractForToken, - getFlashMintLeveragedContractForToken, - getFlashMintHyEthContract, - getFlashMintWrappedContract, - getFlashMintNavContract, } from './contracts' describe('getExchangeIssuanceLeveragedContractAddress()', () => { @@ -114,7 +114,7 @@ describe('getFlashMintLeveragedContractForToken()', () => { const expectedAddress = ExchangeIssuanceLeveragedPolygonAddress const contract = getFlashMintLeveragedContractForToken( InterestCompoundingETHIndex.symbol, - undefined + undefined, ) expect(contract.address).toEqual(expectedAddress) expect(contract.functions.getLeveragedTokenData).toBeDefined() @@ -129,7 +129,7 @@ describe('getFlashMintLeveragedContractForToken()', () => { const contract = getFlashMintLeveragedContractForToken( InterestCompoundingETHIndex.symbol, undefined, - 1 + 1, ) expect(contract.address).toEqual(expectedAddress) expect(contract.functions.getLeveragedTokenData).toBeDefined() @@ -244,7 +244,7 @@ describe('getFlashMintZeroExContractForToken()', () => { const contract = getFlashMintZeroExContractForToken( DiversifiedStakedETHIndex.symbol, undefined, - 1 + 1, ) expect(contract.address).toEqual(expectedAddress) expect(contract.functions.getRequiredIssuanceComponents).toBeDefined() @@ -282,7 +282,7 @@ describe('BTC2X', () => { const expectedAddress = FlashMintLeveragedAddress const contract = getFlashMintLeveragedContractForToken( IndexCoopBitcoin2xIndex.symbol, - undefined + undefined, ) expect(contract.address).toEqual(expectedAddress) expect(contract.functions.getLeveragedTokenData).toBeDefined() @@ -297,7 +297,7 @@ describe('BTC2X', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopBitcoin2xIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -318,7 +318,7 @@ describe('BTC2xETH', () => { const contract = getFlashMintLeveragedContractForToken( 'BTC2xETH', undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -339,7 +339,7 @@ describe('BTC3X', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopBitcoin3xIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -359,7 +359,7 @@ describe('ETH2X', () => { const expectedAddress = FlashMintLeveragedAddress const contract = getFlashMintLeveragedContractForToken( IndexCoopEthereum2xIndex.symbol, - undefined + undefined, ) expect(contract.address).toEqual(expectedAddress) expect(contract.functions.getLeveragedTokenData).toBeDefined() @@ -374,7 +374,7 @@ describe('ETH2X', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopEthereum2xIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -393,7 +393,7 @@ describe('ETH2X', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopEthereum2xIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -414,7 +414,7 @@ describe('ETH2xBTC', () => { const contract = getFlashMintLeveragedContractForToken( 'ETH2xBTC', undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -435,7 +435,7 @@ describe('ETH3X', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopEthereum3xIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -454,7 +454,7 @@ describe('ETH3X', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopEthereum3xIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -475,7 +475,7 @@ describe('iBTC1x', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopInverseBitcoinIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) @@ -496,7 +496,7 @@ describe('iETH1x', () => { const contract = getFlashMintLeveragedContractForToken( IndexCoopInverseEthereumIndex.symbol, undefined, - chainId + chainId, ) const expectedAddress = Contracts[chainId].FlashMintLeveragedExtended expect(contract.address).toEqual(expectedAddress) diff --git a/src/utils/contracts.ts b/src/utils/contracts.ts index 8419d95a..bd13135a 100644 --- a/src/utils/contracts.ts +++ b/src/utils/contracts.ts @@ -1,13 +1,13 @@ -import { Provider } from '@ethersproject/abstract-provider' -import { Signer } from '@ethersproject/abstract-signer' +import type { Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' import { Contract } from '@ethersproject/contracts' import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists' import EXCHANGE_ISSUANCE_LEVERAGED_ABI from '../constants/abis/ExchangeIssuanceLeveraged.json' import EXCHANGE_ISSUANCE_ZERO_EX_ABI from '../constants/abis/ExchangeIssuanceZeroEx.json' import FLASHMINT_HYETH_ABI from '../constants/abis/FlashMintHyEth.json' -import FLASHMINT_LEVERAGED_COMPOUND from '../constants/abis/FlashMintLeveragedForCompound.json' import FLASHMINT_LEVERAGED_EXTENDED_ABI from '../constants/abis/FlashMintLeveragedExtended.json' +import FLASHMINT_LEVERAGED_COMPOUND from '../constants/abis/FlashMintLeveragedForCompound.json' import FLASHMINT_NAV_ABI from '../constants/abis/FlashMintNav.json' import FLASHMINT_WRAPPED_ABI from '../constants/abis/FlashMintWrapped.json' import FLASHMINT_ZEROEX_ABI from '../constants/abis/FlashMintZeroEx.json' @@ -24,18 +24,18 @@ import { FlashMintZeroExMainnetAddress, } from '../constants/contracts' import { - DiversifiedStakedETHIndex, CoinDeskEthTrendIndex, - IndexCoopEthereum2xIndex, + DiversifiedStakedETHIndex, IndexCoopBitcoin2xIndex, IndexCoopBitcoin3xIndex, + IndexCoopEthereum2xIndex, IndexCoopEthereum3xIndex, IndexCoopInverseBitcoinIndex, IndexCoopInverseEthereumIndex, } from '../constants/tokens' export function getExchangeIssuanceLeveragedContractAddress( - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ): string { if (chainId === ChainId.Polygon) return ExchangeIssuanceLeveragedPolygonAddress @@ -53,13 +53,13 @@ export function getExchangeIssuanceLeveragedContractAddress( */ export const getFlashMintLeveragedContract = ( signerOrProvider: Signer | Provider | undefined, - chainId: number = ChainId.Polygon + chainId: number = ChainId.Polygon, ): Contract => { const contractAddress = getExchangeIssuanceLeveragedContractAddress(chainId) return new Contract( contractAddress, EXCHANGE_ISSUANCE_LEVERAGED_ABI, - signerOrProvider + signerOrProvider, ) } @@ -68,7 +68,7 @@ export const getFlashMintLeveragedContract = ( * Currently, only Mainnet is supported. */ export const getFlashMintHyEthContract = ( - signerOrProvider: Signer | Provider | undefined + signerOrProvider: Signer | Provider | undefined, ): Contract => { const contractAddress = Contracts[ChainId.Mainnet].FlashMintHyEthV3 return new Contract(contractAddress, FLASHMINT_HYETH_ABI, signerOrProvider) @@ -83,13 +83,13 @@ export const getFlashMintHyEthContract = ( * @returns an instance of a FlashMintLeveraged contract */ export const getIndexFlashMintLeveragedContract = ( - signerOrProvider: Signer | Provider | undefined + signerOrProvider: Signer | Provider | undefined, ): Contract => { const contractAddress = FlashMintLeveragedAddress return new Contract( contractAddress, EXCHANGE_ISSUANCE_LEVERAGED_ABI, - signerOrProvider + signerOrProvider, ) } @@ -103,13 +103,13 @@ export const getIndexFlashMintLeveragedContract = ( */ export const getIndexFlashMintLeveragedExtendedContract = ( signerOrProvider: Signer | Provider | undefined, - chainId: ChainId + chainId: ChainId, ): Contract => { const contractAddress = Contracts[chainId].FlashMintLeveragedExtended return new Contract( contractAddress, FLASHMINT_LEVERAGED_EXTENDED_ABI, - signerOrProvider + signerOrProvider, ) } @@ -119,12 +119,12 @@ export const getIndexFlashMintLeveragedExtendedContract = ( * @returns An instance of a FlashMintLeveragedForCompound contract. */ export const getFlashMintLeveragedForCompoundContract = ( - signerOrProvider: Signer | Provider | undefined + signerOrProvider: Signer | Provider | undefined, ): Contract => { return new Contract( FlashMintLeveragedForCompoundAddress, FLASHMINT_LEVERAGED_COMPOUND, - signerOrProvider + signerOrProvider, ) } @@ -142,7 +142,7 @@ export const getFlashMintLeveragedForCompoundContract = ( export const getFlashMintLeveragedContractForToken = ( token: string, signerOrProvider: Signer | Provider | undefined, - chainId: ChainId = ChainId.Polygon + chainId: ChainId = ChainId.Polygon, ): Contract => { if (chainId === ChainId.Arbitrum) { const btc2xEth = getTokenByChainAndSymbol(ChainId.Arbitrum, 'BTC2xETH') @@ -158,7 +158,7 @@ export const getFlashMintLeveragedContractForToken = ( case IndexCoopInverseEthereumIndex.symbol: return getIndexFlashMintLeveragedExtendedContract( signerOrProvider, - chainId + chainId, ) } return getIndexFlashMintLeveragedContract(signerOrProvider) @@ -169,7 +169,7 @@ export const getFlashMintLeveragedContractForToken = ( case IndexCoopEthereum3xIndex.symbol: return getIndexFlashMintLeveragedExtendedContract( signerOrProvider, - chainId + chainId, ) } return getIndexFlashMintLeveragedContract(signerOrProvider) @@ -189,12 +189,12 @@ export const getFlashMintLeveragedContractForToken = ( * @returns An instance of a FlashMintNav contract. */ export const getFlashMintNavContract = ( - signerOrProvider: Signer | Provider | undefined + signerOrProvider: Signer | Provider | undefined, ): Contract => { return new Contract( Contracts[ChainId.Mainnet].FlashMintNav, FLASHMINT_NAV_ABI, - signerOrProvider + signerOrProvider, ) } @@ -206,14 +206,14 @@ export const getFlashMintNavContract = ( */ export const getFlashMintWrappedContract = ( signerOrProvider: Signer | Provider | undefined, - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ): Contract => { const contractAddress = Contracts[chainId].FlashMintWrapped return new Contract(contractAddress, FLASHMINT_WRAPPED_ABI, signerOrProvider) } export function getExchangeIssuanceZeroExContractAddress( - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ): string { if (chainId === ChainId.Polygon) return ExchangeIssuanceZeroExPolygonAddress return ExchangeIssuanceZeroExMainnetAddress @@ -230,13 +230,13 @@ export function getExchangeIssuanceZeroExContractAddress( */ export const getFlashMintZeroExContract = ( providerSigner: Signer | Provider | undefined, - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ): Contract => { const contractAddress = getExchangeIssuanceZeroExContractAddress(chainId) return new Contract( contractAddress, EXCHANGE_ISSUANCE_ZERO_EX_ABI, - providerSigner + providerSigner, ) } @@ -253,7 +253,7 @@ export const getFlashMintZeroExContract = ( export const getFlashMintZeroExContractForToken = ( token: string, providerSigner: Signer | Provider | undefined, - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ): Contract => { switch (token) { case CoinDeskEthTrendIndex.symbol: @@ -262,7 +262,7 @@ export const getFlashMintZeroExContractForToken = ( return new Contract( FlashMintZeroExMainnetAddress, FLASHMINT_ZEROEX_ABI, - providerSigner + providerSigner, ) default: return getFlashMintZeroExContract(providerSigner, chainId) diff --git a/src/utils/custom-oracle-nav-issuance-module.ts b/src/utils/custom-oracle-nav-issuance-module.ts index 2e866231..761514d8 100644 --- a/src/utils/custom-oracle-nav-issuance-module.ts +++ b/src/utils/custom-oracle-nav-issuance-module.ts @@ -1,4 +1,4 @@ -import { Address, parseAbi } from 'viem' +import { type Address, parseAbi } from 'viem' import { Contracts } from 'constants/contracts' import { createClient } from 'utils/clients' @@ -7,7 +7,7 @@ export async function getExpectedReserveRedeemQuantity( chainId: number, indexToken: Address, reserveAsset: Address, - indexTokenAmount: bigint + indexTokenAmount: bigint, ): Promise { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const publicClient = createClient(chainId)! diff --git a/src/utils/erc20.ts b/src/utils/erc20.ts index 27ab9533..e2a78275 100644 --- a/src/utils/erc20.ts +++ b/src/utils/erc20.ts @@ -1,10 +1,10 @@ -import { Address, parseAbi } from 'viem' +import { type Address, parseAbi } from 'viem' import { createClient } from './clients' export async function getBalanceOf( token: Address, account: Address, - chainId: number + chainId: number, ) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const publicClient = createClient(chainId)! diff --git a/src/utils/issuanceModules.test.ts b/src/utils/issuanceModules.test.ts index 3412a5f9..cc3cc995 100644 --- a/src/utils/issuanceModules.test.ts +++ b/src/utils/issuanceModules.test.ts @@ -11,12 +11,12 @@ import { BanklessBEDIndex, DefiPulseIndex, DiversifiedStakedETHIndex, - InterestCompoundingETHIndex, - MetaverseIndex, - IndexCoopEthereum2xIndex, + HighYieldETHIndex, IndexCoopBitcoin2xIndex, IndexCoopBitcoin3xIndex, - HighYieldETHIndex, + IndexCoopEthereum2xIndex, + InterestCompoundingETHIndex, + MetaverseIndex, TheUSDCYieldIndex, } from 'constants/tokens' @@ -115,7 +115,7 @@ describe('getIssuanceModule() - Arbitrum', () => { const expectedModule = Contracts[ChainId.Arbitrum].DebtIssuanceModuleV3 const issuanceModule = getIssuanceModule( IndexCoopBitcoin2xIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) expect(issuanceModule.address).toEqual(expectedModule) expect(issuanceModule.isDebtIssuance).toBe(true) @@ -125,7 +125,7 @@ describe('getIssuanceModule() - Arbitrum', () => { const expectedModule = Contracts[ChainId.Arbitrum].DebtIssuanceModuleV3 const issuanceModule = getIssuanceModule( IndexCoopBitcoin3xIndex.symbol, - ChainId.Arbitrum + ChainId.Arbitrum, ) expect(issuanceModule.address).toEqual(expectedModule) expect(issuanceModule.isDebtIssuance).toBe(true) @@ -137,7 +137,7 @@ describe('getIssuanceModule() - Base', () => { const expectedModule = Contracts[ChainId.Base].DebtIssuanceModuleV3 const issuanceModule = getIssuanceModule( IndexCoopBitcoin2xIndex.symbol, - ChainId.Base + ChainId.Base, ) expect(issuanceModule.address).toEqual(expectedModule) expect(issuanceModule.isDebtIssuance).toBe(true) @@ -147,7 +147,7 @@ describe('getIssuanceModule() - Base', () => { const expectedModule = Contracts[ChainId.Base].DebtIssuanceModuleV3 const issuanceModule = getIssuanceModule( IndexCoopBitcoin3xIndex.symbol, - ChainId.Base + ChainId.Base, ) expect(issuanceModule.address).toEqual(expectedModule) expect(issuanceModule.isDebtIssuance).toBe(true) @@ -159,7 +159,7 @@ describe('getIssuanceModule() - Polygon', () => { const expectedAddress = BasicIssuanceModulePolygonAddress const issuanceModule = getIssuanceModule( MetaverseIndex.symbol, - ChainId.Polygon + ChainId.Polygon, ) expect(issuanceModule.address).toEqual(expectedAddress) expect(issuanceModule.isDebtIssuance).toBe(false) diff --git a/src/utils/issuanceModules.ts b/src/utils/issuanceModules.ts index d583d752..61444b03 100644 --- a/src/utils/issuanceModules.ts +++ b/src/utils/issuanceModules.ts @@ -8,12 +8,12 @@ import { IndexDebtIssuanceModuleV2Address_v2, } from '../constants/contracts' import { - DiversifiedStakedETHIndex, - InterestCompoundingETHIndex, CoinDeskEthTrendIndex, - IndexCoopEthereum2xIndex, - IndexCoopBitcoin2xIndex, + DiversifiedStakedETHIndex, HighYieldETHIndex, + IndexCoopBitcoin2xIndex, + IndexCoopEthereum2xIndex, + InterestCompoundingETHIndex, TheUSDCYieldIndex, } from '../constants/tokens' @@ -24,7 +24,7 @@ export interface IssuanceModule { export function getIssuanceModule( tokenSymbol: string, - chainId: number = ChainId.Mainnet + chainId: number = ChainId.Mainnet, ): IssuanceModule { if (chainId === ChainId.Arbitrum) { return { @@ -55,7 +55,10 @@ export function getIssuanceModule( isDebtIssuance: true, } case 'wsETH2': - return { address: IndexDebtIssuanceModuleV2Address, isDebtIssuance: true } + return { + address: IndexDebtIssuanceModuleV2Address, + isDebtIssuance: true, + } case InterestCompoundingETHIndex.symbol: return { address: DebtIssuanceModuleV2Address, isDebtIssuance: true } case TheUSDCYieldIndex.symbol: diff --git a/src/utils/leveraged-token-data.ts b/src/utils/leveraged-token-data.ts index ddb95b75..821db6d0 100644 --- a/src/utils/leveraged-token-data.ts +++ b/src/utils/leveraged-token-data.ts @@ -1,5 +1,5 @@ -import { BigNumber } from '@ethersproject/bignumber' -import { JsonRpcProvider } from '@ethersproject/providers' +import type { BigNumber } from '@ethersproject/bignumber' +import type { JsonRpcProvider } from '@ethersproject/providers' import { getFlashMintLeveragedContractForToken } from 'utils/contracts' @@ -17,18 +17,18 @@ export async function getLeveragedTokenData( indexTokenSymbol: string, isIssuance: boolean, chainId: number, - provider: JsonRpcProvider + provider: JsonRpcProvider, ): Promise { try { const contract = getFlashMintLeveragedContractForToken( indexTokenSymbol, provider, - chainId + chainId, ) return await contract.getLeveragedTokenData( indexTokenAddress, indexTokenAmount, - isIssuance + isIssuance, ) } catch (error) { // Should this just always fail cause it means there is something wrongly configured? diff --git a/src/utils/numbers.ts b/src/utils/numbers.ts index 22a752bb..ef6194c2 100644 --- a/src/utils/numbers.ts +++ b/src/utils/numbers.ts @@ -1,4 +1,4 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { parseUnits } from '@ethersproject/units' export const wei = (input: number | string, power = 18): BigNumber => { diff --git a/src/utils/overrides.ts b/src/utils/overrides.ts index c9078f69..e9d192fe 100644 --- a/src/utils/overrides.ts +++ b/src/utils/overrides.ts @@ -1,4 +1,4 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' // For more on overrides, check: // https://docs.ethers.io/v5/api/contract/contract/#contract-functionsSend diff --git a/src/utils/slippage.test.ts b/src/utils/slippage.test.ts index a5a7f1f6..948ade51 100644 --- a/src/utils/slippage.test.ts +++ b/src/utils/slippage.test.ts @@ -11,7 +11,7 @@ describe('slippageAdjustedTokenAmount()', () => { wei(100), 18, slippagePercentage, - isMinting + isMinting, ) const result = formatUnits(adjustedAmount).toLocaleString().substring(0, 5) expect(result).toEqual('100.5') @@ -24,7 +24,7 @@ describe('slippageAdjustedTokenAmount()', () => { wei(100), 18, slippagePercentage, - isMinting + isMinting, ) const result = formatUnits(adjustedAmount).toLocaleString().substring(0, 4) expect(result).toEqual('99.5') diff --git a/src/utils/slippage.ts b/src/utils/slippage.ts index b2a1eb2f..1da76fc9 100644 --- a/src/utils/slippage.ts +++ b/src/utils/slippage.ts @@ -1,4 +1,4 @@ -import { BigNumber } from '@ethersproject/bignumber' +import type { BigNumber } from '@ethersproject/bignumber' import { wei } from '../utils/numbers' @@ -13,7 +13,7 @@ export function slippageAdjustedTokenAmount( tokenAmount: BigNumber, tokenDecimals: number, slippage: number, - isMinting: boolean + isMinting: boolean, ): BigNumber { if (isMinting) { return tokenAmount diff --git a/src/utils/swap-data.ts b/src/utils/swap-data.ts index 6645104e..dd101e17 100644 --- a/src/utils/swap-data.ts +++ b/src/utils/swap-data.ts @@ -1,12 +1,12 @@ // The order here has to be exactly the same as in the `DEXAdapter` // https://github.com/IndexCoop/index-coop-smart-contracts/blob/master/contracts/exchangeIssuance/DEXAdapterV3.sol#L54 export enum Exchange { - None, - Quickswap, - Sushiswap, - UniV3, - Curve, - BalancerV2, + None = 0, + Quickswap = 1, + Sushiswap = 2, + UniV3 = 3, + Curve = 4, + BalancerV2 = 5, } export interface SwapData { diff --git a/src/utils/tokens.ts b/src/utils/tokens.ts index 0afc5408..28acc1fb 100644 --- a/src/utils/tokens.ts +++ b/src/utils/tokens.ts @@ -1,9 +1,9 @@ import { ChainId } from '../constants/chains' -import { Token } from '../constants/tokens' +import type { Token } from '../constants/tokens' export function getAddressForToken( token: Token, - chainId: number | undefined + chainId: number | undefined, ): string | undefined { switch (chainId) { case ChainId.Arbitrum: diff --git a/src/utils/wrap-data.test.ts b/src/utils/wrap-data.test.ts index ff1def94..c03450a6 100644 --- a/src/utils/wrap-data.test.ts +++ b/src/utils/wrap-data.test.ts @@ -17,6 +17,7 @@ describe('getWrapData()', () => { expect(wrapData[5].integrationName).toBe('') expect(wrapData[6].integrationName).toBe('ERC4626WrapV2Adapter') expect(wrapData[7].integrationName).toBe('ERC4626WrapV2Adapter') + // biome-ignore lint: wrapData.forEach((data) => { expect(data.wrapData).toBe('0x0000000000000000000000000000000000000000') })