pub fn encode_bytes_data(
buf: &mut [u8],
offset: usize,
data: &[u8],
) -> Result<usize, ZError>Expand description
Encode raw bytes (dynamic).
Use this when constructing the data part of bytes/string.
Does NOT write length prefix or offset (that’s for higher level logic).
Just pads the data to 32-byte boundary if needed?
Actually, ABI encoding of bytes is:
[offset] [length] [data + padding]
This helper writes [data + padding] given a destination.
Returns number of bytes written (including padding).