TypeChain
TypeChain copied to clipboard
Compile errors with generated code on ABI containing "gas" field
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 }
}
}