fn encode_imm(num: U256, size: Option<u8>) -> Result<Vec<u8>>
Encode a U256 as big-endian bytes with optional fixed size.