Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/docs/aztec/concepts/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4
tags: [fees]
---

import { Why_Fees } from '/components/snippets';
import { Why_Fees } from '@site/src/components/Snippets/snippets';

<Why_Fees />

Expand Down Expand Up @@ -46,7 +46,7 @@ More information about the design/choices can be found in the fees section of th

As part of a transaction the follow gas settings are available to be defined by the user.

import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '/components/snippets';
import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '@site/src/components/Snippets/snippets';

<Gas_Settings />

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/developers/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You'll know the sandbox is ready to go when you see something like this:

## Using the sandbox test accounts

import { CLI_Add_Test_Accounts } from '/components/snippets';
import { CLI_Add_Test_Accounts } from '@site/src/components/Snippets/snippets';

<CLI_Add_Test_Accounts />

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/developers/guides/js_apps/pay_fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import { FeeJuicePaymentMethod } from "@aztec/aztec.js";

**The equivalent to specify fees via CLI...**

import { CLI_Fees } from '/components/snippets';
import { CLI_Fees } from '@site/src/components/Snippets/snippets';

<CLI_Fees />

Expand Down Expand Up @@ -201,7 +201,7 @@ The `paymentMethod` is an object for the type of payment. Each of the implementa

#include_code gas_settings_vars yarn-project/stdlib/src/gas/gas_settings.ts javascript

import { Gas_Settings_Components, Gas_Settings } from '/components/snippets';
import { Gas_Settings_Components, Gas_Settings } from '@site/src/components/Snippets/snippets';

<Gas_Settings />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can create arbitrary aliases with the `alias` command. For example `aztec-wa

## Paying Fees

import { Why_Fees, CLI_Fees } from '/components/snippets';
import { Why_Fees, CLI_Fees } from '@site/src/components/Snippets/snippets';

<Why_Fees />

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4
tags: [fees]
---

import { Why_Fees } from '/components/snippets';
import { Why_Fees } from '@site/src/components/Snippets/snippets';

<Why_Fees />

Expand Down Expand Up @@ -46,13 +46,13 @@ More information about the design/choices can be found in the fees section of th

As part of a transaction the follow gas settings are available to be defined by the user.

import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '/components/snippets';
import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '@site/src/components/Snippets/snippets';

<Gas_Settings />

These are:

```javascript title="gas_settings_vars" showLineNumbers
```javascript title="gas_settings_vars" showLineNumbers
/** Gas usage and fees limits set by the transaction sender for different dimensions and phases. */
export class GasSettings {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You'll know the sandbox is ready to go when you see something like this:

## Using the sandbox test accounts

import { CLI_Add_Test_Accounts } from '/components/snippets';
import { CLI_Add_Test_Accounts } from '@site/src/components/Snippets/snippets';

<CLI_Add_Test_Accounts />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ One way of bridging of tokens is described fully [here](../../../developers/tuto

First get the node info and create a public client pointing to the sandbox's anvil L1 node (from foundry):

```javascript title="get_node_info_pub_client" showLineNumbers
```javascript title="get_node_info_pub_client" showLineNumbers
const info = await pxe.getNodeInfo();
const publicClient = getPublicClient({
l1RpcUrls: ['http://localhost:8545'],
Expand All @@ -62,7 +62,7 @@ import { L1FeeJuicePortalManager } from "@aztec/aztec.js";

Create a new fee juice portal manager and bridge fee juice publicly to Aztec:

```javascript title="bridge_fee_juice" showLineNumbers
```javascript title="bridge_fee_juice" showLineNumbers
const portal = await L1FeeJuicePortalManager.new(pxe, publicClient, walletClient, log);
const claim = await portal.bridgeTokensPublic(recipient, amount, true /* mint */);
```
Expand Down Expand Up @@ -95,7 +95,7 @@ Note: this example is a public token transfer call, but can equally be a private
import { FeeJuicePaymentMethod } from "@aztec/aztec.js";
```

```javascript title="pay_fee_juice_send" showLineNumbers
```javascript title="pay_fee_juice_send" showLineNumbers
const paymentMethod = new FeeJuicePaymentMethod(aliceAddress);
const { transactionFee } = await bananaCoin.methods
.transfer_in_public(aliceAddress, bobAddress, 1n, 0n)
Expand All @@ -107,7 +107,7 @@ const { transactionFee } = await bananaCoin.methods

**The equivalent to specify fees via CLI...**

import { CLI_Fees } from '/components/snippets';
import { CLI_Fees } from '@site/src/components/Snippets/snippets';

<CLI_Fees />

Expand All @@ -119,7 +119,7 @@ Here we will use the `claim` object previously from the bridging section, and th
import { FeeJuicePaymentMethodWithClaim } from "@aztec/aztec.js";
```

