[−][src]Function casper_contract::ext_ffi::new_uref
pub unsafe extern "C" fn new_uref(
uref_ptr: *mut u8,
value_ptr: *const u8,
value_size: usize
)
This function causes the runtime to generate a new [casper_types::uref::URef
], with
the provided value stored under it in the global state. The new
[casper_types::uref::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 [casper_types::uref::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 new [casper_types::uref::URef
] will be writtenvalue_ptr
- pointer to bytes representing the value to write under the new [casper_types::uref::URef
]value_size
- size of the value (in bytes)