Skip to content

Commit 8274872

Browse files
authored
Merge pull request #238 from AztecProtocol/jc/update-nightly-syntax
chore: update to aztec 4.0.0-nightly.20260204
2 parents c2c9bf9 + e28e390 commit 8274872

24 files changed

Lines changed: 839 additions & 486 deletions

.github/workflows/local-network.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
env:
1919
AZTEC_ENV: local-network
20-
AZTEC_VERSION: 3.0.0-devnet.6-patch.1
20+
AZTEC_VERSION: 4.0.0-nightly.20260204
2121

2222
steps:
2323
- name: Checkout repository
@@ -29,21 +29,20 @@ jobs:
2929
node-version: "22"
3030
cache: "yarn"
3131

32-
- name: Set up Docker
33-
uses: docker/setup-buildx-action@v3
32+
- name: Install Foundry
33+
uses: foundry-rs/foundry-toolchain@v1
3434

3535
- name: Install Aztec CLI
3636
run: |
37-
curl -s https://install.aztec.network > tmp.sh
37+
INSTALL_URL="https://install.aztec.network/${{ env.AZTEC_VERSION }}/"
38+
curl -sL $INSTALL_URL > tmp.sh
3839
VERSION=${{ env.AZTEC_VERSION }} bash tmp.sh <<< yes "yes"
3940
4041
- name: Update path
41-
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
42-
43-
# This is a temporary hack to fix a problem with v3 releases.
44-
- name: Manually tag the aztec version as `latest`
4542
run: |
46-
docker tag aztecprotocol/aztec:${{ env.AZTEC_VERSION }} aztecprotocol/aztec:latest
43+
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
44+
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
45+
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
4746
4847
- name: Start local Aztec network
4948
run: aztec start --local-network &

Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ authors = [ "" ]
55
compiler_version = ">=0.18.0"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v3.0.0-devnet.6-patch.1", directory = "aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v4.0.0-nightly.20260204", directory = "aztec" }

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
"update-readme-version": "node ./.github/scripts/update-readme-version.js"
3434
},
3535
"dependencies": {
36-
"@aztec/accounts": "3.0.0-devnet.6-patch.1",
37-
"@aztec/aztec.js": "3.0.0-devnet.6-patch.1",
38-
"@aztec/noir-contracts.js": "3.0.0-devnet.6-patch.1",
39-
"@aztec/protocol-contracts": "3.0.0-devnet.6-patch.1",
40-
"@aztec/pxe": "3.0.0-devnet.6-patch.1",
41-
"@aztec/stdlib": "3.0.0-devnet.6-patch.1",
42-
"@aztec/test-wallet": "3.0.0-devnet.6-patch.1",
36+
"@aztec/accounts": "4.0.0-nightly.20260204",
37+
"@aztec/aztec.js": "4.0.0-nightly.20260204",
38+
"@aztec/noir-contracts.js": "4.0.0-nightly.20260204",
39+
"@aztec/protocol-contracts": "4.0.0-nightly.20260204",
40+
"@aztec/pxe": "4.0.0-nightly.20260204",
41+
"@aztec/stdlib": "4.0.0-nightly.20260204",
42+
"@aztec/test-wallet": "4.0.0-nightly.20260204",
4343
"dotenv": "^17.2.2"
4444
},
4545
"devDependencies": {

scripts/deploy_account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Logger, createLogger } from "@aztec/aztec.js/log";
1+
import { type Logger, createLogger } from "@aztec/foundation/log";
22
import { deploySchnorrAccount } from "../src/utils/deploy_account.js";
33