```javascript title="claim_and_deploy" showLineNumbers
```javascript title="claim_and_deploy" showLineNumbers
const wallet = await account.getWallet();
const paymentMethod = new FeeJuicePaymentMethodWithClaim(wallet, claim);
const sentTx = account.deploy({ fee: { paymentMethod } });
Expand All @@ -138,7 +138,7 @@ Claiming bridged fee juice and using it to pay for transaction fees results in f

Calling a function, in this case checking the balance of the fee juice contract:

```javascript title="claim_and_pay" showLineNumbers
```javascript title="claim_and_pay" showLineNumbers
const paymentMethod = new FeeJuicePaymentMethodWithClaim(bobWallet, claim);
const receipt = await feeJuiceContract
.withWallet(bobWallet)
Expand Down Expand Up @@ -176,7 +176,7 @@ await pxe.registerContract(fpcContract);

The fee payment method is created and used as follows, with similar syntax for private or public fee payments:

```javascript title="fpc" showLineNumbers
```javascript title="fpc" showLineNumbers
const tx = await bananaCoin.methods
.transfer_in_public(aliceAddress, bobAddress, bananasToSendToBob, 0)
.send({
Expand Down Expand Up @@ -238,7 +238,7 @@ You can find the corresponding CLI command info [here](../../reference/environme

Functions pertaining to sending a transaction, such as `deploy` and `send`, each include a `fee` variable defined with the following (optional) parameters:

```javascript title="user_fee_options" showLineNumbers
```javascript title="user_fee_options" showLineNumbers
/** Fee options as set by a user. */
export type UserFeeOptions = {
/** The fee payment method to use */
Expand All @@ -260,7 +260,7 @@ export type UserFeeOptions = {

The `paymentMethod` is an object for the type of payment. Each of the implementations can be found [here](https://github.com/AztecProtocol/aztec-packages/blob/v0.85.0-alpha-testnet.0/yarn-project/aztec.js/src/fee). For example:

```javascript title="fee_juice_method" showLineNumbers
```javascript title="fee_juice_method" showLineNumbers
/**
* Pay fee directly in the Fee Juice.
*/
Expand All @@ -271,7 +271,7 @@ export class FeeJuicePaymentMethod implements FeePaymentMethod {

### Gas Settings

```javascript title="gas_settings_vars" showLineNumbers
```javascript title="gas_settings_vars" showLineNumbers
/** Gas usage and fees limits set by the transaction sender for different dimensions and phases. */
export class GasSettings {
constructor(
Expand All @@ -284,7 +284,7 @@ export class GasSettings {
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.85.0-alpha-testnet.0/yarn-project/stdlib/src/gas/gas_settings.ts#L11-L20" target="_blank" rel="noopener noreferrer">Source code: yarn-project/stdlib/src/gas/gas_settings.ts#L11-L20</a></sub></sup>


import { Gas_Settings_Components, Gas_Settings } from '/components/snippets';
import { Gas_Settings_Components, Gas_Settings } from '@site/src/components/Snippets/snippets';

<Gas_Settings />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can create arbitrary aliases with the `alias` command. For example `aztec-wa

## Paying Fees

import { Why_Fees, CLI_Fees } from '/components/snippets';
import { Why_Fees, CLI_Fees } from '@site/src/components/Snippets/snippets';

<Why_Fees />

Expand Down Expand Up @@ -91,15 +91,15 @@ In the sandbox pre-loaded test accounts can be used to cover fee juice when depl

First import them:

```bash title="import-test-accounts" showLineNumbers
```bash title="import-test-accounts" showLineNumbers
aztec-wallet import-test-accounts
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.85.0-alpha-testnet.0/yarn-project/cli-wallet/test/flows/basic.sh#L9-L11" target="_blank" rel="noopener noreferrer">Source code: yarn-project/cli-wallet/test/flows/basic.sh#L9-L11</a></sub></sup>


Then use the alias (test0, test1...) when paying in fee juice. Eg to create accounts:

```bash title="declare-accounts" showLineNumbers
```bash title="declare-accounts" showLineNumbers
aztec-wallet create-account -a alice --payment method=fee_juice,feePayer=test0
aztec-wallet create-account -a bob --payment method=fee_juice,feePayer=test0
```
Expand All @@ -112,7 +112,7 @@ aztec-wallet create-account -a bob --payment method=fee_juice,feePayer=test0

First register an account, mint the fee asset on L1 and bridge it to fee juice:

```bash title="bridge-fee-juice" showLineNumbers
```bash title="bridge-fee-juice" showLineNumbers
aztec-wallet create-account -a main --register-only
aztec-wallet bridge-fee-juice 1000000000000000000 main --mint --no-wait
```
Expand All @@ -122,7 +122,7 @@ aztec-wallet bridge-fee-juice 1000000000000000000 main --mint --no-wait
You'll have to wait for two blocks to pass for bridged fee juice to be ready on Aztec.
For the sandbox you do this by putting through two arbitrary transactions. Eg:

```bash title="force-two-blocks" showLineNumbers
```bash title="force-two-blocks" showLineNumbers
aztec-wallet deploy counter_contract@Counter --init initialize --args 0 accounts:test0 -f test0 -a counter
aztec-wallet send increment -ca counter --args accounts:test0 accounts:test0 -f test0
```
Expand All @@ -131,7 +131,7 @@ aztec-wallet send increment -ca counter --args accounts:test0 accounts:test0 -f

Now the funded account can deploy itself with the bridged fees, claiming the bridged fee juice and deploying the contract in one transaction:

```bash title="claim-deploy-account" showLineNumbers
```bash title="claim-deploy-account" showLineNumbers
aztec-wallet deploy-account -f main --payment method=fee_juice,claim
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.85.0-alpha-testnet.0/yarn-project/cli-wallet/test/flows/create_account_pay_native.sh#L25-L27" target="_blank" rel="noopener noreferrer">Source code: yarn-project/cli-wallet/test/flows/create_account_pay_native.sh#L25-L27</a></sub></sup>
Expand Down
6 changes: 3 additions & 3 deletions docs/versioned_docs/version-v0.85.0/aztec/concepts/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4
tags: [fees]
---

import { Why_Fees } from '/components/snippets';
import { Why_Fees } from '@site/src/components/Snippets/snippets';

<Why_Fees />

Expand Down Expand Up @@ -46,13 +46,13 @@ More information about the design/choices can be found in the fees section of th

As part of a transaction the follow gas settings are available to be defined by the user.

import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '/components/snippets';
import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '@site/src/components/Snippets/snippets';

<Gas_Settings />

These are:

```javascript title="gas_settings_vars" showLineNumbers
```javascript title="gas_settings_vars" showLineNumbers
/** Gas usage and fees limits set by the transaction sender for different dimensions and phases. */
export class GasSettings {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You'll know the sandbox is ready to go when you see something like this:

## Using the sandbox test accounts

import { CLI_Add_Test_Accounts } from '/components/snippets';
import { CLI_Add_Test_Accounts } from '@site/src/components/Snippets/snippets';

<CLI_Add_Test_Accounts />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ One way of bridging of tokens is described fully [here](../../../developers/tuto

First get the node info and create a public client pointing to the sandbox's anvil L1 node (from foundry):

```javascript title="get_node_info_pub_client" showLineNumbers
```javascript title="get_node_info_pub_client" showLineNumbers
const info = await pxe.getNodeInfo();
const publicClient = getPublicClient({
l1RpcUrls: ['http://localhost:8545'],
Expand All @@ -62,7 +62,7 @@ import { L1FeeJuicePortalManager } from "@aztec/aztec.js";

Create a new fee juice portal manager and bridge fee juice publicly to Aztec:

```javascript title="bridge_fee_juice" showLineNumbers
```javascript title="bridge_fee_juice" showLineNumbers
const portal = await L1FeeJuicePortalManager.new(pxe, publicClient, walletClient, log);
const claim = await portal.bridgeTokensPublic(recipient, amount, true /* mint */);
```
Expand Down Expand Up @@ -95,7 +95,7 @@ Note: this example is a public token transfer call, but can equally be a private
import { FeeJuicePaymentMethod } from "@aztec/aztec.js";
```

```javascript title="pay_fee_juice_send" showLineNumbers
```javascript title="pay_fee_juice_send" showLineNumbers
const paymentMethod = new FeeJuicePaymentMethod(aliceAddress);
const { transactionFee } = await bananaCoin.methods
.transfer_in_public(aliceAddress, bobAddress, 1n, 0n)
Expand All @@ -107,7 +107,7 @@ const { transactionFee } = await bananaCoin.methods

**The equivalent to specify fees via CLI...**

import { CLI_Fees } from '/components/snippets';
import { CLI_Fees } from '@site/src/components/Snippets/snippets';

<CLI_Fees />

Expand All @@ -119,7 +119,7 @@ Here we will use the `claim` object previously from the bridging section, and th
import { FeeJuicePaymentMethodWithClaim } from "@aztec/aztec.js";
```

```javascript title="claim_and_deploy" showLineNumbers
```javascript title="claim_and_deploy" showLineNumbers
const wallet = await account.getWallet();
const paymentMethod = new FeeJuicePaymentMethodWithClaim(wallet, claim);
const sentTx = account.deploy({ fee: { paymentMethod } });
Expand All @@ -138,7 +138,7 @@ Claiming bridged fee juice and using it to pay for transaction fees results in f

Calling a function, in this case checking the balance of the fee juice contract:

```javascript title="claim_and_pay" showLineNumbers
```javascript title="claim_and_pay" showLineNumbers
const paymentMethod = new FeeJuicePaymentMethodWithClaim(bobWallet, claim);
const receipt = await feeJuiceContract
.withWallet(bobWallet)
Expand Down Expand Up @@ -176,7 +176,7 @@ await pxe.registerContract(fpcContract);

The fee payment method is created and used as follows, with similar syntax for private or public fee payments:

```javascript title="fpc" showLineNumbers
```javascript title="fpc" showLineNumbers
const tx = await bananaCoin.methods
.transfer_in_public(aliceAddress, bobAddress, bananasToSendToBob, 0)
.send({
Expand Down Expand Up @@ -238,7 +238,7 @@ You can find the corresponding CLI command info [here](../../reference/environme

Functions pertaining to sending a transaction, such as `deploy` and `send`, each include a `fee` variable defined with the following (optional) parameters:

```javascript title="user_fee_options" showLineNumbers
```javascript title="user_fee_options" showLineNumbers
/** Fee options as set by a user. */
export type UserFeeOptions = {
/** The fee payment method to use */
Expand All @@ -260,7 +260,7 @@ export type UserFeeOptions = {

The `paymentMethod` is an object for the type of payment. Each of the implementations can be found [here](https://github.com/AztecProtocol/aztec-packages/blob/v0.85.0/yarn-project/aztec.js/src/fee). For example:

```javascript title="fee_juice_method" showLineNumbers
```javascript title="fee_juice_method" showLineNumbers
/**
* Pay fee directly in the Fee Juice.
*/
Expand All @@ -271,7 +271,7 @@ export class FeeJuicePaymentMethod implements FeePaymentMethod {

### Gas Settings

```javascript title="gas_settings_vars" showLineNumbers
```javascript title="gas_settings_vars" showLineNumbers
/** Gas usage and fees limits set by the transaction sender for different dimensions and phases. */
export class GasSettings {
constructor(
Expand All @@ -284,7 +284,7 @@ export class GasSettings {
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.85.0/yarn-project/stdlib/src/gas/gas_settings.ts#L11-L20" target="_blank" rel="noopener noreferrer">Source code: yarn-project/stdlib/src/gas/gas_settings.ts#L11-L20</a></sub></sup>


import { Gas_Settings_Components, Gas_Settings } from '/components/snippets';
import { Gas_Settings_Components, Gas_Settings } from '@site/src/components/Snippets/snippets';

<Gas_Settings />

Expand Down
Loading
Loading