Skip to content

Commit

Permalink
docs: Document cast logs (#940)
Browse files Browse the repository at this point in the history
* docs: cast logs

* maintain conventions
  • Loading branch information
Sabnock01 authored Jun 29, 2023
1 parent 4f3a954 commit 410baeb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
- [cast run](./reference/cast/cast-run.md)
- [cast estimate](./reference/cast/cast-estimate.md)
- [cast access-list](./reference/cast/cast-access-list.md)
- [cast logs](./reference/cast/cast-logs.md)
- [Block Commands](./reference/cast/block-commands.md)
- [cast find-block](./reference/cast/cast-find-block.md)
- [cast gas-price](./reference/cast/cast-gas-price.md)
Expand Down
56 changes: 56 additions & 0 deletions src/reference/cast/cast-logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## cast logs

### NAME

cast logs - Get logs by signature or topic.

### SYNOPSIS

``cast logs`` [*options*] *sig_or_topic* [*topics_or_args...*]


### DESCRIPTION

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.

### OPTIONS

### Query Options

`--from-block` *from_block*
    The block height to start query at.

    Can also be the tags: `earlies`t, `finalized`, `safe`, `latest`, or `pending`.

`--to-block` *to_block*
    The block height to stop query at.

    Can also be the tags: `earlies`t, `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}}

### EXAMPLES

1. Get logs using a signature:
```sh
cast logs --from-block 15537393 --to-block latest 'Transfer (address indexed from, address indexed to, uint256 value)' 0x2e8ABfE042886E4938201101A63730D04F160A82
```
2. Get logs using a topic:
```sh
cast logs --from-block 15537393 --to-block latest 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef 0x0000000000000000000000002e8abfe042886e4938201101a63730d04f160a82
```

### SEE ALSO

[cast](./cast.md)
3 changes: 3 additions & 0 deletions src/reference/cast/cast.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ This program is a set of tools to interact with Ethereum and perform conversions
[cast access-list](./cast-access-list.md)
    Create an access list for a transaction.

[cast logs](./cast-logs.md)
    Get logs by signature or topic

#### Block Commands

[cast find-block](./cast-find-block.md)
Expand Down
1 change: 1 addition & 0 deletions src/reference/cast/transaction-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
- [cast run](./cast-run.md)
- [cast estimate](./cast-estimate.md)
- [cast access-list](./cast-access-list.md)
- [cast logs](./cast-logs.md)

0 comments on commit 410baeb

Please sign in to comment.