Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(noir): use
#[aztec(private)]
and #[aztec(public)
attributes …
…(#1735) ## Overview Now that noir-lang/noir#2403 has been merged into noir and released under the `aztec` tag. This PR now builds! This cleans up the syntax for noir programs, making them less verbose and easier to get started with. For example what originally was: ```rust fn mint( inputs: PrivateContextInputs, amount: Field, owner: Field ) -> distinct pub abi::PrivateCircuitPublicInputs { let storage = Storage::init(); let mut context = PrivateContext::new(inputs, abi::hash_args([amount, owner])); // Insert new note to a set of user notes and emit the newly created encrypted note preimage via oracle call. let owner_balance = storage.balances.at(owner); send_note(&mut context, owner_balance, amount, owner); emit_unencrypted_log(&mut context, "Coins minted"); // Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel.. context.finish() } ``` can instead be written as: ```rust #[aztec(private)] fn mint( amount: Field, owner: Field ) { let storage = Storage::init(); // Insert new note to a set of user notes and emit the newly created encrypted note preimage via oracle call. let owner_balance = storage.balances.at(owner); send_note(&mut context, owner_balance, amount, owner); emit_unencrypted_log(&mut context, "Coins minted"); } ```
- Loading branch information