Calldata array slice
Remove a four-byte selector and decode the remaining calldata.
Solidity 0.8.36REPL mode
Why use this example
Use this pattern to explore how Solidity represents typed values and how state-changing expressions affect storage. The entry isolates calldata array slice so its input, result, and state changes stay easy to compare.
Solidity to run
contract PayloadDecoder {
function decode(bytes calldata payload) external pure returns (uint256) {
return abi.decode(payload[4:], (uint256));
}
}
PayloadDecoder decoder = new PayloadDecoder()
bytes memory payload = abi.encodePacked(bytes4(keccak256("value(uint256)")), abi.encode(uint256(42)))
decoder.decode(payload)Official Solidity reference
Compare this focused investigation with the complete language definition in the Solidity documentation.
Array slicesWhat to expect
The decoder removes the first four bytes and ABI-decodes the remaining payload to uint256 value 42.
Continue the investigation
Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.
Read about state and storage Reproducible investigation