44
export async function deployAccount() {

scripts/deploy_contract.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { PodRacingContract } from "../src/artifacts/PodRacing.js"
2-
import { Logger, createLogger } from "@aztec/aztec.js/log";
3-
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing";
2+
import { type Logger, createLogger } from "@aztec/foundation/log";
3+
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee";
44
import { setupWallet } from "../src/utils/setup_wallet.js";
55
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
6-
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
6+
import { SponsoredFPCContractArtifact } from "@aztec/noir-contracts.js/SponsoredFPC";
77
import { deploySchnorrAccount } from "../src/utils/deploy_account.js";
88
import { getTimeouts } from "../config/config.js";
99

@@ -26,7 +26,7 @@ async function main() {
2626
logger.info(`💰 Sponsored FPC instance obtained at: ${sponsoredFPC.address}`);
2727

2828
logger.info('📝 Registering sponsored FPC contract with wallet...');
29-
await wallet.registerContract(sponsoredFPC, SponsoredFPCContract.artifact);
29+
await wallet.registerContract(sponsoredFPC, SponsoredFPCContractArtifact);
3030
const sponsoredPaymentMethod = new SponsoredFeePaymentMethod(sponsoredFPC.address);
3131
logger.info('✅ Sponsored fee payment method configured');
3232

@@ -40,14 +40,13 @@ async function main() {
4040
logger.info('🏎️ Starting pod racing contract deployment...');
4141
logger.info(`📋 Admin address for pod racing contract: ${address}`);
4242

43-
const deployMethod = PodRacingContract.deploy(wallet, address).send({
43+
logger.info('⏳ Waiting for deployment transaction to be mined...');
44+
const { contract: podRacingContract, instance } = await PodRacingContract.deploy(wallet, address).send({
4445
from: address,
45-
fee: { paymentMethod: sponsoredPaymentMethod }
46+
fee: { paymentMethod: sponsoredPaymentMethod },
47+
wait: { timeout: timeouts.deployTimeout, returnReceipt: true }
4648
});
4749

48-
logger.info('⏳ Waiting for deployment transaction to be mined...');
49-
const podRacingContract = await deployMethod.deployed({ timeout: timeouts.deployTimeout });
50-
5150
logger.info(`🎉 Pod Racing Contract deployed successfully!`);
5251
logger.info(`📍 Contract address: ${podRacingContract.address}`);
5352
logger.info(`👤 Admin address: ${address}`);
@@ -56,8 +55,7 @@ async function main() {
5655
logger.info('🔍 Verifying contract deployment...');
5756
logger.info('✅ Contract deployed and ready for game creation');
5857

59-
// Get contract instance for instantiation data
60-
const instance = await deployMethod.getInstance();
58+
// Log contract instantiation data
6159
if (instance) {
6260
logger.info('📦 Contract instantiation data:');
6361
logger.info(`Salt: ${instance.salt}`);

scripts/fees.ts

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ import { FeeJuiceContract } from "@aztec/noir-contracts.js/FeeJuice";
88
import { FPCContract } from "@aztec/noir-contracts.js/FPC";
99
import { PodRacingContract } from "../src/artifacts/PodRacing.js"
1010
import { TokenContract } from "@aztec/noir-contracts.js/Token";
11-
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing'
11+
import { SponsoredFeePaymentMethod, FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, PublicFeePaymentMethod } from '@aztec/aztec.js/fee';
1212
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
1313
import { createEthereumChain } from '@aztec/ethereum/chain';
1414
import { createExtendedL1Client } from '@aztec/ethereum/client';
1515
import { deploySchnorrAccount } from "../src/utils/deploy_account.js";
1616
import { setupWallet } from "../src/utils/setup_wallet.js";
17-
import { Logger, createLogger } from '@aztec/aztec.js/log';
18-
import { FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, PublicFeePaymentMethod } from '@aztec/aztec.js/fee';
19-
import { Fr, GrumpkinScalar } from '@aztec/aztec.js/fields';
17+
import { type Logger, createLogger } from '@aztec/foundation/log';
18+
import { Fr } from '@aztec/aztec.js/fields';
19+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
2020
import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
21-
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
21+
import { SponsoredFPCContractArtifact } from '@aztec/noir-contracts.js/SponsoredFPC';
2222
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
2323
import { createAztecNodeClient } from '@aztec/aztec.js/node';
24-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
25-
import { getAztecNodeUrl } from '../config/config.js';
24+
import { AztecAddress } from '@aztec/aztec.js/addresses';
25+
import { getAztecNodeUrl, getTimeouts } from '../config/config.js';
2626
import { GasSettings } from '@aztec/stdlib/gas';
2727

2828
const MNEMONIC = 'test test test test test test test test test test test junk';
@@ -66,23 +66,27 @@ async function main() {
6666

6767
// set up sponsored fee payments
6868
const sponsoredFPC = await getSponsoredFPCInstance();
69-
await wallet.registerContract(sponsoredFPC, SponsoredFPCContract.artifact);
69+
await wallet.registerContract(sponsoredFPC, SponsoredFPCContractArtifact);
7070
const paymentMethod = new SponsoredFeePaymentMethod(sponsoredFPC.address);
71+
const timeouts = getTimeouts();
7172

7273
// Two arbitrary txs to make the L1 message available on L2
7374
const podRacingContract = await PodRacingContract.deploy(wallet, account1.address).send({
7475
from: account1.address,
75-
fee: { paymentMethod }
76-
}).deployed();
76+
fee: { paymentMethod },
77+
wait: { timeout: timeouts.deployTimeout }
78+
});
7779
const bananaCoin = await TokenContract.deploy(wallet, account1.address, "bananaCoin", "BNC", 18).send({
7880
from: account1.address,
79-
fee: { paymentMethod }
80-
}).deployed()
81+
fee: { paymentMethod },
82+
wait: { timeout: timeouts.deployTimeout }
83+
});
8184

8285
// Claim Fee Juice & Pay Fees yourself
8386

84-
const claimAndPay = new FeeJuicePaymentMethodWithClaim(account2.address, claim)
85-
await (await account2.getDeployMethod()).send({ from: AztecAddress.ZERO, fee: { paymentMethod: claimAndPay } }).wait()
87+
const claimAndPay = new FeeJuicePaymentMethodWithClaim(account2.address, claim);
88+
const deployMethod = await account2.getDeployMethod();
89+
await deployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod: claimAndPay }, wait: { timeout: timeouts.deployTimeout } });
8690
logger.info(`New account at ${account2.address} deployed using claimed funds for fees.`)
8791

8892
// Pay fees yourself
@@ -91,7 +95,8 @@ async function main() {
9195
const gameId = Fr.random();
9296
await podRacingContract.methods.create_game(gameId).send({
9397
from: account2.address,
94-
}).wait()
98+
wait: { timeout: timeouts.txTimeout }
99+
});
95100
logger.info(`Game created from new account, paying fees via newWallet.`)
96101

