Skip to content

sto_validate

Serialized Objects
  • Parse an STObject pointed to by read_ptr
  • Return 1 if the serialization is valid, 0 otherwise.
int64_t sto_validate (
uint32_t read_ptr,
uint32_t read_len
);
int64_t result =
sto_validate(tx_out, sizeof(tx_out));
if (tx_len <= 0)
rollback("Invalid STO.", 12, 1);
NameTypeDescription
read_ptruint32_tThe buffer to read the source STObject from
read_lenuint32_tThe Length of the source object
TypeDescription
int64_t

1 if the STObject pointed to by read_ptr is a valid STObject.
0 if it isn’t.

If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.