Skip to content

Commit cb9b048

Browse files
committed
updated devnet
1 parent ec26ac4 commit cb9b048

File tree

13 files changed

+436
-616
lines changed

13 files changed

+436
-616
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ aztec-up install 4.0.0-nightly.20260205
4242
## Updating to Latest Nightly
4343

4444
```bash
45-
node scripts/update-to-nightly.js # auto-detect latest
46-
node scripts/update-to-nightly.js --version 4.0.0-nightly.20260206 # specific version
47-
PASSWORD=<pw> node scripts/update-to-nightly.js --deploy # update + deploy to nextnet
48-
PASSWORD=<pw> node scripts/update-to-nightly.js --deploy devnet # update + deploy to devnet
45+
node scripts/update.js # auto-detect latest
46+
node scripts/update.js --version 4.0.0-nightly.20260206 # specific version
47+
PASSWORD=<pw> node scripts/update.js --deploy # update + deploy to nextnet
48+
PASSWORD=<pw> node scripts/update.js --deploy devnet # update + deploy to devnet
4949
```
5050

5151
Use `--deploy [local|devnet|nextnet]` to deploy after update (default: `nextnet`). Use `--skip-aztec-up` to skip Aztec CLI installation. In CI (`CI=1`), the script installs Aztec via curl instead of aztec-up.

contracts/proof_of_password/Nargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type = "contract"
44
authors = [""]
55

66
[dependencies]
7-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.0.0-devnet.1-patch.0", directory = "noir-projects/aztec-nr/aztec" }
8-
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.0.0-devnet.1-patch.0", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.0.0-devnet.2-patch.1", directory = "noir-projects/aztec-nr/aztec" }
8+
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.0.0-devnet.2-patch.1", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
99
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
10-
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.0.0-devnet.1-patch.0", directory = "noir-projects/aztec-nr/compressed-string" }
10+
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.0.0-devnet.2-patch.1", directory = "noir-projects/aztec-nr/compressed-string" }

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"serve": "vite",
1010
"build": "tsc -b && vite build",
1111
"lint": "eslint .",
12-
"copy:dependencies": "cd contracts && nargo check && WORKDIR=$(pwd) && cd $HOME/nargo/github.com/AztecProtocol/aztec-packages/v4.0.0-devnet.1-patch.0/noir-projects/noir-contracts && aztec compile --package token_contract && mkdir -p $WORKDIR/target && cp $HOME/nargo/github.com/AztecProtocol/aztec-packages/v4.0.0-devnet.1-patch.0/noir-projects/noir-contracts/target/token_contract-Token.json $WORKDIR/target/token_contract-Token.json",
12+
"copy:dependencies": "cd contracts && nargo check && WORKDIR=$(pwd) && cd $HOME/nargo/github.com/AztecProtocol/aztec-packages/v4.0.0-devnet.2-patch.1/noir-projects/noir-contracts && aztec compile --package token_contract && mkdir -p $WORKDIR/target && cp $HOME/nargo/github.com/AztecProtocol/aztec-packages/v4.0.0-devnet.2-patch.1/noir-projects/noir-contracts/target/token_contract-Token.json $WORKDIR/target/token_contract-Token.json",
1313
"compile:contracts": "cd contracts && aztec compile --package proof_of_password && aztec codegen ./target/proof_of_password-ProofOfPassword.json",
1414
"test": "cd contracts && aztec test",
1515
"preview": "vite preview",
@@ -23,16 +23,16 @@
2323
"local-aztec:status": "node scripts/toggle-local-aztec.js status"
2424
},
2525
"dependencies": {
26-
"@aztec/accounts": "v4.0.0-devnet.1-patch.0",
27-
"@aztec/aztec.js": "v4.0.0-devnet.1-patch.0",
28-
"@aztec/constants": "v4.0.0-devnet.1-patch.0",
29-
"@aztec/entrypoints": "v4.0.0-devnet.1-patch.0",
30-
"@aztec/foundation": "v4.0.0-devnet.1-patch.0",
31-
"@aztec/noir-contracts.js": "v4.0.0-devnet.1-patch.0",
32-
"@aztec/protocol-contracts": "v4.0.0-devnet.1-patch.0",
33-
"@aztec/pxe": "v4.0.0-devnet.1-patch.0",
34-
"@aztec/stdlib": "v4.0.0-devnet.1-patch.0",
35-
"@aztec/wallet-sdk": "v4.0.0-devnet.1-patch.0",
26+
"@aztec/accounts": "v4.0.0-devnet.2-patch.1",
27+
"@aztec/aztec.js": "v4.0.0-devnet.2-patch.1",
28+
"@aztec/constants": "v4.0.0-devnet.2-patch.1",
29+
"@aztec/entrypoints": "v4.0.0-devnet.2-patch.1",
30+
"@aztec/foundation": "v4.0.0-devnet.2-patch.1",
31+
"@aztec/noir-contracts.js": "v4.0.0-devnet.2-patch.1",
32+
"@aztec/protocol-contracts": "v4.0.0-devnet.2-patch.1",
33+
"@aztec/pxe": "v4.0.0-devnet.2-patch.1",
34+
"@aztec/stdlib": "v4.0.0-devnet.2-patch.1",
35+
"@aztec/wallet-sdk": "v4.0.0-devnet.2-patch.1",
3636
"@emotion/react": "^11.14.0",
3737
"@emotion/styled": "^11.14.0",
3838
"@mui/icons-material": "^6.3.1",
@@ -45,7 +45,7 @@
4545
"zod": "^3.23.8"
4646
},
4747
"devDependencies": {
48-
"@aztec/test-wallet": "v4.0.0-devnet.1-patch.0",
48+
"@aztec/wallets": "v4.0.0-devnet.2-patch.1",
4949
"@eslint/js": "^9.18.0",
5050
"@playwright/test": "1.49.0",
5151
"@types/buffer-json": "^2",

scripts/deploy.ts

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SPONSORED_FPC_SALT } from '@aztec/constants';
22
import { SponsoredFPCContractArtifact } from '@aztec/noir-contracts.js/SponsoredFPC';
33
import { getPXEConfig } from '@aztec/pxe/server';
4-
import { TestWallet } from '@aztec/test-wallet/server';
4+
import { EmbeddedWallet } from '@aztec/wallets/embedded';
55
import fs from 'fs';
66
import path from 'path';
77

