Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve error handling, added new token to config, published new packages #691

Merged
merged 5 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/addresses/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/deploy-configurations/configs/mainnet.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ export const config: SystemConfig = {
name: 'MATIC',
address: '0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0',
},
MKR: {
name: 'MKR',
address: '0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2',
},
MORPHO: {
name: 'MORPHO',
address: '0x9994e35db50125e0df82e4c2dde62496ce330999',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type Tokens =
| 'LUSD'
| 'MANA'
| 'MATIC'
| 'MKR'
| 'MORPHO'
| 'MEVETH'
| 'MPETH'
Expand Down
5 changes: 3 additions & 2 deletions packages/dma-library/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,17 @@ 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)
const symbol = await erc20.symbol()

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'
}
}
Expand Down
Loading