97102
// Private Fee Payments via FPC
@@ -102,54 +107,59 @@ async function main() {
102107
// This uses bananaCoin as the fee paying asset that will be exchanged for fee juice
103108
const fpc = await FPCContract.deploy(wallet, bananaCoin.address, account1.address).send({
104109
from: account1.address,
105-
fee: { paymentMethod }
106-
}).deployed()
110+
fee: { paymentMethod },
111+
wait: { timeout: timeouts.deployTimeout }
112+
});
107113
const fpcClaim = await feeJuicePortalManager.bridgeTokensPublic(fpc.address, FEE_FUNDING_FOR_TESTER_ACCOUNT, true);
108114
// 2 public txs to make the bridged fee juice available
109115
// Mint some bananaCoin and send to the newWallet to pay fees privately
110116
await bananaCoin.methods.mint_to_private(account2.address, FEE_FUNDING_FOR_TESTER_ACCOUNT).send({
111117
from: account1.address,
112-
fee: { paymentMethod }
113-
}).wait()
118+
fee: { paymentMethod },
119+
wait: { timeout: timeouts.txTimeout }
120+
});
114121
// mint some public bananaCoin to the newWallet to pay fees publicly
115122
await bananaCoin.methods.mint_to_public(account2.address, FEE_FUNDING_FOR_TESTER_ACCOUNT).send({
116123
from: account1.address,
117-
fee: { paymentMethod }
118-
}).wait()
124+
fee: { paymentMethod },
125+
wait: { timeout: timeouts.txTimeout }
126+
});
119127
const bananaBalance = await bananaCoin.methods.balance_of_private(account2.address).simulate({
120128
from: account2.address
121-
})
129+
});
122130

123131
logger.info(`BananaCoin balance of newWallet is ${bananaBalance}`)
124132

125133
const feeJuiceInstance = await getCanonicalFeeJuice();
126-
await wallet.registerContract(feeJuiceInstance.instance, FeeJuiceContract.artifact)
127-
const feeJuice = await FeeJuiceContract.at(feeJuiceInstance.address, wallet)
134+
await wallet.registerContract(feeJuiceInstance.instance, FeeJuiceContract.artifact);
135+
const feeJuice = await FeeJuiceContract.at(feeJuiceInstance.address, wallet);
128136

129-
await feeJuice.methods.claim(fpc.address, fpcClaim.claimAmount, fpcClaim.claimSecret, fpcClaim.messageLeafIndex).send({ from: account2.address }).wait()
137+
await feeJuice.methods.claim(fpc.address, fpcClaim.claimAmount, fpcClaim.claimSecret, fpcClaim.messageLeafIndex).send({ from: account2.address, wait: { timeout: timeouts.txTimeout } });
130138

