Skip to content

Commit

Permalink
fix: newer version for private counter
Browse files Browse the repository at this point in the history
  • Loading branch information
sambarnes committed Dec 7, 2023
1 parent d85e74c commit 1d1dfc6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion circuits/contracts/private-counter/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "private_counter"
type = "contract"
authors = [""]
compiler_version = "0.11.1"
compiler_version = ">=0.18.0"

[dependencies]
aztec = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "master" , directory = "aztec" }
Expand Down
6 changes: 3 additions & 3 deletions circuits/contracts/private-counter/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ contract PrivateCounter {

// Increment the owner's counter
#[aztec(private)]
fn increment(owner: Field) {
fn increment(owner: Field) {
let storage = Storage::init(Context::private(&mut context));
let counts = storage.counts;
counts.at(owner).add(1, owner);
Expand All @@ -65,9 +65,9 @@ contract PrivateCounter {
contract_address: Field,
nonce: Field,
storage_slot: Field,
preimage: [Field; VALUE_NOTE_LEN],
preimage: [Field; VALUE_NOTE_LEN]
) -> [Field; 4] {
let note_header = NoteHeader { contract_address, nonce, storage_slot };
let note_header = NoteHeader { contract_address, nonce, storage_slot, is_transient: false };
note_utils::compute_note_hash_and_nullifier(ValueNoteMethods, note_header, preimage)
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions content/contracts/private-counter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ a contract for users to `increment()` or `get()` their own secret counter
make sure you're on the right version of noir, and create the project

```
noirup -v aztec
noirup -v v0.18.0-aztec.5
nargo new --contract --name private_co private-counter
```

Expand Down Expand Up @@ -140,9 +140,9 @@ contract PrivateCounter {
contract_address: Field,
nonce: Field,
storage_slot: Field,
preimage: [Field; VALUE_NOTE_LEN],
preimage: [Field; VALUE_NOTE_LEN]
) -> [Field; 4] {
let note_header = NoteHeader { contract_address, nonce, storage_slot };
let note_header = NoteHeader { contract_address, nonce, storage_slot, is_transient: false };
note_utils::compute_note_hash_and_nullifier(ValueNoteMethods, note_header, preimage)
}
}
Expand Down

0 comments on commit 1d1dfc6

Please sign in to comment.