From 2ea2a915cda2fdbd6c7dcd5c6f21526619fd7210 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 15 May 2024 13:35:40 +0200 Subject: [PATCH] minor --- docs/zkapps/o1js/offchain-storage.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/zkapps/o1js/offchain-storage.mdx b/docs/zkapps/o1js/offchain-storage.mdx index ab9111520..9a59d1220 100644 --- a/docs/zkapps/o1js/offchain-storage.mdx +++ b/docs/zkapps/o1js/offchain-storage.mdx @@ -42,7 +42,7 @@ All offchain state resides within a single Merkle Map, which is essentially a wr Under this framework, [Actions and Reducer](zkapps/o1js/actions-and-reducer.mdx) are utilized to manage state changes, with actions dispatching state updates and reducers settling them. Additionally, a Merkle Tree is employed to maintain a provably secure commitment to the data, with the root stored on-chain. -Before users can access published state, it must first undergo settlement. +Prior to users accessing published state, it must first undergo settlement. Thanks to the design of Offchain storage, all state is recoverable from actions alone, eliminating the need for additional events or external data storage. ## Utilizing Offchain Storage @@ -113,6 +113,8 @@ class MyContract extends SmartContract { } ``` +**It is important to mention that state is only available after it was settled via `settle()`!** + ### Utilizing Offchain Storage Now developers can utilize Offchain storage in any of their smart contract methods, as demonstrated below: @@ -130,3 +132,5 @@ class MyContract extends SmartContract { } } ``` + +Currently, Offchain storage types of Field support `field.get()` and `field.set(newValue)`, while maps support `map.get(key)` and `map.set(key, newValue)`.