Data Loaders
Data Loaders are mechanisms for retrieving the necessary ABI and Contract Metadata for transaction decoding. They are responsible for:
- Resolving ABIs and Contract Metadata using specified strategies and third-party APIs
- Automatically batching requests when processing logs and traces in parallel
- Caching request results in the Data Store
Loop Decoder implements optimizations to minimize API requests to third-party services. For example, when a contract’s ABI is resolved via Etherscan, it is cached in the store. If the ABI is requested again, the store provides the cached version, avoiding redundant API calls.
ABI Strategies
ABI strategies will receive the contract address, and event or function signature as input and would return the ABI as a stringified JSON. Loop Decoder provides some strategies out of the box:
EtherscanStrategyResolver
- resolves the ABI from Etherscan, requires an API key to work properlyEtherscanV2StrategyResolver
- resolves the ABI from Etherscan v2, requires an API key to work properlySourcifyStrategyResolver
- resolves the ABI from SourcifyFourByteStrategyResolver
- resolves the ABI from 4byte.directoryOpenchainStrategyResolver
- resolves the ABI from OpenchainBlockscoutStrategyResolver
- resolves the ABI from Blockscout
You can create your strategy by implementing the GetContractABIStrategy
Effect RequestResolver.
Contract Metadata Strategies
Contract metadata is a collection of information about a contract, such as the contract’s name, symbol, and decimals.
Loop Decoder provides some strategies out of the box:
ERC20RPCStrategyResolver
- resolves the contract metadata of an ERC20 token from the RPCNFTRPCStrategyResolver
- resolves the contract metadata of an NFT token (ERC721, ERC1155) from the RPCProxyRPCStrategyResolver
- resolves the contract metadata of a Gnosis Safe proxy contract from the RPC