dethcrypto / dethcrypto/eth-sdk

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

Open
#105 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
428
Forks
45
PR merge metrics
No merged PRs in 30d

Description

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

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

```ts
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](https://i.imgur.com/yJwZflE.png)

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

![img](https://i.imgur.com/CMtckVl.png)

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

Contributor guide

Open the contributing guide

Research direction

Start with the sample repository and run `yarn eth-sdk`; inspect `eth-sdk/abis/mainnet/curveRegistry3.json` and compare it with the verified ABI for the contract on Etherscan. Done means the generated ABI matches `0xB9fC157394Af804a3578134A6585C0dc9cc990d4`, including `metapool_implementations` and excluding unrelated functions.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity, typescript
Domain
blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.