evm_byte
Implements the EVM BYTE opcode over a UINT256 word. BYTE index 0 selects the most significant byte and index 31 selects the least significant byte. Negative indices and indices above 31 return zero. NULL input propagates to NULL.
Example
Runs locally
{"id":"sample_p61db4","title":"Sample"}
API reference
evm_byte(BIGINT, UINT256) #
Extracts one byte using EVM most-significant-byte-first indexing.
Inputs
| Name | Type | Use |
|---|---|---|
n | BIGINT BIGINT index; 0 is the most significant byte and 31 the least. | required positional |
x | UINT256 UINT256 EVM word. | required positional |
Returns
| Name | Type |
|---|---|
byte_value | UINT256 |
Selected byte. UINT256 value 0 through 255; out-of-range indices return zero; NULL input returns NULL.