cast logs - Get logs by signature or topic.
cast logs
[options] sig_or_topic [topics_or_args...]
Get logs by signature or topic.
The (sig_or_topic) may either be the event signature or its hashed topic (located at topics[0]).
If using a signature, remaining arguments must be in their ordinary form. If using a topic, the arguments must be as they themselves appear as topics.
--from-block
from_block
The block height to start query at.
Can also be the tags: earliest
, finalized
, safe
, latest
, or pending
.
--to-block
to_block
The block height to stop query at.
Can also be the tags: earliest
, finalized
, safe
, latest
, or pending
.
--address
address
The contract address to filter on
{{#include ../common/wallet-options.md}}
{{#include ../common/rpc-options.md}}
{{#include ../common/etherscan-options.md}}
- Get logs using a signature:
cast logs --from-block 15537393 --to-block latest 'Transfer (address indexed from, address indexed to, uint256 value)' --address 0x2e8ABfE042886E4938201101A63730D04F160A82
- Get logs using a topic:
cast logs --from-block 15537393 --to-block latest 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef --address 0x0000000000000000000000002e8abfe042886e4938201101a63730d04f160a82