diff --git a/examples/storage_variables/src/main.sw b/examples/storage_variables/src/main.sw index 9859640de90..89f4a72959e 100644 --- a/examples/storage_variables/src/main.sw +++ b/examples/storage_variables/src/main.sw @@ -42,10 +42,10 @@ impl StorageExample for Contract { #[storage(read)] fn get_something() -> (u64, u64, b256, bool) { ( - storage.var1.x.read(), - storage.var1.y.read(), - storage.var2.w.read(), - storage.var2.z.read(), + storage.var1.x.try_read().unwrap_or(0), + storage.var1.y.try_read().unwrap_or(0), + storage.var2.w.try_read().unwrap_or(0x0000000000000000000000000000000000000000000000000000000000000000), + storage.var2.z.try_read().unwrap_or(false), ) } // ANCHOR_END: storage_read