131139
logger.info(`Fpc fee juice balance ${await feeJuice.methods.balance_of_public(fpc.address).simulate({
132140
from: account2.address
133-
})}`)
141+
})}`);
134142

135-
const maxFeesPerGas = (await node.getCurrentBaseFees()).mul(1.5);
143+
const maxFeesPerGas = (await node.getCurrentMinFees()).mul(1.5);
136144
const gasSettings = GasSettings.default({ maxFeesPerGas });
137145

138-
const privateFee = new PrivateFeePaymentMethod(fpc.address, account2.address, wallet, gasSettings)
146+
const privateFee = new PrivateFeePaymentMethod(fpc.address, account2.address, wallet, gasSettings);
139147
await bananaCoin.methods.transfer_in_private(account2.address, account1.address, 10, 0).send({
140148
from: account2.address,
141-
fee: { paymentMethod: privateFee }
142-
}).wait()
149+
fee: { paymentMethod: privateFee },
150+
wait: { timeout: timeouts.txTimeout }
151+
});
143152

144153
logger.info(`Transfer paid with fees via the FPC, privately.`)
145154

146155
// Public Fee Payments via FPC
147156

148-
const publicFee = new PublicFeePaymentMethod(fpc.address, account2.address, wallet, gasSettings)
157+
const publicFee = new PublicFeePaymentMethod(fpc.address, account2.address, wallet, gasSettings);
149158
await bananaCoin.methods.transfer_in_private(account2.address, account1.address, 10, 0).send({
150159
from: account2.address,
151-
fee: { paymentMethod: publicFee }
152-
}).wait()
160+
fee: { paymentMethod: publicFee },
161+
wait: { timeout: timeouts.txTimeout }
162+
});
153163
logger.info(`Transfer paid with fees via the FPC, publicly.`)
154164

155165
// Sponsored Fee Payment
@@ -158,8 +168,9 @@ async function main() {
158168
const sponsoredPaymentMethod = new SponsoredFeePaymentMethod(sponsoredFPC.address);
159169
await bananaCoin.methods.transfer_in_private(account2.address, account1.address, 10, 0).send({
160170
from: account2.address,
161-
fee: { paymentMethod: sponsoredPaymentMethod }
162-
}).wait()
171+
fee: { paymentMethod: sponsoredPaymentMethod },
172+
wait: { timeout: timeouts.txTimeout }
173+
});
163174
logger.info(`Transfer paid with fees from Sponsored FPC.`)
164175
}
165176

scripts/interaction_existing_contract.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Logger, createLogger } from "@aztec/aztec.js/log";
2-
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing";
1+
import { type Logger, createLogger } from "@aztec/foundation/log";
2+
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee";
33
import { Fr } from "@aztec/aztec.js/fields";
4-
import { AztecAddress } from "@aztec/stdlib/aztec-address";
4+
import { AztecAddress } from "@aztec/aztec.js/addresses";
55
import { PodRacingContract } from "../src/artifacts/PodRacing.js";
6-
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
6+
import { SponsoredFPCContractArtifact } from "@aztec/noir-contracts.js/SponsoredFPC";
77
import { setupWallet } from "../src/utils/setup_wallet.js";
88
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
99
import { getAccountFromEnv } from "../src/utils/create_account_from_env.js";
@@ -21,7 +21,7 @@ async function main() {
2121

2222
// Setup sponsored fee payment
2323
const sponsoredFPC = await getSponsoredFPCInstance();
24-
await wallet.registerContract(sponsoredFPC, SponsoredFPCContract.artifact);
24+
await wallet.registerContract(sponsoredFPC, SponsoredFPCContractArtifact);
2525
const sponsoredPaymentMethod = new SponsoredFeePaymentMethod(sponsoredFPC.address);
2626

2727
// Get account from environment variables
@@ -91,9 +91,9 @@ async function main() {
9191
await podRacingContract.methods.create_game(gameId)
9292
.send({
9393
from: address,
94-
fee: { paymentMethod: sponsoredPaymentMethod }
95-
})
96-
.wait({ timeout: timeouts.txTimeout });
94+
fee: { paymentMethod: sponsoredPaymentMethod },
95+
wait: { timeout: timeouts.txTimeout }
96+
});
9797
logger.info("Game created successfully!");
9898

9999
logger.info(`Game ${gameId} is now waiting for a second player to join.`);

0 commit comments

Comments
 (0)