- squid-evm-typegen
- squid-substrate-typegen
- squid-ink-typegen
The Arguments:
Options:
squid-evm-typegen(1) tool generates TypeScript facades for EVM transactions, logs and eth_call queries.The generated facades are assumed to be used by squids indexing EVM data.The tool takes a JSON ABIs as an input. Those can be specified in three ways:-
as a plain JSON file(s):
To include all files in
./abiand add an interface for the Multicall contract, runYou can get JSON ABIs for explorer (Etherscan, Bscscan etc) verified contract by visiting the contract page, going to the “Contract” tab and scrolling down to the “Contract ABI” section. Do not use the “Export ABI” function! Copy the contents to the clipboard and paste them to a new JSON file. -
(requires an Etherscan API key) as a contract address. One can pass multiple addresses at once.
Please check if your contract is a proxy when using this method. If it is,
consult this page for guidance.
-
as an arbitrary URL:
basename of the ABI as the root name for the generated files. You can change the basename of generated files using the fragment (#) suffix.output-dir | output directory for generated definitions |
abi | A contract address, an URL or a local path to the ABI file. Accepts multiple contracts. |
--multicall | generate a facade for the MakerDAO multicall contract. May significantly improve the performance of contract state calls by batching RPC requests |
--etherscan-api <url> | etherscan API to fetch contract ABI by a known address. By default, https://api.etherscan.io/ |
--clean | delete output directory before the run |
-h, --help | display help for command |
Usage
The generated utility modules have three intended uses:-
Constants: EVM log topic0 values and sighashes for transactions. Example:
- Decoding of EVM logs and transactions
- Direct chain state queries, including queries to multicall.
