Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
774854d
changed storage macro to look for attribute
Thunkar Mar 19, 2024
57a802c
added abi exports to contract artifact
Thunkar Mar 22, 2024
da88d88
changed storage macro to look for attribute
Thunkar Mar 19, 2024
478f344
added abi exports to contract artifact
Thunkar Mar 22, 2024
88c1a8c
reverted change
Thunkar Mar 22, 2024
7be1b9a
removed unused variable
Thunkar Mar 22, 2024
c8fcca8
clippy pass
Thunkar Mar 22, 2024
ba7ebea
fixes and consistency
Thunkar Mar 22, 2024
2d62891
cleanup and test
Thunkar Mar 26, 2024
02deec3
updated snapshots, types
Thunkar Mar 26, 2024
929028e
changed integer serialization
Thunkar Mar 26, 2024
c73be89
added abi exports to contract artifact
Thunkar Mar 22, 2024
57f4b31
added abi exports to contract artifact
Thunkar Mar 22, 2024
b31e3d4
reverted change
Thunkar Mar 22, 2024
85e78fa
clippy pass
Thunkar Mar 22, 2024
37567ce
updated snapshots
Thunkar Apr 1, 2024
c872fa0
Update noir/noir-repo/aztec_macros/src/lib.rs
Thunkar Apr 2, 2024
148cc25
PR changes
Thunkar Apr 2, 2024
1136187
more pr improvements
Thunkar Apr 2, 2024
498b03e
reverted abi tag error
Thunkar Apr 2, 2024
69f0c9e
clippy pass
Thunkar Apr 2, 2024
e521c00
pr comment
Thunkar Apr 2, 2024
048cbd6
added tuple values
Thunkar Apr 2, 2024
b0d5001
removed unused import
Thunkar Apr 2, 2024
9d9cfb9
fixed integer conversion
Thunkar Apr 2, 2024
0c33775
wip
Thunkar Mar 22, 2024
f41f19a
wip
Thunkar Mar 22, 2024
f2dc78b
storage layout export and note ids
Thunkar Mar 26, 2024
44f205b
working storage layout and notes
Thunkar Mar 26, 2024
7bb6c68
updated snapshot
Thunkar Mar 26, 2024
e9ac33e
better codegen and fixed test
Thunkar Mar 26, 2024
598ad90
removed macro pass, general cleanup and fixes
Thunkar Mar 27, 2024
b416e83
used in e2e, clippy
Thunkar Mar 27, 2024
520e295
fixed snapshot
Thunkar Mar 27, 2024
81d5043
prettier run
Thunkar Mar 27, 2024
b285dbc
yet another snapshot. fun
Thunkar Mar 27, 2024
c4f3687
updated artifact hash
Thunkar Apr 1, 2024
4184fbd
correct hash
Thunkar Apr 1, 2024
a615033
guess what
Thunkar Apr 2, 2024
eeaf620
experimental support
Thunkar Mar 22, 2024
bcf77b1
merge conflicts
Thunkar Apr 1, 2024
6aaba24
fmt
Thunkar Apr 1, 2024
f79ec29
increased test machine size, hash
Thunkar Apr 2, 2024
99c648b
avoid oom
Thunkar Apr 2, 2024
3726df3
correct order
Thunkar Apr 2, 2024
8bfcf27
reverted ci changes
Thunkar Apr 2, 2024
40f5762
fixed constants
Thunkar Apr 2, 2024
7e15de5
fixed artifact hash
Thunkar Apr 2, 2024
eb46d88
feat: Decoded return values for simulations
LHerskind Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions avm-transpiler/src/transpile_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct TranspiledContract {
pub name: String,
// Functions can be ACIR or AVM
pub functions: Vec<AvmOrAcirContractFunction>,
pub events: serde_json::Value,
pub outputs: serde_json::Value,
pub file_map: serde_json::Value,
//pub warnings: serde_json::Value,
}
Expand All @@ -29,7 +29,7 @@ pub struct CompiledAcirContract {
pub noir_version: String,
pub name: String,
pub functions: Vec<AcirContractFunction>,
pub events: serde_json::Value,
pub outputs: serde_json::Value,
pub file_map: serde_json::Value,
//pub warnings: serde_json::Value,
}
Expand Down Expand Up @@ -113,7 +113,7 @@ impl From<CompiledAcirContract> for TranspiledContract {
noir_version: contract.noir_version,
name: contract.name,
functions, // some acir, some transpiled avm functions
events: contract.events,
outputs: contract.outputs,
file_map: contract.file_map,
//warnings: contract.warnings,
}
Expand Down
1 change: 1 addition & 0 deletions boxes/boxes/react/src/contracts/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ contract BoxReact {

use dep::value_note::value_note::{ValueNote, VALUE_NOTE_LEN};

#[aztec(storage)]
struct Storage {
numbers: Map<AztecAddress, PrivateMutable<ValueNote>>,
}
Expand Down
1 change: 1 addition & 0 deletions boxes/boxes/vanilla/src/contracts/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ contract Vanilla {

use dep::value_note::value_note::{ValueNote, VALUE_NOTE_LEN};

#[aztec(storage)]
struct Storage {
numbers: Map<AztecAddress, PrivateMutable<ValueNote>>,
}
Expand Down
5 changes: 1 addition & 4 deletions docs/docs/developers/contracts/references/storage/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ Public state follows the Ethereum style account model, where each contract has i

## Storage struct

:::info
The struct **must** be called `Storage` for the Aztec.nr library to properly handle it (this will be relaxed in the future).
:::

```rust
#[aztec(storage)]
struct Storage {
// public state variables
// private state variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ To learn more about how storage works in Aztec, read [the concepts](../../../../

[See the storage reference](../../references/storage/main.md).

:::info
The struct **must** be called `Storage` for the Aztec.nr library to properly handle it (this will be relaxed in the future).
:::

```rust
#[aztec(storage)]
struct Storage {
// public state variables
// private state variables
Expand Down
28 changes: 3 additions & 25 deletions docs/docs/developers/sandbox/references/cheat_codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,18 +461,11 @@ The baseSlot is specified in the Aztec.nr contract.
#### Example

```rust
#[aztec(storage)]
struct Storage {
balances: Map<AztecAddress, PublicMutable<Field>>,
}

impl Storage {
fn init() -> Self {
Storage {
balances: Map::new(1, |slot| PublicMutable::new(slot)),
}
}
}

contract Token {
...
}
Expand All @@ -499,18 +492,11 @@ Note: One Field element occupies a storage slot. Hence, structs with multiple fi
#### Example

```rust
#[aztec(storage)]
struct Storage {
balances: Map<AztecAddress, PublicMutable<Field>>,
}

impl Storage {
fn init(context: Context) -> Self {
Storage {
balances: Map::new(context, 1, |context, slot| PublicMutable::new(context, slot)),
}
}
}

contract Token {
...
}
Expand Down Expand Up @@ -538,20 +524,12 @@ Note: One Field element occupies a storage slot. Hence, structs with multiple fi

#### Example
```rust
#[aztec(storage)]
struct Storage {
...
pending_shields: Set<TransparentNote, TRANSPARENT_NOTE_LEN>,
}

impl Storage {
fn init() -> Self {
Storage {
...
pending_shields: Set::new(context, 5, TransparentNoteMethods),
}
}
}

contract Token {
...
}
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ library Constants {
uint256 internal constant DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE =
0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631;
uint256 internal constant DEPLOYER_CONTRACT_ADDRESS =
0x1ad693effc2a4a40fdf5911ff29e19d2b6cd3cf73e6c3685519a6fb783144dcb;
0x2e89c51c28aefc6b630af43a5908634e4cf552115280eb9fd783bbd224c0bb57;
uint256 internal constant L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 17;
uint256 internal constant MAX_NOTE_FIELDS_LENGTH = 20;
uint256 internal constant GET_NOTE_ORACLE_RETURN_LENGTH = 23;
Expand Down
10 changes: 5 additions & 5 deletions l1-contracts/test/fixtures/empty_block_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x122e56310a16134c202e94b3ba9cb74de123f7ec493e601d2f0b6da00cf57a4a",
"archive": "0x28d85d64f43aeffd30919743ecad7e51dbaa60f58dfb98020cbb9ffc29b8b354",
"body": "0x00000000",
"txsEffectsHash": "0x00df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d2493896",
"decodedHeader": {
Expand All @@ -23,8 +23,8 @@
"chainId": 31337,
"timestamp": 0,
"version": 1,
"coinbase": "0x66440eb666440eb666440eb666440eb666440eb6",
"feeRecipient": "0x061ca689507c7f1ccc68c2ad086c9d5d94f50869cb1b718c6a46aaf77a4500ba"
"coinbase": "0xd2335b584d0bbc706a1132378faf166ac32b253b",
"feeRecipient": "0x07bc43bbef62d5bb1f694a7ed2d83de7b89ba51b87bbdb5fed59cc92f371cfce"
},
"lastArchive": {
"nextAvailableLeafIndex": 1,
Expand All @@ -51,8 +51,8 @@
}
}
},
"header": "0x1e3523d3bd50ae6204e1ec2ee1bdf8af4c6217ec80900052d2cf4259379dd13000000001000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000001016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000000800bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001000572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000800000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000066440eb666440eb666440eb666440eb666440eb6061ca689507c7f1ccc68c2ad086c9d5d94f50869cb1b718c6a46aaf77a4500ba",
"publicInputsHash": "0x00b833c76dd93572e83879eeb4085a3cd71f24831384fb4d3fe531ed87b859e3",
"header": "0x1e3523d3bd50ae6204e1ec2ee1bdf8af4c6217ec80900052d2cf4259379dd13000000001000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000001016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000000800bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001000572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000800000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000d2335b584d0bbc706a1132378faf166ac32b253b07bc43bbef62d5bb1f694a7ed2d83de7b89ba51b87bbdb5fed59cc92f371cfce",
"publicInputsHash": "0x0036d6337bcff3e8654b668e271af95bea640bca5d467bcfedf750e329898812",
"numTxs": 0
}
}
14 changes: 7 additions & 7 deletions l1-contracts/test/fixtures/empty_block_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x0d53ab5014f578345d853cd208bda74db64358fef8e5f646240db05893f6e780",
"archive": "0x18082b129edbbaabb50b7470846cf28f40b70f75d5709bb8420aa4e7ab2de654",
"body": "0x00000000",
"txsEffectsHash": "0x00df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d2493896",
"decodedHeader": {
Expand All @@ -21,14 +21,14 @@
"globalVariables": {
"blockNumber": 2,
"chainId": 31337,
"timestamp": 1711637579,
"timestamp": 1712149260,
"version": 1,
"coinbase": "0x66440eb666440eb666440eb666440eb666440eb6",
"feeRecipient": "0x061ca689507c7f1ccc68c2ad086c9d5d94f50869cb1b718c6a46aaf77a4500ba"
"coinbase": "0xd2335b584d0bbc706a1132378faf166ac32b253b",
"feeRecipient": "0x07bc43bbef62d5bb1f694a7ed2d83de7b89ba51b87bbdb5fed59cc92f371cfce"
},
"lastArchive": {
"nextAvailableLeafIndex": 2,
"root": "0x122e56310a16134c202e94b3ba9cb74de123f7ec493e601d2f0b6da00cf57a4a"
"root": "0x28d85d64f43aeffd30919743ecad7e51dbaa60f58dfb98020cbb9ffc29b8b354"
},
"stateReference": {
"l1ToL2MessageTree": {
Expand All @@ -51,8 +51,8 @@
}
}
},
"header": "0x122e56310a16134c202e94b3ba9cb74de123f7ec493e601d2f0b6da00cf57a4a00000002000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000002016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000001000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000c00000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000006605844b66440eb666440eb666440eb666440eb666440eb6061ca689507c7f1ccc68c2ad086c9d5d94f50869cb1b718c6a46aaf77a4500ba",
"publicInputsHash": "0x00035031752fa374209f1ec4bc08613cae25ba65779c10130681421f6e71c6d9",
"header": "0x28d85d64f43aeffd30919743ecad7e51dbaa60f58dfb98020cbb9ffc29b8b35400000002000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000002016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000001000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000c00000000000000000000000000000000000000000000000000000000000007a690000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000660d530cd2335b584d0bbc706a1132378faf166ac32b253b07bc43bbef62d5bb1f694a7ed2d83de7b89ba51b87bbdb5fed59cc92f371cfce",
"publicInputsHash": "0x00056a5ebf2e50d61c9dab6ff88579d680c284f8ad94a2c7e249fb3cc65be3fb",
"numTxs": 0
}
}
16 changes: 8 additions & 8 deletions l1-contracts/test/fixtures/mixed_block_0.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions l1-contracts/test/fixtures/mixed_block_1.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/prelude.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
state_vars::{
map::Map, private_immutable::PrivateImmutable, private_mutable::PrivateMutable,
public_immutable::PublicImmutable, public_mutable::PublicMutable, private_set::PrivateSet,
shared_immutable::SharedImmutable
shared_immutable::SharedImmutable, storage::Storable
},
log::{emit_unencrypted_log, emit_encrypted_log}, context::PrivateContext,
note::{
Expand Down
6 changes: 6 additions & 0 deletions noir-projects/aztec-nr/aztec/src/state_vars/storage.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ trait Storage<T> where T: Serialize<N> + Deserialize<N> {
self.storage_slot
}
}

struct Storable<N> {
slot: Field,
typ: str<N>
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ contract AppSubscription {

use crate::subscription_note::{SubscriptionNote, SUBSCRIPTION_NOTE_LEN};

#[aztec(storage)]
struct Storage {
// The following is only needed in private but we use ShareImmutable here instead of PrivateImmutable because
// the value can be publicly known and SharedImmutable provides us with a better devex here because we don't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ contract AvmTest {
// avm lib
use dep::aztec::avm::hash::{keccak256, poseidon, sha256};

#[aztec(storage)]
struct Storage {
single: PublicMutable<Field>,
list: PublicMutable<Note>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ contract Benchmarking {

use dep::aztec::{context::Context};

#[aztec(storage)]
struct Storage {
notes: Map<AztecAddress, PrivateSet<ValueNote>>,
balances: Map<AztecAddress, PublicMutable<Field>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ contract CardGame {
use crate::cards::{PACK_CARDS, Deck, Card, get_pack_cards, compute_deck_strength};
use crate::game::{NUMBER_OF_PLAYERS, NUMBER_OF_CARDS_DECK, PLAYABLE_CARDS, PlayerEntry, Game, GAME_SERIALIZED_LEN};

#[aztec(storage)]
struct Storage {
collections: Map<AztecAddress, Deck>,
game_decks: Map<Field, Map<AztecAddress, Deck>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ contract Child {
};
use dep::value_note::value_note::ValueNote;

#[aztec(storage)]
struct Storage {
current_value: PublicMutable<Field>,
a_private_value: PrivateSet<ValueNote>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ contract Claim {
use dep::value_note::value_note::ValueNote;
use interfaces::Token;

#[aztec(storage)]
struct Storage {
// Address of a contract based on whose notes we distribute the rewards
target_contract: SharedImmutable<AztecAddress>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use dep::aztec::protocol_types::{
traits::Serialize
};

// #[event]
// #[aztec(event)]
struct ContractClassRegistered {
contract_class_id: ContractClassId,
version: Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Serialize<MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS + 3> for
}
}

// #[event]
// #[aztec(event)]
struct ClassPrivateFunctionBroadcasted {
contract_class_id: ContractClassId,
artifact_metadata_hash: Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Serialize<MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS + 2
}
}

// #[event]
// #[aztec(event)]
struct ClassUnconstrainedFunctionBroadcasted {
contract_class_id: ContractClassId,
artifact_metadata_hash: Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use dep::aztec::protocol_types::{
constants::DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE, traits::Serialize
};

// #[event]
// #[aztec(event)]
struct ContractInstanceDeployed {
address: AztecAddress,
version: u8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contract Counter {
// docs:end:imports

// docs:start:storage_struct
#[aztec(storage)]
struct Storage {
counters: Map<AztecAddress, EasyPrivateUint>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract Crowdfunding {
use dep::value_note::value_note::ValueNote;
use interfaces::Token;

#[event]
#[aztec(event)]
struct WithdrawalProcessed {
who: AztecAddress,
amount: u64,
Expand All @@ -21,6 +21,7 @@ contract Crowdfunding {
}
}

#[aztec(storage)]
struct Storage {
// Token used for donations (e.g. DAI)
donation_token: SharedImmutable<AztecAddress>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contract DelegatedOn {
};
use dep::value_note::value_note::ValueNote;

#[aztec(storage)]
struct Storage {
current_value: PublicMutable<Field>,
a_private_value: PrivateSet<ValueNote>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contract Delegator {
};
use dep::value_note::value_note::ValueNote;

#[aztec(storage)]
struct Storage {
current_value: PublicMutable<Field>,
a_private_value: PrivateSet<ValueNote>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ contract DocsExample {
use crate::options::create_account_card_getter_options;
use crate::types::{card_note::{CardNote, CARD_NOTE_LEN}, leader::Leader};

#[aztec(storage)]
struct Storage {
// Shows how to create a custom struct in PublicMutable
// docs:start:storage-leader-declaration
Expand Down Expand Up @@ -118,7 +119,7 @@ contract DocsExample {
context.this_address(),
FunctionSelector::from_signature("get_shared_immutable_constrained_private()")
);
Leader::deserialize([ret[0], ret[1]])
Leader::deserialize([ret[0], ret[1] + 1])
}

#[aztec(public)]
Expand All @@ -131,7 +132,7 @@ contract DocsExample {
context.this_address(),
FunctionSelector::from_signature("get_shared_immutable_constrained_public()")
);
Leader::deserialize([ret[0], ret[1]])
Leader::deserialize([ret[0], ret[1] + 1])
}

#[aztec(public)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ contract EasyPrivateToken {
use dep::value_note::{balance_utils, value_note::ValueNote};
use dep::easy_private_state::EasyPrivateUint;

#[aztec(storage)]
struct Storage {
balances: Map<AztecAddress, EasyPrivateUint>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contract EasyPrivateVoting {
use dep::aztec::context::Context;
// docs:end:imports
// docs:start:storage_struct
#[aztec(storage)]
struct Storage {
admin: PublicMutable<AztecAddress>, // admin can end vote
tally: Map<Field, PublicMutable<Field>>, // we will store candidate as key and number of votes as value
Expand Down
Loading