@@ -39,12 +39,12 @@ const NETWORK = getNetworkFromArgs();
3939
// Network-specific node URLs (hardcoded, not configurable)
4040
const NETWORK_URLS: Record<string, string> = {
4141
local: 'http://localhost:8080',
42-
devnet: 'https://v4-devnet-1.aztec-labs.com',
42+
devnet: 'https://v4-devnet-2.aztec-labs.com',
4343
nextnet: 'https://nextnet.aztec-labs.com',
4444
};
4545

4646
const AZTEC_NODE_URL = NETWORK_URLS[NETWORK];
47-
const PROVER_ENABLED = process.env.PROVER_ENABLED === 'false' ? false : true;
47+
const PROVER_ENABLED = NETWORK !== 'local'; // Disable prover for local to speed up deployment
4848

4949
const PASSWORD = process.env.PASSWORD ? process.env.PASSWORD : undefined;
5050

@@ -57,16 +57,9 @@ const PXE_STORE_DIR = path.join(import.meta.dirname, '.pxe-store');
5757
const INITIAL_TOKEN_BALANCE = 1_000_000_000n;
5858

5959
async function setupWallet(aztecNode: AztecNode) {
60-
fs.rmSync(PXE_STORE_DIR, { recursive: true, force: true });
61-
62-
const config = getPXEConfig();
63-
//config.dataDirectory = PXE_STORE_DIR;
64-
config.proverEnabled = PROVER_ENABLED;
65-
66-
return await TestWallet.create(aztecNode, config, {
67-
proverOrOptions: {
68-
logger: createLogger('bb:native'),
69-
},
60+
return await EmbeddedWallet.create(aztecNode, {
61+
ephemeral: true,
62+
pxeConfig: { ...getPXEConfig(), proverEnabled: PROVER_ENABLED },
7063
});
7164
}
7265

@@ -78,7 +71,7 @@ async function getSponsoredPFCContract() {
7871
return instance;
7972
}
8073

81-
async function createAccount(wallet: TestWallet) {
74+
async function createAccount(wallet: EmbeddedWallet) {
8275
const salt = Fr.random();
8376
const secretKey = Fr.random();
8477
const signingKey = deriveSigningKey(secretKey);
@@ -105,7 +98,7 @@ async function createAccount(wallet: TestWallet) {
10598
};
10699
}
107100

108-
async function deployContracts(wallet: TestWallet, deployer: AztecAddress) {
101+
async function deployContracts(wallet: EmbeddedWallet, deployer: AztecAddress) {
109102
const sponsoredPFCContract = await getSponsoredPFCContract();
110103
const paymentMethod = new SponsoredFeePaymentMethod(sponsoredPFCContract.address);
111104

@@ -148,21 +141,25 @@ async function deployContracts(wallet: TestWallet, deployer: AztecAddress) {
148141
const nonceForAuthwits = Fr.random();
149142
const token0Authwit = await wallet.createAuthWit(deployer, {
150143
caller: amm.address,
151-
action: gregoCoin.methods.transfer_to_public_and_prepare_private_balance_increase(
152-
deployer,
153-
amm.address,
154-
INITIAL_TOKEN_BALANCE,
155-
nonceForAuthwits,
156-
),
144+
call: await gregoCoin.methods
145+
.transfer_to_public_and_prepare_private_balance_increase(
146+
deployer,
147+
amm.address,
148+
INITIAL_TOKEN_BALANCE,
149+
nonceForAuthwits,
150+
)
151+
.getFunctionCall(),
157152
});
158153
const token1Authwit = await wallet.createAuthWit(deployer, {
159154
caller: amm.address,
160-
action: gregoCoinPremium.methods.transfer_to_public_and_prepare_private_balance_increase(
161-
deployer,
162-
amm.address,
163-
INITIAL_TOKEN_BALANCE,
164-
nonceForAuthwits,
165-
),
155+
call: await gregoCoinPremium.methods
156+
.transfer_to_public_and_prepare_private_balance_increase(
157+
deployer,
158+
amm.address,
159+
INITIAL_TOKEN_BALANCE,
160+
nonceForAuthwits,
161+
)
162+
.getFunctionCall(),
166163
});
167164

168165
await new BatchCall(wallet, [
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Update gregoswap to the latest Aztec nightly version.
55
*
66
* Usage:
7-
* node scripts/update-to-nightly.js [--version VERSION] [--deploy [NETWORK]] [--skip-aztec-up]
7+
* node scripts/update.js [--version VERSION] [--deploy [NETWORK]] [--skip-aztec-up]
88
*/
99

1010
import { readFileSync, writeFileSync } from "fs";
@@ -59,14 +59,11 @@ function updatePackageJson(version) {
5959
const path = resolve(ROOT, "package.json");
6060
let content = readFileSync(path, "utf-8");
6161

62-
// Update dependencies
63-
content = content.replace(
64-
/@aztec\/([^"]+)": "v4\.0\.0-nightly\.\d+"/g,
65-
`@aztec/$1": "v${version}"`
66-
);
62+
// Update @aztec/* dependency versions (any version tag)
63+
content = content.replace(/"(@aztec\/[^"]+)": "v[^"]+"/g, `"$1": "v${version}"`);
6764

68-
// Update version in copy:dependencies script
69-
content = content.replace(/v4\.0\.0-nightly\.\d+/g, `v${version}`);
65+
// Update version path segments in scripts (e.g. copy:dependencies nargo paths)
66+
content = content.replace(/\/aztec-packages\/v[^/]+\//g, `/aztec-packages/v${version}/`);
7067

7168
writeFileSync(path, content, "utf-8");
7269
log(COLORS.green, "✓ package.json updated\n");
@@ -77,7 +74,7 @@ function updateNargoToml(version) {
7774
const path = resolve(ROOT, "contracts/proof_of_password/Nargo.toml");
7875
let content = readFileSync(path, "utf-8");
7976

80-
content = content.replace(/tag = "v4\.0\.0-nightly\.\d+"/g, `tag = "v${version}"`);
77+
content = content.replace(/(git = "https:\/\/github\.com\/AztecProtocol\/aztec-packages[^"]*",\s*tag = ")v[^"]+"/g, `$1v${version}"`);
8178

8279
writeFileSync(path, content, "utf-8");
8380
log(COLORS.green, "✓ Nargo.toml files updated\n");

src/config/networks/devnet.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"id": "devnet",
3-
"nodeUrl": "https://v4-devnet-1.aztec-labs.com",
3+
"nodeUrl": "https://v4-devnet-2.aztec-labs.com",
44
"chainId": "11155111",
5-
"rollupVersion": "138964170",
5+
"rollupVersion": "615022430",
66
"contracts": {
7-
"gregoCoin": "0x21f19cdb09cf9b91adc4bfe77a6a72370018210589d92146b97d3d1e49194d3a",
8-
"gregoCoinPremium": "0x024657625d971c2cffc8531aa168b6f8058a33960befd94c857c84d5ba2d8dca",
9-
"amm": "0x1d761845dcd5924ee2bdf6cb03b28a0d5b83e247f055d159023122498699e398",
10-
"liquidityToken": "0x0ba53efd7204ef2291bb7a0d8210ee191b24594d321d768b645bf7756dfe5401",
11-
"pop": "0x2fea74f498cfae0260625deddc45e3b3c7f8a8f62962f8aa28eab6ae4aa4ad39",
12-
"sponsoredFPC": "0x0cc8969aefc807d1145702ef5cf7ea57801ab633fa0b5cf1527203b667812be9",
13-
"salt": "0x2b6ae0ec524e9ff92113f1f5d4acab7243570e286eee5fa3ec9c9c8be600307b"
7+
"gregoCoin": "0x0299fbace3b22cb92f77105cf0858fa28cb81fdde8224bd9f547103b62549015",
8+
"gregoCoinPremium": "0x2c183370da7ba6ec38eae88e741d3784924f3705e83fd21db38f22b8b35d4761",
9+
"amm": "0x0ca83d33b850faf48c9a885d9a832b87bb8f48ad71821e3fa758e9fb6779e7fd",
10+
"liquidityToken": "0x2274ec5c0584a41ba8337aa4a806028fa09ea9c4c141d9de1c2d14eda6913105",
11+
"pop": "0x1674809b55029e57a751be1db39e7cef89ca07b986f6bd270f7537fcb9215670",
12+
"sponsoredFPC": "0x09a4df73aa47f82531a038d1d51abfc85b27665c4b7ca751e2d4fa9f19caffb2",
13+
"salt": "0x20dbf2773747cdd5ab17f6269f0cda5a0e6a8ce54a594a00a26782af0efc18cb"
1414
},
1515
"deployer": {
16-
"address": "0x0b6b6f41afc9d88bad024b0f781a9c8b26b60e705cc929793e974a852d51a665"
16+
"address": "0x0b96e41ab877b4444a6950dc38e16f7f283aad02a440f60e7a2e9afe9c3a8a6f"
1717
},
18-
"deployedAt": "2026-02-11T18:34:54.571Z"
18+
"deployedAt": "2026-02-20T08:20:14.254Z"
1919
}

src/contexts/contracts/ContractsContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function ContractsProvider({ children }: ContractsProviderProps) {
8383

8484
// Get exchange rate
8585
const getExchangeRate = useCallback(async (): Promise<number> => {
86-
if (!wallet || !state.contracts.amm || !state.contracts.gregoCoin || !state.contracts.gregoCoinPremium) {
86+
if (!wallet || !currentAddress || !state.contracts.amm || !state.contracts.gregoCoin || !state.contracts.gregoCoinPremium) {
8787
throw new Error('Contracts not initialized');
8888
}
8989

@@ -94,7 +94,7 @@ export function ContractsProvider({ children }: ContractsProviderProps) {
9494
gregoCoinPremium: state.contracts.gregoCoinPremium,
9595
amm: state.contracts.amm,
9696
},
97-
currentAddress!,
97+
currentAddress,
9898
);
9999
}, [wallet, state.contracts, currentAddress]);
100100

src/contexts/onboarding/OnboardingContext.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import {
2020
type OnboardingResult,
2121
type DripPhase,
2222
} from './reducer';
23-
import { parseDripError, deployEmbeddedAccount } from '../../services/contractService';
23+
import { parseDripError } from '../../services/contractService';
24+
import { deployEmbeddedAccount } from '../../services/walletService';
25+
import { EmbeddedWallet } from '../../embedded_wallet';
2426

2527
export type { OnboardingStatus, OnboardingStep };
2628
export { ONBOARDING_STEPS, ONBOARDING_STEPS_WITH_DRIP, getOnboardingSteps, getOnboardingStepsWithDrip };
@@ -140,7 +142,7 @@ export function OnboardingProvider({ children }: OnboardingProviderProps) {
140142
!state.hasDeployedAccount
141143
) {
142144
actions.markDeployedAccount();
143-
await deployEmbeddedAccount(wallet, node);
145+
await deployEmbeddedAccount(wallet as EmbeddedWallet);
144146
// After deployment, proceed to register contracts
145147
actions.markRegistered();
146148
actions.advanceStatus('registering');

src/contexts/wallet/WalletContext.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ export function WalletProvider({ children }: WalletProviderProps) {
8686
actions.initStart();
8787

8888
const node = walletService.createNodeClient(nodeUrl);
89-
const embeddedWallet = await walletService.createEmbeddedWallet(node);
90-
const accounts = await embeddedWallet.getAccounts();
91-
const defaultAccountAddress = accounts[0]?.item;
89+
const { wallet: embeddedWallet, address: defaultAccountAddress } = await walletService.createEmbeddedWallet(node);
9290

9391
// Store embedded wallet for later restoration
9492
embeddedWalletRef.current = embeddedWallet;

0 commit comments

Comments
 (0)