Commit 93a47fc
authored
refactor!: introducing
Closes
https://linear.app/aztec-labs/issue/F-19/rename-privateorpublicorutility-to-externalprivateorpublicorutility
Having `#[private]` and `#[public]` macros was misleading because in
Solidity these define function visibility while in Aztec's case they
define the environment in which the functions are executed. For this
reason I introduce `#[external(...)]` macro while the argument of the
attribute defines the execution environment: `private`, `public` or
`utility`.
## Notes for reviewer
- I did a refactor in a [PR up the
stack](#17840) which
allowed me to drop a lot of the complexity introduced in this PR. For
this reason I encourage you to check that one first to have context on
what in this PR is a problem and what is not. It might make sense to
just merge these 2 PRs into 1 but I think that would make it all harder
to review.
- This PR touches a lot of files but all the juicy bits are in the
`noir-projects/aztec-nr/aztec/src/macros/` directory so I encourage you
to just check that first. The `noir-contracts` dir can be completely
ignored as there I just update the imports and the macros.
- The new naming is now in conflict with the `#[internal]` macro as
having both external and internal applied to a function is valid:
<img width="874" height="182" alt="image"
src="https://github.com/user-attachments/assets/4582a51a-225c-4a4c-9b9a-d2c2d413d927"
/>
This issue will be tackled in the near future.#[external(...)] macro (#17827)File tree
106 files changed
+1040
-871
lines changed- boxes
- boxes
- react/src/contracts/src
- vanilla/contracts/src
- vite/src/contracts/src
- init/src
- docs
- docs/developers
- docs
- concepts
- smart_contracts
- functions
- guides/smart_contracts
- advanced
- reference/smart_contract_reference
- tutorials/contract_tutorials
- examples
- contracts
- bob_token_contract/src
- counter_contract/src
- tutorials/token_bridge_contract/contracts/aztec
- nft_bridge/src
- nft/src
- noir-projects
- aztec-nr
- aztec/src
- context
- macros
- functions
- state_vars
- test/helpers
- macro_compilation_failure_tests/failure_contracts
- marked_private_unconstrained/src
- marked_public_unconstrained/src
- noir-contracts-comp-failures/contracts
- invalid_external_function_type
- src
- public_function_selector_collision/src
- noir-contracts/contracts
- account
- ecdsa_k_account_contract/src
- ecdsa_r_account_contract/src
- schnorr_account_contract/src
- schnorr_hardcoded_account_contract/src
- schnorr_single_key_account_contract/src
- simulated_account_contract/src
- app
- amm_contract/src
- app_subscription_contract/src
- auth_contract/src
- card_game_contract/src
- claim_contract/src
- crowdfunding_contract/src
- escrow_contract/src
- lending_contract/src
- nft_contract/src
- orderbook_contract/src
- price_feed_contract/src
- private_token_contract/src
- private_voting_contract/src
- simple_token_contract/src
- token_blacklist_contract/src
- token_bridge_contract/src
- token_contract/src
- uniswap_contract/src
- docs/docs_example_contract/src
- fees
- fpc_contract/src
- sponsored_fpc_contract/src
- protocol
- auth_registry_contract/src
- contract_class_registry/src
- contract_instance_registry/src
- fee_juice_contract/src
- multi_call_entrypoint_contract/src
- router_contract/src
- test
- auth_wit_test_contract/src
- avm_gadgets_test_contract/src
- avm_initializer_test_contract/src
- avm_test_contract/src
- benchmarking_contract/src
- child_contract/src
- counter_contract/src
- event_only_contract/src
- import_test_contract/src
- invalid_account_contract/src
- no_constructor_contract/src
- note_getter_contract/src
- offchain_effect_contract/src
- oracle_version_check_contract/src
- parent_contract/src
- pending_note_hashes_contract/src
- public_immutable_contract/src
- returning_tuple_contract/src
- spam_contract/src
- state_vars_contract/src
- stateful_test_contract/src
- static_child_contract/src
- static_parent_contract/src
- test_contract/src
- test_log_contract/src
- updatable_contract/src
- updated_contract/src
- yarn-project
- pxe/src/contract_function_simulator/oracle
- txe/src
- oracle
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
106 files changed
+1040
-871
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | | - | |
| 85 | + | |
80 | 86 | | |
81 | | - | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | | - | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
121 | | - | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| |||
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
147 | | - | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments