dethcrypto / dethcrypto/TypeChain

Compile errors with generated code on ABI containing "gas" field

Open
#778 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

When copy/pasting an ABI from Etherscan, it helpfully includes a `gas` field. For example, search `0xB9fC157394Af804a3578134A6585C0dc9cc990d4` on etherscan, click "Contract" and scroll down to find the contract ABI.

Typechain processes it, but spits out code that won't compile (incompatible type assignment)

However, if I preprocess the abi by removing all the `gas` fields, everything works just fine.

(example of what I use to preprocess)
```
function fixAbi(abi) {
for (const item of abi) {
if (item.gas) { delete item.gas }
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.