Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync with upstream 59f354c #64

Merged
merged 14 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
- [`forge selectors upload`](./reference/cli/forge/selectors/upload.md)
- [`forge selectors list`](./reference/cli/forge/selectors/list.md)
- [`forge selectors find`](./reference/cli/forge/selectors/find.md)
- [`forge selectors cache`](./reference/cli/forge/selectors/cache.md)
- [`forge snapshot`](./reference/cli/forge/snapshot.md)
- [`forge soldeer`](./reference/cli/forge/soldeer.md)
- [`forge soldeer init`](./reference/cli/forge/soldeer/init.md)
Expand All @@ -170,12 +171,12 @@
- [`cast 4byte`](./reference/cli/cast/4byte.md)
- [`cast 4byte-decode`](./reference/cli/cast/4byte-decode.md)
- [`cast 4byte-event`](./reference/cli/cast/4byte-event.md)
- [`cast abi-decode`](./reference/cli/cast/abi-decode.md)
- [`cast abi-encode`](./reference/cli/cast/abi-encode.md)
- [`cast access-list`](./reference/cli/cast/access-list.md)
- [`cast address-zero`](./reference/cli/cast/address-zero.md)
- [`cast admin`](./reference/cli/cast/admin.md)
- [`cast age`](./reference/cli/cast/age.md)
- [`cast artifact`](./reference/cli/cast/artifact.md)
- [`cast balance`](./reference/cli/cast/balance.md)
- [`cast base-fee`](./reference/cli/cast/base-fee.md)
- [`cast bind`](./reference/cli/cast/bind.md)
Expand All @@ -184,7 +185,6 @@
- [`cast call`](./reference/cli/cast/call.md)
- [`cast call --create`](./reference/cli/cast/call/--create.md)
- [`cast calldata`](./reference/cli/cast/calldata.md)
- [`cast calldata-decode`](./reference/cli/cast/calldata-decode.md)
- [`cast chain`](./reference/cli/cast/chain.md)
- [`cast chain-id`](./reference/cli/cast/chain-id.md)
- [`cast client`](./reference/cli/cast/client.md)
Expand All @@ -197,7 +197,12 @@
- [`cast constructor-args`](./reference/cli/cast/constructor-args.md)
- [`cast create2`](./reference/cli/cast/create2.md)
- [`cast creation-code`](./reference/cli/cast/creation-code.md)
- [`cast decode-abi`](./reference/cli/cast/decode-abi.md)
- [`cast decode-calldata`](./reference/cli/cast/decode-calldata.md)
- [`cast decode-eof`](./reference/cli/cast/decode-eof.md)
- [`cast decode-error`](./reference/cli/cast/decode-error.md)
- [`cast decode-event`](./reference/cli/cast/decode-event.md)
- [`cast decode-string`](./reference/cli/cast/decode-string.md)
- [`cast decode-transaction`](./reference/cli/cast/decode-transaction.md)
- [`cast disassemble`](./reference/cli/cast/disassemble.md)
- [`cast estimate`](./reference/cli/cast/estimate.md)
Expand Down Expand Up @@ -248,7 +253,6 @@
- [`cast sig-event`](./reference/cli/cast/sig-event.md)
- [`cast storage`](./reference/cli/cast/storage.md)
- [`cast storage-root`](./reference/cli/cast/storage-root.md)
- [`cast string-decode`](./reference/cli/cast/string-decode.md)
- [`cast to-ascii`](./reference/cli/cast/to-ascii.md)
- [`cast to-base`](./reference/cli/cast/to-base.md)
- [`cast to-bytes32`](./reference/cli/cast/to-bytes32.md)
Expand Down
4 changes: 2 additions & 2 deletions src/cheatcodes/env-bytes32.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ With environment variable `BYTES32_VALUE=0x00`,
```solidity
string memory key = "BYTES32_VALUE";
bytes32 expected = bytes32(0x0000000000000000000000000000000000000000000000000000000000000000);
bytes32 output = cheats.envBytes32(key);
bytes32 output = vm.envBytes32(key);
assert(output == expected);
```

