@abi.decode
Decode ABI-encoded bytes into values given a comma-separated type list.
Returns: array
Syntax
Section titled “Syntax”@abi.decode(types data)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
types |
string |
Comma-separated Solidity types (e.g. “uint256,address”) |
data |
bytes |
ABI-encoded hex data |
Examples
Section titled “Examples”# Decode a single uint256set $values @abi.decode("uint256" 0x0000000000000000000000000000000000000000000000000000000000000064)print $values
# Decode multiple typesset $values @abi.decode("uint256,address" 0x000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000044fa8e6f47987339850636f88629646662444217)print $valuesSee Also
Section titled “See Also”- @abi.encodeCall — ABI-encode a function call
- @abi.encodePacked — packed encoding