Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: contract_abi-exports #5386

Merged
merged 49 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e1190bc
changed storage macro to look for attribute
Thunkar Mar 19, 2024
c41eba8
added abi exports to contract artifact
Thunkar Mar 22, 2024
6caea1e
changed storage macro to look for attribute
Thunkar Mar 19, 2024
01506c9
added abi exports to contract artifact
Thunkar Mar 22, 2024
3873a65
reverted change
Thunkar Mar 22, 2024
ce6b163
removed unused variable
Thunkar Mar 22, 2024
733f0ec
clippy pass
Thunkar Mar 22, 2024
9b6af4b
fixes and consistency
Thunkar Mar 22, 2024
ad2a62f
cleanup and test
Thunkar Mar 26, 2024
445b9e6
updated snapshots, types
Thunkar Mar 26, 2024
2124cfa
changed integer serialization
Thunkar Mar 26, 2024
3a388be
added abi exports to contract artifact
Thunkar Mar 22, 2024
85596ec
added abi exports to contract artifact
Thunkar Mar 22, 2024
46df9a5
reverted change
Thunkar Mar 22, 2024
0132139
clippy pass
Thunkar Mar 22, 2024
614942a
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Mar 26, 2024
e4cf336
Merge branch 'master' into gj/contract_abi_exports
Thunkar Mar 27, 2024
be95f17
Merge branch 'master' into gj/contract_abi_exports
Thunkar Mar 27, 2024
92e4397
Merge branch 'master' into gj/contract_abi_exports
Thunkar Mar 27, 2024
ba59549
Merge branch 'master' into gj/contract_abi_exports
Thunkar Mar 27, 2024
328108f
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Apr 1, 2024
a75c843
updated snapshots
Thunkar Apr 1, 2024
f16ec80
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Apr 2, 2024
e0f2ca2
Update noir/noir-repo/aztec_macros/src/lib.rs
Thunkar Apr 2, 2024
4b8464d
PR changes
Thunkar Apr 2, 2024
0c175fd
more pr improvements
Thunkar Apr 2, 2024
c2febc9
reverted abi tag error
Thunkar Apr 2, 2024
95e5025
clippy pass
Thunkar Apr 2, 2024
93b6cb1
Merge branch 'master' into gj/contract_abi_exports
Thunkar Apr 2, 2024
ef571c9
pr comment
Thunkar Apr 2, 2024
3b7d7b5
added tuple values
Thunkar Apr 2, 2024
ce404c9
removed unused import
Thunkar Apr 2, 2024
b673d1c
fixed integer conversion
Thunkar Apr 2, 2024
45914ba
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Apr 3, 2024
a586479
restrict abi tag again
Thunkar Apr 3, 2024
a8536aa
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Apr 3, 2024
2ed4aaf
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Apr 4, 2024
7a2d041
removed repeated block
Thunkar Apr 4, 2024
52c6db0
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar Apr 4, 2024
5f1eb2a
Update noir/noir-repo/compiler/noirc_frontend/src/hir/resolution/erro…
Thunkar Apr 4, 2024
668551e
Update noir/noir-repo/compiler/wasm/src/types/noir_artifact.ts
Thunkar Apr 4, 2024
ae10c89
changes from review
Thunkar Apr 4, 2024
8e029d4
Merge branch 'gj/contract_abi_exports' of github.com:AztecProtocol/az…
Thunkar Apr 4, 2024
7a150af
Merge branch 'master' into gj/contract_abi_exports
Thunkar Apr 4, 2024
5e0c18a
Merge branch 'master' into gj/contract_abi_exports
Thunkar Apr 4, 2024
0ee891c
added tag to new contract
Thunkar Apr 4, 2024
85ba294
Merge branch 'gj/contract_abi_exports' of github.com:AztecProtocol/az…
Thunkar Apr 4, 2024
1b38dae
Merge branch 'master' into gj/contract_abi_exports
Thunkar Apr 4, 2024
551eabf
Merge branch 'master' into gj/contract_abi_exports
Thunkar Apr 4, 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;
0x0ccb2a7150ed29533f211e223f98450cf4769ff8938e9d4ad303f71c5e302600;
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 @@ -17,7 +17,7 @@
]
},
"block": {
"archive": "0x29598370fa40a50b7fbb99e501f11527a69e104a43c8eefbfe66888f137e7e49",
"archive": "0x1d5549c8a791857afe34614c3d6373e9624bc1af3ca8cf594bd3b1f42ddd741d",
"body": "0x0000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"txsEffectsHash": "0x008194e3dd375d5d878dcf9546bb5c2c77e165c6b1bef9aead8ceb35c3762bd5",
"decodedHeader": {
Expand All @@ -32,8 +32,8 @@
"chainId": 31337,
"timestamp": 0,
"version": 1,
"coinbase": "0x5e65711eaf5606f1f42dd36579261833e54595ee",
"feeRecipient": "0x00eafbad09eab548a89726e2a735bdcadc37aa4c318ed7a12d9be6a7542e517e"
"coinbase": "0x80b3a28fb1dd82c2277913da82f5b6ad77da2f70",
"feeRecipient": "0x14e44a54000bdbd9f376c189b4360fa43e8cb93204ef929ee7397941905f7187"
},
"lastArchive": {
"nextAvailableLeafIndex": 1,
Expand All @@ -60,7 +60,7 @@
}
}
},
"header": "0x1e3523d3bd50ae6204e1ec2ee1bdf8af4c6217ec80900052d2cf4259379dd130000000010000000000000000000000000000000000000000000000000000000000000002008194e3dd375d5d878dcf9546bb5c2c77e165c6b1bef9aead8ceb35c3762bd500089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00efcbdb79553ae6863646bf36441755bc344a9a4af335fadc6659594faa43161864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000001016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000001000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000c00000000000000000000000000000000000000000000000000000000000007a690000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000005e65711eaf5606f1f42dd36579261833e54595ee00eafbad09eab548a89726e2a735bdcadc37aa4c318ed7a12d9be6a7542e517e",
"publicInputsHash": "0x009e67eb54715bba61c94f475f6d4bf81b775da316c2c9a6a12506851f760bf0"
"header": "0x1e3523d3bd50ae6204e1ec2ee1bdf8af4c6217ec80900052d2cf4259379dd130000000010000000000000000000000000000000000000000000000000000000000000002008194e3dd375d5d878dcf9546bb5c2c77e165c6b1bef9aead8ceb35c3762bd500089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00efcbdb79553ae6863646bf36441755bc344a9a4af335fadc6659594faa43161864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000001016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000001000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000c00000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000080b3a28fb1dd82c2277913da82f5b6ad77da2f7014e44a54000bdbd9f376c189b4360fa43e8cb93204ef929ee7397941905f7187",
"publicInputsHash": "0x002b3718c30855a31bde39a183e0e2fe51bf6de9784b88e35c31497d07dcd6a6"
}
}
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 @@ -17,7 +17,7 @@
]
},
"block": {
"archive": "0x045487d0ec498eb3f7f027715db8d67cc060604058bc5dd3e2e39fb47fe0ea17",
"archive": "0x1205c7cf2bb5c9844379718633439676fb40a25c1a6bc89a36af575447ac8d59",
"body": "0x0000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"txsEffectsHash": "0x008194e3dd375d5d878dcf9546bb5c2c77e165c6b1bef9aead8ceb35c3762bd5",
"decodedHeader": {
Expand All @@ -30,14 +30,14 @@
"globalVariables": {
"blockNumber": 2,
"chainId": 31337,
"timestamp": 1711036059,
"timestamp": 1711947351,
"version": 1,
"coinbase": "0x5e65711eaf5606f1f42dd36579261833e54595ee",
"feeRecipient": "0x00eafbad09eab548a89726e2a735bdcadc37aa4c318ed7a12d9be6a7542e517e"
"coinbase": "0x80b3a28fb1dd82c2277913da82f5b6ad77da2f70",
"feeRecipient": "0x14e44a54000bdbd9f376c189b4360fa43e8cb93204ef929ee7397941905f7187"
},
"lastArchive": {
"nextAvailableLeafIndex": 2,
"root": "0x29598370fa40a50b7fbb99e501f11527a69e104a43c8eefbfe66888f137e7e49"
"root": "0x1d5549c8a791857afe34614c3d6373e9624bc1af3ca8cf594bd3b1f42ddd741d"
},
"stateReference": {
"l1ToL2MessageTree": {
Expand All @@ -60,7 +60,7 @@
}
}
},
"header": "0x29598370fa40a50b7fbb99e501f11527a69e104a43c8eefbfe66888f137e7e49000000020000000000000000000000000000000000000000000000000000000000000002008194e3dd375d5d878dcf9546bb5c2c77e165c6b1bef9aead8ceb35c3762bd500089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00efcbdb79553ae6863646bf36441755bc344a9a4af335fadc6659594faa43161864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000002016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000002000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000002800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000001400000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000065fc569b5e65711eaf5606f1f42dd36579261833e54595ee00eafbad09eab548a89726e2a735bdcadc37aa4c318ed7a12d9be6a7542e517e",
"publicInputsHash": "0x00e9cfdd839060c90c216e1cecd24c5570a84e380e2bc640fd9dbbb5b2dd0718"
"header": "0x1d5549c8a791857afe34614c3d6373e9624bc1af3ca8cf594bd3b1f42ddd741d000000020000000000000000000000000000000000000000000000000000000000000002008194e3dd375d5d878dcf9546bb5c2c77e165c6b1bef9aead8ceb35c3762bd500089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00efcbdb79553ae6863646bf36441755bc344a9a4af335fadc6659594faa43161864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000002016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000002000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000002800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000001400000000000000000000000000000000000000000000000000000000000007a690000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000660a3e5780b3a28fb1dd82c2277913da82f5b6ad77da2f7014e44a54000bdbd9f376c189b4360fa43e8cb93204ef929ee7397941905f7187",
"publicInputsHash": "0x00c84265f5f882a389cbff59702265345727fecbdf116619286e372c79457de6"
}
}
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.

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ contract EcdsaAccount {

use crate::ecdsa_public_key_note::EcdsaPublicKeyNote;

#[aztec(storage)]
struct Storage {
public_key: PrivateImmutable<EcdsaPublicKeyNote>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contract Escrow {

use dep::address_note::address_note::AddressNote;

#[aztec(storage)]
struct Storage {
owner: PrivateImmutable<AddressNote>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contract FPC {

use crate::interfaces::Token;

#[aztec(storage)]
struct Storage {
other_asset: SharedImmutable<AztecAddress>,
gas_token_address: SharedImmutable<AztecAddress>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contract GasToken {

use crate::lib::{calculate_fee, get_bridge_gas_msg_hash};

#[aztec(storage)]
struct Storage {
balances: Map<AztecAddress, PublicMutable<U128>>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ contract InclusionProofs {
// docs:start:value_note_imports
use dep::value_note::value_note::ValueNote;
// docs:end:value_note_imports
#[aztec(storage)]
struct Storage {
private_values: Map<AztecAddress, PrivateSet<ValueNote>>,
public_value: PublicMutable<Field>,
Expand Down
Loading
Loading