Module serialization

Module serialization 

Source

Functions§

address_from_256_from_reader
Reads a 32-byte padded address from a reader (last 20 bytes are the address).
address_from_reader
Reads a 20-byte address from a reader.
address_to_256_to_writer
Writes a 32-byte padded address to a writer (left-padded with zeros).
address_to_hash
Converts an address to a B256 hash (left-padded with zeros).
address_to_writer
Writes a 20-byte address to a writer.
bytestring_from_reader
Reads a length-prefixed byte string from a reader, rejecting lengths above max_bytes_to_read. Every caller must pass an explicit cap sized to the protocol context (typically MAX_L2_MESSAGE_SIZE) so an attacker-controlled length prefix can’t trigger a huge pre-allocation.
bytestring_to_writer
Writes a length-prefixed byte string to a writer.
hash_from_reader
Reads a 32-byte hash from a reader.
hash_to_writer
Writes a 32-byte hash to a writer.
int_to_hash
Converts a signed integer to a B256 hash (big-endian).
uint64_from_reader
Reads a uint64 from a reader (big-endian).
uint64_to_writer
Writes a uint64 to a writer (big-endian).
uint256_from_reader
Reads a U256 from a reader (big-endian).
uint_to_hash
Converts an unsigned integer to a B256 hash (big-endian).