Function std::storage::storable_slice::clear_slice_slot
pub fn clear_slice_slot(slot: b256) Expand description
Clears a slice from storage, stored in a single dynamic slot.
Arguments
slot: [b256] - The storage slot to clear the slice from.
Number of Storage Accesses
- Clears:
1(for the slice content)
Examples
use std::{alloc::alloc_bytes, storage::{clear_slice_slot, write_slice_slot, read_slice_slot}};
fn foo() {
let slice = asm(ptr: (alloc_bytes(1), 1)) { ptr: raw_slice };
write_slice_slot(b256::zero(), slice);
assert(read_slice_slot(b256::zero()).is_some());
clear_slice_slot(b256::zero());
assert(read_slice_slot(b256::zero()).is_none());
}