aave / aave-utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UiPoolDataProvider.getReservesHumanized() throws error on accessing reserveRaw.eModeLabel

PavelDonskikh opened this issue · comments

commented

Bug Report

After updating @aave/contract-helpers from 1.7.0 to 1.13.2
If I'm connecting to ethereum mainnet, ethreum goerli, polygon mainnet and using aave v2 contracts (or v3 contracts on polygon) to initialize poolDataProviderContract like so

const poolDataProviderContract = new UiPoolDataProvider({
      '0x30375522F67a6308630d49A694ca1491fA2D3BC6',
      new ethers.providers.JsonRpcProvider(
        'https://mainnet.infura.io/v3/<projectId>',
      ),
      1,
    });

and then calling

const reserves = await poolDataProviderContract.getReservesHumanized({
      '0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5',
    })

the UiPoolDataProvider.getReservesHumanized() method in node_modules.pnpm@aave+contract-helpers@1.13.2_5slk323oopyj6a2lobfq5lwgy4\node_modules@aave\contract-helpers\src\v3-UiPoolDataProvider-contract\index.ts is throwing an error when it's trying to read
reserveRaw.eModeLabel.toString();

image

The only case when the latest package version works on my end is when I'm using aave v3 contracts on goerli or polygon-mumbai. eModeLabel returns either empty string or 'Stablecoins'.
But both aave v2 & v3 contracts on mainnets started throwing this error.
I'm assuming smth has changed either only in the v3 contracts on testnets (which would be weird) or smth ir not properly handling this property "eModeLabel" in the package.

When console.logging the reserveRaw object inside the getReservesHumanized() method when testing with v2 contracts it's showing as [Getter]
image

I could suggest a PR with a try catch block as a hot fix but would assume you guys might come up with a more elegant solution once I report about this problem.
Or someone could point me what I could be doing wrong.
Thank you!

  • OS: [e.g., OSX 10.13.4, Windows 10]
  • Node/npm version: [e.g., Node 8/npm 5]
  • Browser: [e.g., Chrome]

I also pulled the aave-utilities package to reproduce the issue and do have same kind of exception
image

Please bump the version to 1.13.3 (fixes a typing issue), then it should be compatible with all of the V2 and V3 addresses listed here: https://github.com/aave/interface/blob/main/src/ui-config/marketsConfig.tsx

commented

Please bump the version to 1.13.3 (fixes a typing issue), then it should be compatible with all of the V2 and V3 addresses listed here: https://github.com/aave/interface/blob/main/src/ui-config/marketsConfig.tsx

hi defispartan!
thank you for your reply! i'll update the package and will provide feedback.
i'm also noticing that UI_POOL_DATA_PROVIDERs seem to have been changed within the last ~2 months bc i have different addresses in my local code.
e.g. i'm using 0x30375522F67a6308630d49A694ca1491fA2D3BC6 as the UI_POOL_DATA_PROVIDER for v2 on ethereum,
but at the moment the right one is 0x00e50FAB64eBB37b87df06Aa46b8B35d5f1A4e1A
And this change has caught me off guard.

commented

I have just updated the packages to 1.13.3 and changed UI_POOL_DATA_PROVIDERs for v2 and v3 for all networks that i'm using and it solved the problem! 👍
thank you!