Skip to content

Commit

Permalink
chore(docs): Update getting started contract tutorial (#4588)
Browse files Browse the repository at this point in the history
This PR add missing instruction to add the storage struct.
  • Loading branch information
critesjosh committed Feb 13, 2024
1 parent d071768 commit f417452
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ We are also using `balance_utils` from this import, a useful library that allows

This allows us to store our counter in a way that acts as an integer, abstracting the note logic.

## Declare storage

Add this below the imports. It declares the storage variables for our contract. We are going to store a mapping of values for each `AztecAddress`.

#include_code storage_struct /noir-projects/noir-contracts/contracts/counter_contract/src/main.nr rust

## Keep the counter private

Now we’ve got a mechanism for storing our private state, we can start using it to ensure the privacy of balances.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ contract Counter {
// docs:end:imports

// docs:start:storage_struct

struct Storage {
counters: Map<AztecAddress, EasyPrivateUint>,
}

// docs:end:storage_struct

// docs:start:constructor
Expand Down

0 comments on commit f417452

Please sign in to comment.