Closed abernatskiy closed 1 year ago
Fetched abi has incorrect format
Ah I see, abi.json
is expected to be cleaned up from etherscan metadata. If I do so via
$ python -c "import json; ifile=open('abi.json', 'r'); print(json.load(ifile)['result']); ifile.close()" > abi2.json
then
$ npx squid-evm-typegen --abi abi2.json --output abi2.ts
works.
Thanks.
We discussed about "etherscan abi fetch" feature, but not sure if we will implement it.
It's not strictly necessary, we'll just have to update the docs with the additional steps. Also, I just discovered EIP-1967 and in light of it etherscan abi fetching will have to be made somewhat more complicated anyway.
It would be nice to detect etherscan abi format and give user a hint instead of an opaque error message.
Attempted to use the tool with two smart contracts (
0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9
, the AAVEv2 pool, and0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413
from this example), fails withTo Reproduce Steps to reproduce the behavior:
cd
to itnpm install @subsquid/evm-typegen
npx squid-evm-typegen --abi abi.json --output abi.ts
abi.ts
is not generated.Expected behavior Successful generation of
abi.ts
Environment (please complete the following information):
Additional context Retrieved abi.json