pub fn clear_slots(slot: b256, number_of_slots: u64) 
Expand description

Clears number_of_slots slots of dynamic size, starting at slot.

Additional Information

If number_of_slots is zero, storage access will still occur,
but no slots will be cleared.

Arguments

  • slot: [b256] - The storage slot from which to start clearing.
  • number_of_slots: [u64] - The number of slots to clear.

Number of Storage Accesses

  • Clears: 1

Examples

use std::storage::storage_api::{read_slot, write_slot, clear_slots};

fn foo() {
    let five = 5_u64;
    write_slot(b256::zero(), five);
    clear_slots(b256::zero(), 1);
    assert(read_slot::<u64>(b256::zero(), 0).is_none());
}