Skip to content

Commit

Permalink
fixed update_score example function in public state docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpitsikoulis committed Feb 22, 2025
1 parent 66ce191 commit 14dd6eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/Guide/08_public_program_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ and a public `u64` value representing the number of microcredits owned by the ad
Mappings within programs are identified by the `mapping` identifier. Any program where this keyword appears contains an
on-chain mapping. An example of a program that uses a mapping is shown below:
```
program player_mapping_example.aleo
program player_mapping_example.aleo;
// The mapping identifier representing a score
mapping score:
key player as address.public;
value score as u64.public;
key as address.public;
value as u64.public;
// The update score function
function update_score:
Expand All @@ -45,7 +45,7 @@ finalize update_score:
input r1 as u64.public;
get.or_use score[r0] 0u64 into r2;
add r1 r2 into r3;
set r3 into account[r0];
set r3 into score[r0];
```

Note that the above function has a `finalize` identifier. This identifier is used to identify a portion of a function's
Expand Down

0 comments on commit 14dd6eb

Please sign in to comment.