Expand All @@ -38,6 +38,6 @@ bytes32[2] memory expected = [
bytes32(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D000000000000000000000000),
bytes32(0x0000000000000000000000000000000000000000000000000000000000000000)
];
bytes32[] memory output = cheats.envBytes32(key, delimiter);
bytes32[] memory output = vm.envBytes32(key, delimiter);
assert(keccak256(abi.encodePacked((output))) == keccak256(abi.encodePacked((expected))));
```
2 changes: 1 addition & 1 deletion src/forge/traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Some traces might be harder to grasp at first glance. These include:

- The `OOG` shorthand stands for "Out Of Gas".
- The acronym `EOF` stands for "Ethereum Object Format", which introduces an extensible and versioned container format for EVM bytecode. For more information, read [here](https://evmobjectformat.org/).
- `NotActivated` means the feature or opcode is not activated. Some versions of the EVM only support certain opcodes. You may need to use a more recent version usign the `--evm_version` flag. For example, the `PUSH0` opcode is only available since the [Shanghai](https://www.evm.codes/?fork=shanghai) hardfork.
- `NotActivated` means the feature or opcode is not activated. Some versions of the EVM only support certain opcodes. You may need to use a more recent version using the `--evm_version` flag. For example, the `PUSH0` opcode is only available since the [Shanghai](https://www.evm.codes/?fork=shanghai) hardfork.
- `InvalidFEOpcode` means that an undefined bytecode value has been encountered during execution. The EVM catches the unknown bytecode and returns the `INVALID` opcode instead, of value `0xFE`. You can find out more [here](https://www.evm.codes/#fe).

For a deeper insight into the various traces, you can explore the [revm source code](https://github.com/bluealloy/revm/blob/main/crates/interpreter/src/instruction_result.rs).
Expand Down
16 changes: 8 additions & 8 deletions src/reference/cast/cast-4byte-decode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@

### NAME

cast-4byte-decode - Decode ABI-encoded calldata using <https://sig.eth.samczsun.com>.
cast-4byte-decode - Decode ABI-encoded calldata using <https://openchain.xyz/signatures>.

### SYNOPSIS

``cast 4byte-decode`` [*options*] *calldata*
`cast 4byte-decode` [*options*] _calldata_

### DESCRIPTION

Decode ABI-encoded calldata using <https://sig.eth.samczsun.com>.
Decode ABI-encoded calldata using <https://openchain.xyz/signatures>.

### OPTIONS

#### 4byte Options

`--id` *id*
`--id` _id_
&nbsp;&nbsp;&nbsp;&nbsp;The index of the resolved signature to use.
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<https://sig.eth.samczsun.com> can have multiple possible signatures for a given selector.
&nbsp;&nbsp;&nbsp;&nbsp;<https://openchain.xyz/signatures> can have multiple possible signatures for a given selector.
&nbsp;&nbsp;&nbsp;&nbsp;The index can be an integer, or the tags "earliest" and "latest".

{{#include common-options.md}}

### EXAMPLES

1. Decode calldata for a `transfer` call:
```sh
cast 4byte-decode 0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d00000000000000000000000000000000000000000000000000174b37380cea000
```
```sh
cast 4byte-decode 0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d00000000000000000000000000000000000000000000000000174b37380cea000
```

### SEE ALSO

Expand Down
12 changes: 6 additions & 6 deletions src/reference/cast/cast-4byte-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

### NAME

cast-4byte-event - Get the event signature for a given topic 0 from <https://sig.eth.samczsun.com>.
cast-4byte-event - Get the event signature for a given topic 0 from <https://openchain.xyz/signatures>.

### SYNOPSIS

``cast 4byte-event`` [*options*] *topic_0*
`cast 4byte-event` [*options*] _topic_0_

### DESCRIPTION

Get the event signature for a given topic 0 from <https://sig.eth.samczsun.com>.
Get the event signature for a given topic 0 from <https://openchain.xyz/signatures>.

### OPTIONS

Expand All @@ -19,9 +19,9 @@ Get the event signature for a given topic 0 from <https://sig.eth.samczsun.com>.
### EXAMPLES

1. Get the event signature for a topic 0 of `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`:
```sh
cast 4byte-event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
```
```sh
cast 4byte-event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
```

### SEE ALSO

Expand Down
12 changes: 6 additions & 6 deletions src/reference/cast/cast-4byte.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

### NAME

cast-4byte - Get the function signatures for the given selector from <https://sig.eth.samczsun.com>.
cast-4byte - Get the function signatures for the given selector from <https://openchain.xyz/signatures>.

### SYNOPSIS

``cast 4byte`` [*options*] *sig*
`cast 4byte` [*options*] _sig_

### DESCRIPTION

Get the function signatures for the given selector from <https://sig.eth.samczsun.com>.
Get the function signatures for the given selector from <https://openchain.xyz/signatures>.

### OPTIONS

Expand All @@ -19,9 +19,9 @@ Get the function signatures for the given selector from <https://sig.eth.samczsu
### EXAMPLES

1. Get the function signature for the selector `0x8cc5ce99`:
```sh
cast 4byte 0x8cc5ce99
```
```sh
cast 4byte 0x8cc5ce99
```

### SEE ALSO

Expand Down
12 changes: 6 additions & 6 deletions src/reference/cast/cast-pretty-calldata.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ cast-pretty-calldata - Pretty print calldata.

### SYNOPSIS

``cast pretty-calldata`` [*options*] *calldata*
`cast pretty-calldata` [*options*] _calldata_

### DESCRIPTION

Pretty print calldata.

Tries to decode the calldata using <https://sig.eth.samczsun.com> unless `--offline` is passed.
Tries to decode the calldata using <https://openchain.xyz/signatures> unless `--offline` is passed.

### OPTIONS

#### 4byte Options

`-o`
`--offline`
&nbsp;&nbsp;&nbsp;&nbsp;Skip the <https://sig.eth.samczsun.com> lookup.
&nbsp;&nbsp;&nbsp;&nbsp;Skip the <https://openchain.xyz/signatures> lookup.

{{#include common-options.md}}

### EXAMPLES

1. Decode calldata for a `transfer` call:
```sh
cast pretty-calldata 0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d00000000000000000000000000000000000000000000000000174b37380cea000
```
```sh
cast pretty-calldata 0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d00000000000000000000000000000000000000000000000000174b37380cea000
```

### SEE ALSO

Expand Down
2 changes: 1 addition & 1 deletion src/reference/cast/cast-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cast-storage - Get the raw value of a contract's storage slot or its full storag

Get the raw value of a contract's storage slot. (Slot locations greater than 18446744073709551615 (u64::MAX) should be given as hex. Use `cast index` to compute mapping slots.)

Emit the slot number to get the full storage layout (requires contract to be verified on Etherscan with a Solidity version > 0.6.5 or you must be in a Forge project with a local contract matching the deployed bytecode).
Omit the slot number to get the full storage layout (requires contract to be verified on Etherscan with a Solidity version > 0.6.5 or you must be in a Forge project with a local contract matching the deployed bytecode).

The address (*address*) can be an ENS name or an address.

Expand Down
8 changes: 4 additions & 4 deletions src/reference/cast/cast-upload-signature.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cast-upload-signature

### DESCRIPTION

Upload the given signatures to [https://sig.eth.samczsun.com](https://sig.eth.samczsun.com).
Upload the given signatures to [https://openchain.xyz/signatures](https://openchain.xyz/signatures).

### OPTIONS

Expand All @@ -19,7 +19,7 @@ Upload the given signatures to [https://sig.eth.samczsun.com](https://sig.eth.sa
### EXAMPLES

1. Upload signatures
```sh
cast upload-signature 'function approve(address,uint256)' \
```sh
cast upload-signature 'function approve(address,uint256)' \
'transfer(uint256)' 'event Transfer(uint256,address)'
```
```
32 changes: 16 additions & 16 deletions src/reference/cast/cast.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cast - Perform Ethereum RPC calls from the comfort of your command line.

### SYNOPSIS

`cast` [*options*] *command* [*args*]
`cast` [*options*] _command_ [*args*]
`cast` [*options*] `--version`
`cast` [*options*] `--help`

Expand Down Expand Up @@ -132,13 +132,13 @@ This program is a set of tools to interact with Ethereum and perform conversions
&nbsp;&nbsp;&nbsp;&nbsp;ABI encode the given function arguments, excluding the selector.

[cast 4byte](./cast-4byte.md)
&nbsp;&nbsp;&nbsp;&nbsp;Get the function signatures for the given selector from <https://sig.eth.samczsun.com>.
&nbsp;&nbsp;&nbsp;&nbsp;Get the function signatures for the given selector from <https://openchain.xyz/signatures>.

[cast 4byte-decode](./cast-4byte-decode.md)
&nbsp;&nbsp;&nbsp;&nbsp;Decode ABI-encoded calldata using <https://sig.eth.samczsun.com>.
&nbsp;&nbsp;&nbsp;&nbsp;Decode ABI-encoded calldata using <https://openchain.xyz/signatures>.

[cast 4byte-event](./cast-4byte-event.md)
&nbsp;&nbsp;&nbsp;&nbsp;Get the event signature for a given topic 0 from <https://sig.eth.samczsun.com>.
&nbsp;&nbsp;&nbsp;&nbsp;Get the event signature for a given topic 0 from <https://openchain.xyz/signatures>.

[cast calldata](./cast-calldata.md)
&nbsp;&nbsp;&nbsp;&nbsp;ABI-encode a function with arguments.
Expand All @@ -153,7 +153,7 @@ This program is a set of tools to interact with Ethereum and perform conversions
&nbsp;&nbsp;&nbsp;&nbsp;Extracts function selectors and arguments from bytecode

[cast upload-signature](./cast-upload-signature.md)
&nbsp;&nbsp;&nbsp;&nbsp;Upload the given signatures to https://sig.eth.samczsun.com.
&nbsp;&nbsp;&nbsp;&nbsp;Upload the given signatures to https://openchain.xyz/signatures.

#### Conversion Commands

Expand Down Expand Up @@ -295,22 +295,22 @@ This program is a set of tools to interact with Ethereum and perform conversions

1. Call a function on a contract:

```sh
cast call 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
"balanceOf(address)(uint256)" 0x...
```
```sh
cast call 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
"balanceOf(address)(uint256)" 0x...
```

2. Decode raw calldata:

```sh
cast calldata-decode "transfer(address,uint256)" \
0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d0000000000000000000000000000000000000000000000000008a8e4b1a3d8000
```
```sh
cast calldata-decode "transfer(address,uint256)" \
0xa9059cbb000000000000000000000000e78388b4ce79068e89bf8aa7f218ef6b9ab0e9d0000000000000000000000000000000000000000000000000008a8e4b1a3d8000
```

3. Encode calldata:
```sh
cast calldata "someFunc(address,uint256)" 0x... 1
```
```sh
cast calldata "someFunc(address,uint256)" 0x... 1
```

### BUGS

Expand Down
Loading
Loading