diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 131d064a10..5e2c75ae7b 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -248,7 +248,7 @@ pub unsafe extern "C" fn cairo_native__dict_get( #[no_mangle] pub unsafe extern "C" fn cairo_native__dict_gas_refund(ptr: *const FeltDict) -> u64 { let dict = &*ptr; - (dict.count - dict.inner.len() as u64) * *DICT_GAS_REFUND_PER_ACCESS + (dict.count.saturating_sub(dict.inner.len() as u64)) * *DICT_GAS_REFUND_PER_ACCESS } /// Compute `ec_point_from_x_nz(x)` and store it.