Function casper_contract::ext_ffi::casper_new_uref [−][src]
pub unsafe extern "C" fn casper_new_uref(
uref_ptr: *mut u8,
value_ptr: *const u8,
value_size: usize
)
Expand description
This function causes the runtime to generate a new URef
, with
the provided value stored under it in the global state. The new
URef
is written (in serialized form) to the wasm linear
memory starting from the key_ptr
offset. Note that data corruption is possible if not
enough memory is allocated for the URef
at key_ptr
. This
function will cause a Trap
if the bytes in wasm memory from offset value_ptr
to
value_ptr + value_size
cannot be de-serialized into a Value
.
Arguments
key_ptr
- pointer to the offset in wasm memory where the newURef
will be writtenvalue_ptr
- pointer to bytes representing the value to write under the newURef
value_size
- size of the value (in bytes)