Skip to content

Commit

Permalink
Update query and execute docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed May 6, 2024
1 parent 2a1520c commit fb7991c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/pages/core/entrypoints/execute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { Callout } from "nextra/components";

Execute pretty much does what it says on the tin: It executes some routine in
your contract after a remote (either another contract or some client) sent a
message.
What sets it apart from other functions is that the contract has mutable access
to the underlying storage.
This allows you to, for example, increment a counter or add a user to a lottery.
message.

This function is called when some wants you to, for example, increment a counter
or add a user to a lottery. Anything that might modify the state of the
contract.

## Definition

Expand Down
7 changes: 3 additions & 4 deletions src/pages/core/entrypoints/query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { Callout } from "nextra/components";

# Query

In the previous section we talked about the
[`execute` endpoint](./execute.mdx).
The `query` endpoint is actually pretty similar to execute with one key
difference: The storage is only accessible immutably.
In the previous section we talked about the [`execute` endpoint](./execute.mdx).
The `query` endpoint is actually pretty similar to its sibling `execute`, but
with one key difference: The storage is only accessible immutably.

This means you can only _read_ from the storage but not _write_ to it.

Expand Down

0 comments on commit fb7991c

Please sign in to comment.