dethcrypto / dethcrypto/TypeChain
Compile errors with generated code on ABI containing "gas" field
Open
- 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
Assessment
This issue has not been assessed yet.