You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BEGIN_COMMIT_OVERRIDE
chore: backport - drop dead legacy oracle mappings (#22035)
fix: backport timestamp and anvil fixes (#22110)
fix(archiver): swallow error when rollup contract not yet finalized on
L1 (#22156)
END_COMMIT_OVERRIDE
Fee Payment Contracts (FPC) pay fees on your behalf, typically accepting a different token than Fee Juice. Since Fee Juice is non-transferable on L2, FPCs are the most common fee payment method.
119
+
Fee Payment Contracts (FPCs) pay Fee Juice on your behalf. FPCs must use Fee Juice exclusively on L2 during the setup phase; custom token contract functions cannot be called during setup on public networks. An FPC that accepts other tokens on L1 and bridges Fee Juice works on any network.
122
120
123
121
### Sponsored Fee Payment Contracts
124
122
125
123
#if(testnet)
126
-
:::warning
127
-
The Sponsored FPC is **not** deployed on testnet. To pay fees, you must either [bridge Fee Juice from L1](#bridge-fee-juice-from-l1) or deploy your own fee-paying contract.
124
+
:::note
125
+
The Sponsored FPC is not available on testnet or mainnet. It is only available on devnet and local network.
126
+
:::
127
+
#elif(mainnet)
128
+
:::note
129
+
The Sponsored FPC is not available on mainnet. It is only available on devnet and local network.
128
130
:::
129
-
130
-
The Sponsored FPC pays for fees unconditionally without requiring payment in return. It is available on the local network and devnet (deployed by Aztec Labs), but **not on testnet**.
131
-
#else
132
-
The Sponsored FPC pays for fees unconditionally without requiring payment in return. It is available on both the local network and devnet (deployed by Aztec Labs).
133
131
#endif
134
132
133
+
The Sponsored FPC pays fees unconditionally. It is only available on devnet and local network.
134
+
135
135
You can derive the Sponsored FPC address from its deployment parameters, register it with your wallet, and use it to pay for transactions:
// wallet is from the connection guide; fpcAddress is the FPC contract address
167
-
// senderAddress is the account paying; gasSettings is from the step above
168
-
const paymentMethod =newPublicFeePaymentMethod(
169
-
fpcAddress,
170
-
senderAddress,
171
-
wallet,
172
-
gasSettings,
173
-
);
174
-
```
175
-
176
143
## Bridge Fee Juice from L1
177
144
178
145
Fee Juice is non-transferable on L2, but you can bridge it from L1, claim it on L2, and use it. This involves a few components that are part of a running network's infrastructure:
Copy file name to clipboardExpand all lines: docs/docs-developers/docs/foundational-topics/fees.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,12 +83,9 @@ Fee Juice uses an enshrined `FeeJuicePortal` contract on Ethereum for bridging,
83
83
84
84
An account with Fee Juice can pay for its transactions directly. A new account can even pay for its own deployment transaction, provided Fee Juice was bridged to its address before deployment.
85
85
86
-
Alternatively, accounts can use [fee-paying contracts (FPCs)](../aztec-js/how_to_pay_fees.md#use-fee-payment-contracts) to pay for transactions. FPCs accept tokens and pay fees in Fee Juice on behalf of users. Common patterns include:
86
+
Alternatively, accounts can use [fee-paying contracts (FPCs)](../aztec-js/how_to_pay_fees.md#use-fee-payment-contracts) to pay for transactions. FPCs must use Fee Juice exclusively on L2 during the setup phase, but can accept other tokens on L1 and bridge Fee Juice.
87
87
88
-
-**Sponsored FPCs**: Pay fees unconditionally, enabling free transactions for users
89
-
-**Token-accepting FPCs**: Accept a specific token in exchange for paying fees
90
-
91
-
FPCs can contain arbitrary logic to authorize fee payments and can operate privately or publicly.
88
+
The **Sponsored FPC** pays fees unconditionally, enabling free transactions. It is only available on devnet and local network.
**Impact**: Any code passing `'ALL_SCOPES'` to `simulateTx`, `executeUtility`, `profileTx`, or `proveTx` will fail to compile. Replace with an explicit array of account addresses.
42
+
43
+
### [PXE] Capsule operations are now scope-enforced at the PXE level
44
+
45
+
The PXE now enforces that capsule operations can only access scopes that were authorized for the current execution. If a contract attempts to access a capsule scope that is not in its allowed scopes list, the PXE will throw an error:
46
+
47
+
```
48
+
Scope 0x1234... is not in the allowed scopes list: [0xabcd...].
49
+
```
50
+
51
+
The zero address (`AztecAddress::zero()`) is always allowed regardless of the scopes list, preserving backwards compatibility for contracts using the global scope.
52
+
53
+
**Impact**: Contracts that access capsules scoped to addresses not included in the transaction's authorized scopes will now fail at runtime. Ensure the correct scopes are passed when executing transactions.
54
+
55
+
## 4.2.0-aztecnr-rc.2
56
+
57
+
### Custom token FPCs removed from default public setup allowlist
58
+
59
+
Token contract functions (like `transfer_in_public` and `_increase_public_balance`) have been removed from the default public setup allowlist. FPCs that accept custom tokens (like the reference `FPC` contract) will not work on public networks, because their setup-phase calls to these functions will be rejected. Token class IDs change with each aztec-nr release, making it impractical to maintain them in the allowlist.
60
+
61
+
FPCs that use only Fee Juice still work on all networks, since FeeJuice is a protocol contract with a fixed address in the allowlist. Custom FPCs should only call protocol contract functions (AuthRegistry, FeeJuice) during setup.
62
+
63
+
`PublicFeePaymentMethod` and `PrivateFeePaymentMethod` in aztec.js are affected, since they use the reference `FPC` contract which calls Token functions during setup. Switch to `FeeJuicePaymentMethodWithClaim` (after [bridging Fee Juice from L1](../aztec-js/how_to_pay_fees.md#bridge-fee-juice-from-l1)) or write an FPC that uses Fee Juice natively.
64
+
65
+
**Migration:**
66
+
67
+
```diff
68
+
- import { PublicFeePaymentMethod } from '@aztec/aztec.js/fee';
69
+
- const paymentMethod = new PublicFeePaymentMethod(fpcAddress, senderAddress, wallet, gasSettings);
70
+
+ import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
71
+
+ const paymentMethod = new FeeJuicePaymentMethodWithClaim(senderAddress, claim);
72
+
```
73
+
74
+
Similarly, the `fpc-public` and `fpc-private` CLI wallet payment methods use the reference Token-based FPC and will not work on public networks. Use `fee_juice` for direct Fee Juice payment, or `fpc-sponsored` on devnet and local network.
75
+
76
+
12
77
### [Aztec.nr] Domain-separated tags on log emission
13
78
14
79
All logs emitted through the Aztec.nr framework now include a domain-separated tag at `fields[0]`. Each log category uses its own domain separator via `compute_log_tag(raw_tag, dom_sep)`:
@@ -118,6 +183,8 @@ The `DeployTxReceipt` and `DeployWaitOptions` types have been removed.
118
183
+ from: address,
119
184
+ });
120
185
```
186
+
187
+
121
188
### [aztec.js]`isContractInitialized` is now `initializationStatus` tri-state enum
122
189
123
190
`ContractMetadata.isContractInitialized` has been renamed to `ContractMetadata.initializationStatus` and changed from `boolean | undefined` to a `ContractInitializationStatus` enum with values `INITIALIZED`, `UNINITIALIZED`, and `UNKNOWN`.
The `aztec init` command created a workspace with two crates: a `bob_token_contract` crate for your smart contract code and a `bob_token_test` crate for Noir tests. In `bob_token_contract/src/main.nr` we even have a proto-contract. Let's replace it with a simple starting point:
53
+
The `aztec init` command created a contract project with `Nargo.toml`and `src/main.nr`. Let's replace the boilerplate in `src/main.nr` with a simple starting point:
54
54
55
55
```rust
56
56
#include_codestart/docs/examples/contracts/bob_token_contract/src/main.nr raw
If you have $AZTEC, pay for your own transactions directly from your account.
63
63
64
64
### Sponsored Transactions
65
-
Some applications pay fees on behalf of their users, enabling "free" transactions. The application covers the cost, not you.
66
-
67
-
### Fee-Paying Contracts
68
-
Specialized contracts can accept other tokens and pay fees in $AZTEC for you. This is useful if you only hold other tokens.
65
+
Fee-paying contracts can pay fees on your behalf. For example, on devnet and local network, a sponsored fee-paying contract covers transaction costs for free. FPCs can also accept other tokens on L1 and bridge $AZTEC to pay fees.
0 commit comments