Frontier EVM support
Check out the Caveats section of this page to avoid common issues.
SubstrateBatchProcessor methods addEvmLog() and addEthereumTransaction() to request the required EVM data. The data can then be converted into a standard EVM format using the utils from the frontier package and decoded with utility classes generated by squid-evm-typegen.
Contract state can also be accessed via wrapped RPC queries using the classes provided by the squid-evm-typegen tool.
Examples
Subscribe to event logs
Request all EVM calls to two contracts
Request all transfer(address,uint256) EVM calls on the network:
Parse events and transactions
Access contract state
Factory contracts
It some cases the set of contracts to be indexed by the squid is not known in advance. For example, a DEX contract typically creates a new contract for each trading pair added, and each such trading contract is of interest. While the set of handler subscriptions is static and defined at the processor creation, one can leverage the wildcard subscriptions and filter the contracts of interest in runtime. This pattern is described extensively in EVM documentation, but it can be used with EVM methods ofSubstrateBatchProcessor as well. A (somewhat outdated) example is available in this archive repo.
Caveats
-
If your use case does not require any Substrate-specific data (e.g. extrinsic hashes), use
EvmBatchProcessorinstead. EVM-only SQD Network gateways are available for all major EVM-on-Substrate chains. -
Passing
[]as a set of parameter values selects no data. Passundefinedfor a wildcard selection: - If contract address(es) supplied to the processor configuration methods are stored in any wide-scope variables, it is recommended to convert them to flat lower case. This precaution is necessary because same variable(s) are often reused in the batch handler for item filtration, and all contract addresses in the items are always in flat lower case.

