From c961c32e8811a08148723dd26f50ad261d92847b Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:34:28 +0200 Subject: [PATCH 1/5] better error handling --- .../src/strategies/aave/common/get-aave-token-addresses.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dma-library/src/strategies/aave/common/get-aave-token-addresses.ts b/packages/dma-library/src/strategies/aave/common/get-aave-token-addresses.ts index c22a24c2c..5cc61ef9d 100644 --- a/packages/dma-library/src/strategies/aave/common/get-aave-token-addresses.ts +++ b/packages/dma-library/src/strategies/aave/common/get-aave-token-addresses.ts @@ -14,7 +14,7 @@ export const getAaveTokenAddress = ( } if (!tokenAddress || tokenAddress === EMPTY_ADDRESS) - throw new Error('Token not recognised or address missing in dependencies') + throw new Error('Token not recognised or address missing in dependencies: ' + token.symbol) return tokenAddress } From 5f1cf74cb9b233ef7ec85d0dbbded297e1cd1024 Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:35:39 +0200 Subject: [PATCH 2/5] Improved error handling messages Added script to create an unbundled dev pkg for development --- packages/dma-library/package.json | 3 ++- .../dma-library/src/strategies/morphoblue/multiply/open.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/dma-library/package.json b/packages/dma-library/package.json index ea3820feb..7327b20cf 100644 --- a/packages/dma-library/package.json +++ b/packages/dma-library/package.json @@ -13,7 +13,8 @@ "lib/*" ], "scripts": { - "build": "npx parcel build ./src/index.ts --dist-dir ./lib", + "build": "npx parcel build ./src/index.ts --dist-dir ./lib --no-optimize", + "build:dev": "npx parcel build ./src/index.ts --dist-dir ./lib --no-optimize --no-content-hash", "clean": "rm -rf lib && rm -f tsconfig.lint.tsbuildinfo", "lint": "yarn eslint . --ext .ts --max-warnings=0 && yarn tsc --build ./tsconfig.lint.json", "lint:fix": "yarn eslint . --fix --ext .ts", diff --git a/packages/dma-library/src/strategies/morphoblue/multiply/open.ts b/packages/dma-library/src/strategies/morphoblue/multiply/open.ts index 3f702c9bc..07dae6f87 100644 --- a/packages/dma-library/src/strategies/morphoblue/multiply/open.ts +++ b/packages/dma-library/src/strategies/morphoblue/multiply/open.ts @@ -489,7 +489,9 @@ export async function getTokenSymbol( return await erc20.symbol() } catch (e) { // It's required because for example MKR token symbol() returns bytes32 instead of string - console.warn('Issue with getting token symbol as string, trying to fetch as bytes32...') + console.warn( + `Issue with getting a symbol for ${token} token as string type, trying to fetch as bytes32...`, + ) try { const erc20 = new ethers.Contract(token, getTokenSymbolAbi('bytes32'), provider) @@ -497,7 +499,7 @@ export async function getTokenSymbol( return ethers.utils.parseBytes32String(symbol) } catch (e) { - console.error('Failed to get token symbol') + console.error(`Failed to get token symbol for: ${token} token`) return 'UNKNOWN_SYMBOL' } } From ba158f9d5241060158876bcd82417ccf05add054 Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:36:10 +0200 Subject: [PATCH 3/5] Added missing MKR token to library so migration can find it --- packages/deploy-configurations/configs/mainnet.conf.ts | 4 ++++ .../configs/shared/common-defaults.ts | 9 ++++----- .../types/deployment-config/tokens.ts | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/deploy-configurations/configs/mainnet.conf.ts b/packages/deploy-configurations/configs/mainnet.conf.ts index 3e1b4e077..e51ffe6c8 100644 --- a/packages/deploy-configurations/configs/mainnet.conf.ts +++ b/packages/deploy-configurations/configs/mainnet.conf.ts @@ -693,6 +693,10 @@ export const config: SystemConfig = { name: 'MATIC', address: '0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0', }, + MKR: { + name: 'MKR', + address: '0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2', + }, MORPHO: { name: 'MORPHO', address: '0x9994e35db50125e0df82e4c2dde62496ce330999', diff --git a/packages/deploy-configurations/configs/shared/common-defaults.ts b/packages/deploy-configurations/configs/shared/common-defaults.ts index 504561391..7dcbb7fb9 100644 --- a/packages/deploy-configurations/configs/shared/common-defaults.ts +++ b/packages/deploy-configurations/configs/shared/common-defaults.ts @@ -12,11 +12,10 @@ export const commonDefaults = { name: 'CRV', address: ADDRESS_ZERO, }, - // For MKR use McdGov instead - // MKR: { - // name: 'MKR', - // address: ADDRESS_ZERO, - // }, + MKR: { + name: 'MKR', + address: ADDRESS_ZERO, + }, OP: { name: 'OP', address: ADDRESS_ZERO, diff --git a/packages/deploy-configurations/types/deployment-config/tokens.ts b/packages/deploy-configurations/types/deployment-config/tokens.ts index c06d30595..24927537f 100644 --- a/packages/deploy-configurations/types/deployment-config/tokens.ts +++ b/packages/deploy-configurations/types/deployment-config/tokens.ts @@ -31,6 +31,7 @@ export type Tokens = | 'LUSD' | 'MANA' | 'MATIC' + | 'MKR' | 'MORPHO' | 'MEVETH' | 'MPETH' From 39ee6488ae2b6a73f48d744d34004447aad32182 Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:38:56 +0200 Subject: [PATCH 4/5] v0.1.74 --- packages/addresses/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addresses/package.json b/packages/addresses/package.json index a022e2689..a36a4158f 100644 --- a/packages/addresses/package.json +++ b/packages/addresses/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/addresses", - "version": "0.1.72", + "version": "0.1.74", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js", From 933c55903287b398df1f5bdc3cf25bf3f3104c56 Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:39:41 +0200 Subject: [PATCH 5/5] v0.6.59 --- packages/dma-library/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dma-library/package.json b/packages/dma-library/package.json index 7327b20cf..f76393090 100644 --- a/packages/dma-library/package.json +++ b/packages/dma-library/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/dma-library", - "version": "0.6.58", + "version": "0.6.59", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js",