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

eth-sdk fails to fetch ABI for some contracts: invalid ABI fetched instead #105

Open
Pzixel opened this issue May 21, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Pzixel
Copy link
Contributor

Pzixel commented May 21, 2022

I've created a sample repo: https://github.com/Pzixel/eth-sdk-test

What's happens there: I have a simple sdk:

import { defineConfig } from '@dethcrypto/eth-sdk'

export default defineConfig({
  contracts: {
    mainnet: {
      curveRegistry3: '0xB9fC157394Af804a3578134A6585C0dc9cc990d4',
    },
  },
})

Then I'm running yarn eth-sdk and check output json file https://github.com/Pzixel/eth-sdk-test/blob/master/eth-sdk/abis/mainnet/curveRegistry3.json

The problem is that it's unrelated to contract 0xB9fC157394Af804a3578134A6585C0dc9cc990d4. For example, fetched JSON suggests that there is a function integrate_checkpoint which doesn't exist on real contract:
img

Meanwhile contract has a function metapool_implementations which is missing in generated ABI:

img

Contract: https://etherscan.io/address/0xB9fC157394Af804a3578134A6585C0dc9cc990d4#code

@Pzixel
Copy link
Contributor Author

Pzixel commented May 28, 2022

Ping?

@krzkaczor krzkaczor added the bug Something isn't working label Jun 21, 2022
@krzkaczor
Copy link
Member

This might be a problem with how we try to follow proxies and so on. Thanks for bringing this up.

Quick fix is to manually overwrite abi file with whatever you need. Once it's there, eth-sdk won't try to overwrite it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants