update readme & usage message to reference up-to-date flags

pull/1386/head
bohendo 2 years ago
parent 719e4e98d8
commit 4d3e5f6cc7
  1. 10
      slither/tools/read_storage/README.md
  2. 4
      slither/tools/read_storage/__main__.py

@ -18,7 +18,7 @@ optional arguments:
--struct-var STRUCT_VAR The name of the variable whose value will be returned from a struct. --struct-var STRUCT_VAR The name of the variable whose value will be returned from a struct.
--storage-address STORAGE_ADDRESS The address of the storage contract (if a proxy pattern is used). --storage-address STORAGE_ADDRESS The address of the storage contract (if a proxy pattern is used).
--contract-name CONTRACT_NAME The name of the logic contract. --contract-name CONTRACT_NAME The name of the logic contract.
--layout Toggle used to write a JSON file with the entire storage layout. --json FILE Write the entire storage layout in JSON format to the specified FILE
--value Toggle used to include values in output. --value Toggle used to include values in output.
--max-depth MAX_DEPTH Max depth to search in data structure. --max-depth MAX_DEPTH Max depth to search in data structure.
``` ```
@ -28,19 +28,19 @@ optional arguments:
Retrieve the storage slots of a local contract: Retrieve the storage slots of a local contract:
```shell ```shell
slither-read-storage file.sol 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --layout slither-read-storage file.sol 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --json storage_layout.json
``` ```
Retrieve the storage slots of a contract verified on an Etherscan-like platform: Retrieve the storage slots of a contract verified on an Etherscan-like platform:
```shell ```shell
slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --layout slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --json storage_layout.json
``` ```
To retrieve the values as well, pass `--value` and `--rpc-url $RPC_URL`: To retrieve the values as well, pass `--value` and `--rpc-url $RPC_URL`:
```shell ```shell
slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --layout --rpc-url $RPC_URL --value slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --json storage_layout.json --rpc-url $RPC_URL --value
``` ```
To view only the slot of the `slot0` structure variable, pass `--variable-name slot0`: To view only the slot of the `slot0` structure variable, pass `--variable-name slot0`:
@ -79,7 +79,7 @@ slither-read-storage 0xa2327a938Febf5FEC13baCFb16Ae10EcBc4cbDCF --variable-name
Take Avalanche, for instance: Take Avalanche, for instance:
```shell ```shell
slither-read-storage avax:0x0000000000000000000000000000000000000000 --layout --value --rpc-url $AVAX_RPC_URL slither-read-storage avax:0x0000000000000000000000000000000000000000 --json storage_layout.json --value --rpc-url $AVAX_RPC_URL
``` ```
## Limitations ## Limitations

@ -21,9 +21,9 @@ def parse_args() -> argparse.Namespace:
"\nTo retrieve a single variable's value:\n" "\nTo retrieve a single variable's value:\n"
+ "\tslither-read-storage $TARGET address --variable-name $NAME\n" + "\tslither-read-storage $TARGET address --variable-name $NAME\n"
+ "To retrieve a contract's storage layout:\n" + "To retrieve a contract's storage layout:\n"
+ "\tslither-read-storage $TARGET address --contract-name $NAME --layout\n" + "\tslither-read-storage $TARGET address --contract-name $NAME --json storage_layout.json\n"
+ "To retrieve a contract's storage layout and values:\n" + "To retrieve a contract's storage layout and values:\n"
+ "\tslither-read-storage $TARGET address --contract-name $NAME --layout --value\n" + "\tslither-read-storage $TARGET address --contract-name $NAME --json storage_layout.json --value\n"
+ "TARGET can be a contract address or project directory" + "TARGET can be a contract address or project directory"
), ),
) )

Loading…
Cancel
Save