This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.
Overview
Opcode:0xa3Introduced: Frontier (EVM genesis)LOG3 emits a log entry with three indexed topics. This enables filtering complex events with multiple dimensional parameters, such as marketplace events involving buyer, seller, and item.
Base Cost: 375 gasTopic Cost: 375 gas per topic = 1125 gas (for 3 topics)Data Cost: 8 gas per byteMemory Expansion: Proportional to new memory rangeExamples:
// Listen for all trades by a specific traderconst logs = await provider.getLogs({ address: dex.address, topics: [ keccak256("Trade(address,indexed address,indexed address,indexed uint256)"), "0xtrader_address" ]});// Listen for trades with specific tokenconst logsWithToken = await provider.getLogs({ address: dex.address, topics: [ keccak256("Trade(...)"), null, // Any trader "0xtoken_address", // Specific token null // Any counterparty ]});// Listen for trades between specific partiesconst logsBetween = await provider.getLogs({ address: dex.address, topics: [ keccak256("Trade(...)"), "0xtrader_address", null, "0xcounterparty_address" ]});