From 65306c5d3edca71b011e1f87e417bc65703f4d94 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 28 Feb 2024 10:25:33 -0300 Subject: [PATCH] feat: Check initializer by default in private functions --- .../contracts/app_subscription_contract/src/main.nr | 1 + .../noir-contracts/contracts/avm_test_contract/src/main.nr | 1 + .../contracts/benchmarking_contract/src/main.nr | 1 + .../contracts/card_game_contract/src/main.nr | 1 + .../noir-contracts/contracts/child_contract/src/main.nr | 1 + .../contract_class_registerer_contract/src/main.nr | 1 + .../contract_instance_deployer_contract/src/main.nr | 1 + .../noir-contracts/contracts/counter_contract/src/main.nr | 1 + .../contracts/delegated_on_contract/src/main.nr | 1 + .../contracts/delegator_contract/src/main.nr | 1 + .../contracts/docs_example_contract/src/main.nr | 1 + .../contracts/easy_private_token_contract/src/main.nr | 1 + .../contracts/easy_private_voting_contract/src/main.nr | 3 ++- .../contracts/ecdsa_account_contract/src/main.nr | 1 + .../noir-contracts/contracts/escrow_contract/src/main.nr | 1 + .../noir-contracts/contracts/fpc_contract/src/main.nr | 1 + .../contracts/gas_token_contract/src/main.nr | 1 + .../contracts/import_test_contract/src/main.nr | 1 + .../contracts/inclusion_proofs_contract/src/main.nr | 1 + .../noir-contracts/contracts/lending_contract/src/main.nr | 1 + .../noir-contracts/contracts/parent_contract/src/main.nr | 1 + .../contracts/pending_commitments_contract/src/main.nr | 1 + .../contracts/price_feed_contract/src/main.nr | 1 + .../noir-contracts/contracts/reader_contract/src/main.nr | 1 + .../contracts/schnorr_account_contract/src/main.nr | 1 + .../schnorr_hardcoded_account_contract/src/main.nr | 1 + .../schnorr_single_key_account_contract/src/main.nr | 1 + .../contracts/slow_tree_contract/src/main.nr | 1 + .../contracts/stateful_test_contract/src/main.nr | 2 +- .../noir-contracts/contracts/test_contract/src/main.nr | 2 ++ .../contracts/token_blacklist_contract/src/main.nr | 1 + .../contracts/token_bridge_contract/src/main.nr | 1 + .../noir-contracts/contracts/token_contract/src/main.nr | 1 + .../noir-contracts/contracts/uniswap_contract/src/main.nr | 1 + noir/aztec_macros/src/lib.rs | 7 ++++--- 35 files changed, 40 insertions(+), 5 deletions(-) diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr index feee4ecfeccc..71dbdaf08f06 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr @@ -35,6 +35,7 @@ contract AppSubscriptionContract { // Constructs the contract #[aztec(private)] + #[aztec(initializer)] fn constructor( target_address: AztecAddress, subscription_recipient_address: AztecAddress, diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index 3e466334e0cf..21875088c493 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -6,6 +6,7 @@ contract AvmTest { use dep::aztec::avm::hash::{keccak256, poseidon, sha256}; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Public-vm macro will prefix avm to the function name for transpilation diff --git a/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr b/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr index 4044cdd69209..fdb889761110 100644 --- a/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr @@ -20,6 +20,7 @@ contract Benchmarking { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Creates a new value note for the target owner. Use this method to seed an initial set of notes. diff --git a/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr b/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr index 930215d7802e..86906f987647 100644 --- a/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr @@ -20,6 +20,7 @@ contract CardGame { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(private)] diff --git a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr index 315c4c7ec34e..98711eaa6c5d 100644 --- a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr @@ -16,6 +16,7 @@ contract Child { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Returns a sum of the input and the chain id and version of the contract in private circuit public input's return_values. diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr index 760b4e5ff647..b5aebdecf8c4 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr @@ -23,6 +23,7 @@ contract ContractClassRegisterer { use crate::capsule::pop_capsule; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(private)] diff --git a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr index aceccc3ab11d..2ecaccd7b251 100644 --- a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr @@ -13,6 +13,7 @@ contract ContractInstanceDeployer { use crate::events::{instance_deployed::ContractInstanceDeployed}; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(private)] diff --git a/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr b/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr index a7ad7b4888e1..7782c5c3bf81 100644 --- a/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr @@ -17,6 +17,7 @@ contract Counter { // docs:start:constructor #[aztec(private)] + #[aztec(initializer)] fn constructor(headstart: u64, owner: AztecAddress) { let counters = storage.counters; counters.at(owner).add(headstart, owner); diff --git a/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr b/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr index 928760f048f3..2055db147eb0 100644 --- a/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr @@ -19,6 +19,7 @@ contract DelegatedOn { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(private)] diff --git a/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr b/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr index d93629e4fea9..9c1afd67e882 100644 --- a/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr @@ -15,6 +15,7 @@ contract Delegator { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(private)] diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr index d78408256a13..e419f5357791 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr @@ -89,6 +89,7 @@ contract DocsExample { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(public)] diff --git a/noir-projects/noir-contracts/contracts/easy_private_token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/easy_private_token_contract/src/main.nr index 513026f3360f..0acb8c4e028d 100644 --- a/noir-projects/noir-contracts/contracts/easy_private_token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/easy_private_token_contract/src/main.nr @@ -13,6 +13,7 @@ contract EasyPrivateToken { * initialize the contract's initial state variables. */ #[aztec(private)] + #[aztec(initializer)] fn constructor(initial_supply: u64, owner: AztecAddress) { let balances = storage.balances; diff --git a/noir-projects/noir-contracts/contracts/easy_private_voting_contract/src/main.nr b/noir-projects/noir-contracts/contracts/easy_private_voting_contract/src/main.nr index a6a388e64594..5a25136195d6 100644 --- a/noir-projects/noir-contracts/contracts/easy_private_voting_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/easy_private_voting_contract/src/main.nr @@ -14,7 +14,8 @@ contract EasyPrivateVoting { // docs:end:storage_struct // docs:start:constructor - #[aztec(private)] // annotation to mark function as private and expose private context + #[aztec(private)] + #[aztec(initializer)] // annotation to mark function as private and expose private context fn constructor(admin: AztecAddress) { // called when contract is deployed context.call_public_function( // we cannot update public state directly from private function but we can call public function (which queues it) diff --git a/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr index f9dac6425b8e..6d6050735459 100644 --- a/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr @@ -26,6 +26,7 @@ contract EcdsaAccount { // Creates a new account out of an ECDSA public key to use for signature verification #[aztec(private)] + #[aztec(initializer)] fn constructor(signing_pub_key_x: pub [u8; 32], signing_pub_key_y: pub [u8; 32]) { let this = context.this_address(); let mut pub_key_note = EcdsaPublicKeyNote::new(signing_pub_key_x, signing_pub_key_y, this); diff --git a/noir-projects/noir-contracts/contracts/escrow_contract/src/main.nr b/noir-projects/noir-contracts/contracts/escrow_contract/src/main.nr index f1fde13f770e..db9c51eab857 100644 --- a/noir-projects/noir-contracts/contracts/escrow_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/escrow_contract/src/main.nr @@ -19,6 +19,7 @@ contract Escrow { // Creates a new instance // docs:start:constructor #[aztec(private)] + #[aztec(initializer)] fn constructor(owner: pub AztecAddress) { let this = context.this_address(); diff --git a/noir-projects/noir-contracts/contracts/fpc_contract/src/main.nr b/noir-projects/noir-contracts/contracts/fpc_contract/src/main.nr index 70333ebcd7e4..518284defdef 100644 --- a/noir-projects/noir-contracts/contracts/fpc_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/fpc_contract/src/main.nr @@ -12,6 +12,7 @@ contract FPC { } #[aztec(private)] + #[aztec(initializer)] fn constructor(other_asset: AztecAddress, fee_asset: AztecAddress) { let selector = FunctionSelector::from_signature("_initialize((Field),(Field))"); context.call_public_function( diff --git a/noir-projects/noir-contracts/contracts/gas_token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/gas_token_contract/src/main.nr index 663c2cfbde28..b04e7ea448d9 100644 --- a/noir-projects/noir-contracts/contracts/gas_token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/gas_token_contract/src/main.nr @@ -11,6 +11,7 @@ contract GasToken { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(public)] diff --git a/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr index c7ff4fa3a4af..180522176a1e 100644 --- a/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr @@ -11,6 +11,7 @@ contract ImportTest { }; #[aztec(private)] + #[aztec(initializer)] fn constructor( ) {} diff --git a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr index 1aa7f911ad9a..1814d616a8d0 100644 --- a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr @@ -37,6 +37,7 @@ contract InclusionProofs { } #[aztec(private)] + #[aztec(initializer)] fn constructor(public_value: Field) { let selector = FunctionSelector::from_signature("_initialize(Field)"); context.call_public_function(context.this_address(), selector, [public_value]); diff --git a/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr b/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr index bc039a499bec..7a6e6d1376c7 100644 --- a/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr @@ -36,6 +36,7 @@ contract Lending { // Constructs the contract. #[aztec(private)] + #[aztec(initializer)] fn constructor( ) {} diff --git a/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr b/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr index b89dcb83d39e..b4a97ad7971c 100644 --- a/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr @@ -3,6 +3,7 @@ contract Parent { use dep::aztec::protocol_types::{address::AztecAddress, abis::function_selector::FunctionSelector}; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Private function to call another private function in the targetContract using the provided selector diff --git a/noir-projects/noir-contracts/contracts/pending_commitments_contract/src/main.nr b/noir-projects/noir-contracts/contracts/pending_commitments_contract/src/main.nr index fae26b23fc97..79213f0dca87 100644 --- a/noir-projects/noir-contracts/contracts/pending_commitments_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/pending_commitments_contract/src/main.nr @@ -21,6 +21,7 @@ contract PendingCommitments { // (once Noir's support for this is more robust) #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Confirm can access pending note hashes by creating / inserting a note and then diff --git a/noir-projects/noir-contracts/contracts/price_feed_contract/src/main.nr b/noir-projects/noir-contracts/contracts/price_feed_contract/src/main.nr index afd14a724003..c9af402ffb41 100644 --- a/noir-projects/noir-contracts/contracts/price_feed_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/price_feed_contract/src/main.nr @@ -12,6 +12,7 @@ contract PriceFeed { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(public)] diff --git a/noir-projects/noir-contracts/contracts/reader_contract/src/main.nr b/noir-projects/noir-contracts/contracts/reader_contract/src/main.nr index cfe709c3ee83..b43e2f98316c 100644 --- a/noir-projects/noir-contracts/contracts/reader_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/reader_contract/src/main.nr @@ -4,6 +4,7 @@ contract Reader { use dep::compressed_string::FieldCompressedString; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} #[aztec(public)] diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr index 6e4eec425c99..52871f1044fc 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr @@ -29,6 +29,7 @@ contract SchnorrAccount { // Constructs the contract #[aztec(private)] + #[aztec(initializer)] fn constructor(signing_pub_key_x: pub Field, signing_pub_key_y: pub Field) { let this = context.this_address(); // docs:start:initialize diff --git a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr index 88f6b7cf5e73..4b2fadad1815 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr @@ -15,6 +15,7 @@ contract SchnorrHardcodedAccount { global ACCOUNT_ACTIONS_STORAGE_SLOT = 1; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Note: If you globally change the entrypoint signature don't forget to update default_entrypoint.ts diff --git a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr index b5633b70009d..3f5996207d07 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr @@ -12,6 +12,7 @@ contract SchnorrSingleKeyAccount { global ACCOUNT_ACTIONS_STORAGE_SLOT = 1; #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // Note: If you globally change the entrypoint signature don't forget to update default_entrypoint.ts diff --git a/noir-projects/noir-contracts/contracts/slow_tree_contract/src/main.nr b/noir-projects/noir-contracts/contracts/slow_tree_contract/src/main.nr index 5161f7b04db5..a0b12eedcc4f 100644 --- a/noir-projects/noir-contracts/contracts/slow_tree_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/slow_tree_contract/src/main.nr @@ -36,6 +36,7 @@ contract SlowTree { // docs:end:constants_and_storage #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // docs:start:initialize #[aztec(public)] diff --git a/noir-projects/noir-contracts/contracts/stateful_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/stateful_test_contract/src/main.nr index 3e68b692ca62..6c4db5a5ddc1 100644 --- a/noir-projects/noir-contracts/contracts/stateful_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/stateful_test_contract/src/main.nr @@ -25,7 +25,6 @@ contract StatefulTest { } #[aztec(private)] - #[aztec(initcheck)] fn create_note(owner: AztecAddress, value: Field) { if (value != 0) { let loc = storage.notes.at(owner); @@ -34,6 +33,7 @@ contract StatefulTest { } #[aztec(private)] + #[aztec(noinitcheck)] internal fn internal_create_note(owner: AztecAddress, value: Field) { if (value != 0) { let loc = storage.notes.at(owner); diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index 1c161de5935d..90deaaae2760 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -35,6 +35,7 @@ contract Test { } #[aztec(private)] + #[aztec(initializer)] // docs:start:empty-constructor fn constructor() {} // docs:end:empty-constructor @@ -226,6 +227,7 @@ contract Test { // Forcefully emits a nullifier (for testing purposes) #[aztec(private)] + #[aztec(noinitcheck)] fn emit_nullifier(nullifier: Field) { context.push_new_nullifier(nullifier, 0); } diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr index 7ee25b3797c4..6e2225c1c8e4 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr @@ -44,6 +44,7 @@ contract TokenBlacklist { // docs:start:constructor #[aztec(private)] + #[aztec(initializer)] fn constructor(admin: AztecAddress, slow_updates_contract: AztecAddress) { let mut slow_note = FieldNote::new(slow_updates_contract.to_field()); storage.slow_update.initialize(&mut slow_note, false); diff --git a/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr index 8a00972b733a..5f55bacc779e 100644 --- a/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr @@ -24,6 +24,7 @@ contract TokenBridge { // Constructs the contract. #[aztec(private)] + #[aztec(initializer)] fn constructor(token: AztecAddress) { let selector = FunctionSelector::from_signature("_initialize((Field))"); context.call_public_function(context.this_address(), selector, [token.to_field()]); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr index 7a20030245a3..b1a37a66a779 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -54,6 +54,7 @@ contract Token { // docs:start:constructor #[aztec(private)] + #[aztec(initializer)] fn constructor(admin: AztecAddress, name: str<31>, symbol: str<31>, decimals: u8) { let selector = FunctionSelector::from_signature("_initialize((Field),(Field),(Field),u8)"); let name_s = FieldCompressedString::from_string(name); diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr index f92dddff2f28..d721082ac7a7 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr @@ -23,6 +23,7 @@ contract Uniswap { } #[aztec(private)] + #[aztec(initializer)] fn constructor() {} // docs:end:uniswap_setup diff --git a/noir/aztec_macros/src/lib.rs b/noir/aztec_macros/src/lib.rs index 111ebc2adea3..038dc92dd68a 100644 --- a/noir/aztec_macros/src/lib.rs +++ b/noir/aztec_macros/src/lib.rs @@ -440,17 +440,18 @@ fn transform_module( let mut is_public = false; let mut is_public_vm = false; let mut is_initializer = false; - let mut skip_init_check = true; // Default to true once we're confident that the approach works + let mut skip_init_check = false; for secondary_attribute in func.def.attributes.secondary.clone() { if is_custom_attribute(&secondary_attribute, "aztec(private)") { is_private = true; } else if is_custom_attribute(&secondary_attribute, "aztec(initializer)") { is_initializer = true; - } else if is_custom_attribute(&secondary_attribute, "aztec(initcheck)") { - skip_init_check = false; + } else if is_custom_attribute(&secondary_attribute, "aztec(noinitcheck)") { + skip_init_check = true; } else if is_custom_attribute(&secondary_attribute, "aztec(public)") { is_public = true; + skip_init_check = true; } else if is_custom_attribute(&secondary_attribute, "aztec(public-vm)") { is_public_vm = true; }