Skip to content

Commit 28641b1

Browse files
committed
update
1 parent 24dd5e3 commit 28641b1

7 files changed

Lines changed: 428 additions & 396 deletions

File tree

contracts/amm/Nargo.toml

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

66
[dependencies]
7-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/aztec" }
8-
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
9-
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/uint-note" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260416", directory = "noir-projects/aztec-nr/aztec" }
8+
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260416", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
9+
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260416", directory = "noir-projects/aztec-nr/uint-note" }

contracts/proof_of_password/Nargo.toml

Lines changed: 4 additions & 4 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.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/aztec" }
8-
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
9-
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
10-
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/compressed-string" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260416", directory = "noir-projects/aztec-nr/aztec" }
8+
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260416", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
9+
poseidon = { tag = "v0.3.0", git = "https://github.com/noir-lang/poseidon" }
10+
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260416", directory = "noir-projects/aztec-nr/compressed-string" }

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@
2727
"local-aztec:status": "node scripts/toggle-local-aztec.js status"
2828
},
2929
"dependencies": {
30-
"@aztec/accounts": "v4.2.0-nightly.20260412",
31-
"@aztec/aztec.js": "v4.2.0-nightly.20260412",
32-
"@aztec/constants": "v4.2.0-nightly.20260412",
33-
"@aztec/entrypoints": "v4.2.0-nightly.20260412",
34-
"@aztec/foundation": "v4.2.0-nightly.20260412",
35-
"@aztec/noir-contracts.js": "v4.2.0-nightly.20260412",
36-
"@aztec/protocol-contracts": "v4.2.0-nightly.20260412",
37-
"@aztec/pxe": "v4.2.0-nightly.20260412",
38-
"@aztec/stdlib": "v4.2.0-nightly.20260412",
39-
"@aztec/wallet-sdk": "v4.2.0-nightly.20260412",
30+
"@aztec/accounts": "v4.3.0-nightly.20260416",
31+
"@aztec/aztec.js": "v4.3.0-nightly.20260416",
32+
"@aztec/constants": "v4.3.0-nightly.20260416",
33+
"@aztec/entrypoints": "v4.3.0-nightly.20260416",
34+
"@aztec/foundation": "v4.3.0-nightly.20260416",
35+
"@aztec/noir-contracts.js": "v4.3.0-nightly.20260416",
36+
"@aztec/protocol-contracts": "v4.3.0-nightly.20260416",
37+
"@aztec/pxe": "v4.3.0-nightly.20260416",
38+
"@aztec/stdlib": "v4.3.0-nightly.20260416",
39+
"@aztec/wallet-sdk": "v4.3.0-nightly.20260416",
4040
"@emotion/react": "^11.14.0",
4141
"@emotion/styled": "^11.14.0",
42-
"@gregojuice/contracts": "^0.0.15",
43-
"@gregojuice/embedded-wallet": "^0.0.15",
42+
"@gregojuice/contracts": "^0.0.16",
43+
"@gregojuice/embedded-wallet": "^0.0.16",
4444
"@mui/icons-material": "^6.3.1",
4545
"@mui/material": "^6.3.1",
4646
"@mui/styles": "^6.3.1",
@@ -52,7 +52,7 @@
5252
"zone.js": "^0.16.1"
5353
},
5454
"devDependencies": {
55-
"@aztec/wallets": "v4.2.0-nightly.20260412",
55+
"@aztec/wallets": "v4.3.0-nightly.20260416",
5656
"@eslint/js": "^9.18.0",
5757
"@playwright/test": "1.49.0",
5858
"@types/buffer-json": "^2",

scripts/update.js

Lines changed: 92 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
* node scripts/update.js [--version VERSION] [--deploy [NETWORK]] [--skip-aztec-up]
88
*/
99

10-
import { readFileSync, writeFileSync } from "fs";
11-
import { resolve, dirname } from "path";
12-
import { fileURLToPath } from "url";
13-
import { execSync } from "child_process";
10+
import { readFileSync, writeFileSync } from 'fs';
11+
import { resolve, dirname } from 'path';
12+
import { fileURLToPath } from 'url';
13+
import { execSync } from 'child_process';
1414

1515
const __dirname = dirname(fileURLToPath(import.meta.url));
16-
const ROOT = resolve(__dirname, "..");
16+
const ROOT = resolve(__dirname, '..');
1717

1818
// Color codes
1919
const COLORS = {
20-
reset: "\x1b[0m",
21-
red: "\x1b[31m",
22-
green: "\x1b[32m",
23-
yellow: "\x1b[33m",
20+
reset: '\x1b[0m',
21+
red: '\x1b[31m',
22+
green: '\x1b[32m',
23+
yellow: '\x1b[33m',
2424
};
2525

2626
function log(color, message) {
@@ -30,76 +30,95 @@ function log(color, message) {
3030
function exec(command, options = {}) {
3131
return execSync(command, {
3232
cwd: ROOT,
33-
stdio: options.silent ? "pipe" : "inherit",
34-
encoding: "utf-8",
33+
stdio: options.silent ? 'pipe' : 'inherit',
34+
encoding: 'utf-8',
3535
...options,
3636
});
3737
}
3838

3939
async function fetchLatestNightly() {
40-
log(COLORS.yellow, "Fetching latest nightly from npm...");
40+
log(COLORS.yellow, 'Fetching latest nightly from npm...');
4141
try {
42-
const output = exec("npm view @aztec/aztec.js versions --json", { silent: true });
42+
const output = exec('npm view @aztec/aztec.js versions --json', { silent: true });
4343
const versions = JSON.parse(output);
44-
const nightlies = versions.filter((v) => v.match(/^4\.0\.0-nightly\.\d+$/));
44+
const nightlies = versions.filter(v => v.match(/^4\.\d+\.\d+-nightly\.\d+$/));
4545
const latest = nightlies[nightlies.length - 1];
4646
if (!latest) {
47-
throw new Error("No nightly versions found");
47+
throw new Error('No nightly versions found');
4848
}
4949
return latest;
5050
} catch (error) {
51-
log(COLORS.red, "Failed to fetch latest nightly version from npm");
52-
log(COLORS.red, "Please specify a version with --version");
51+
log(COLORS.red, 'Failed to fetch latest nightly version from npm');
52+
log(COLORS.red, 'Please specify a version with --version');
5353
process.exit(1);
5454
}
5555
}
5656

5757
function updatePackageJson(version) {
58-
log(COLORS.yellow, "[1/7] Updating package.json...");
59-
const path = resolve(ROOT, "package.json");
60-
let content = readFileSync(path, "utf-8");
58+
log(COLORS.yellow, '[1/7] Updating package.json...');
59+
const path = resolve(ROOT, 'package.json');
60+
let content = readFileSync(path, 'utf-8');
6161

6262
// Update @aztec/* dependency versions (any version tag)
6363
content = content.replace(/"(@aztec\/[^"]+)": "v[^"]+"/g, `"$1": "v${version}"`);
6464

6565
// Update version path segments in scripts (e.g. copy:dependencies nargo paths)
6666
content = content.replace(/\/aztec-packages\/v[^/]+\//g, `/aztec-packages/v${version}/`);
6767

68-
writeFileSync(path, content, "utf-8");
69-
log(COLORS.green, "✓ package.json updated\n");
68+
writeFileSync(path, content, 'utf-8');
69+
log(COLORS.green, '✓ package.json updated\n');
7070
}
7171

7272
function updateNargoToml(version) {
73-
log(COLORS.yellow, "[2/7] Updating Nargo.toml files...");
74-
const path = resolve(ROOT, "contracts/proof_of_password/Nargo.toml");
75-
let content = readFileSync(path, "utf-8");
76-
77-
content = content.replace(/(git = "https:\/\/github\.com\/AztecProtocol\/aztec-packages[^"]*",\s*tag = ")v[^"]+"/g, `$1v${version}"`);
73+
log(COLORS.yellow, '[2/7] Updating Nargo.toml files...');
74+
const path = resolve(ROOT, 'contracts');
75+
const contracts = ['proof_of_password', 'amm'];
76+
for (const contract of contracts) {
77+
const nargoPath = resolve(path, contract, 'Nargo.toml');
78+
let content = readFileSync(nargoPath, 'utf-8');
79+
80+
content = content.replace(
81+
/(git = "https:\/\/github\.com\/AztecProtocol\/aztec-packages[^"]*",\s*tag = ")v[^"]+"/g,
82+
`$1v${version}"`,
83+
);
84+
85+
writeFileSync(nargoPath, content, 'utf-8');
86+
}
7887

79-
writeFileSync(path, content, "utf-8");
80-
log(COLORS.green, "✓ Nargo.toml files updated\n");
88+
log(COLORS.green, '✓ Nargo.toml files updated\n');
8189
}
8290

8391
function updateReadme(version) {
84-
log(COLORS.yellow, "[3/7] Updating README.md...");
85-
const path = resolve(ROOT, "README.md");
86-
let content = readFileSync(path, "utf-8");
92+
log(COLORS.yellow, '[3/7] Updating README.md...');
93+
const path = resolve(ROOT, 'README.md');
94+
let content = readFileSync(path, 'utf-8');
8795

8896
content = content.replace(/v4\.0\.0-nightly\.\d+/g, `v${version}`);
8997

90-
writeFileSync(path, content, "utf-8");
91-
log(COLORS.green, "✓ README.md updated\n");
98+
writeFileSync(path, content, 'utf-8');
99+
log(COLORS.green, '✓ README.md updated\n');
92100
}
93101

94102
function installDependencies() {
95-
log(COLORS.yellow, "[4/7] Running yarn install...");
96-
exec("yarn install");
97-
log(COLORS.green, "✓ Dependencies installed\n");
103+
log(COLORS.yellow, '[4/7] Running yarn install...');
104+
exec('yarn install');
105+
log(COLORS.green, '✓ Dependencies installed\n');
98106
}
99107

100108
function installAztecCLI(version) {
101109
log(COLORS.yellow, `[5/7] Installing Aztec CLI version ${version}...`);
102110

111+
// Check if already at the right version
112+
try {
113+
const current = exec('aztec --version', { silent: true }).trim();
114+
if (current === version) {
115+
log(COLORS.green, `✓ Aztec CLI already at v${version}, skipping\n`);
116+
return;
117+
}
118+
} catch {
119+
// aztec not installed, proceed with installation
120+
}
121+
103122
const isCI = !!process.env.CI;
104123

105124
if (isCI) {
@@ -111,40 +130,43 @@ function installAztecCLI(version) {
111130
// Update PATH for current session
112131
process.env.PATH = `${process.env.HOME}/.aztec/versions/${version}/bin:${process.env.PATH}`;
113132
process.env.PATH = `${process.env.HOME}/.aztec/versions/${version}/node_modules/.bin:${process.env.PATH}`;
114-
log(COLORS.green, "✓ Aztec CLI installed (CI mode)\n");
133+
log(COLORS.green, '✓ Aztec CLI installed (CI mode)\n');
115134
} else {
116135
// Local environment with aztec-up
117136
try {
118-
exec("command -v aztec-up", { silent: true });
137+
exec('command -v aztec-up', { silent: true });
119138
exec(`aztec-up install ${version}`);
120-
log(COLORS.green, "✓ Aztec CLI updated\n");
139+
log(COLORS.green, '✓ Aztec CLI updated\n');
121140
} catch {
122-
log(COLORS.red, `Warning: aztec-up not found in PATH. Please install manually with: aztec-up install ${version}\n`);
141+
log(
142+
COLORS.red,
143+
`Warning: aztec-up not found in PATH. Please install manually with: aztec-up install ${version}\n`,
144+
);
123145
}
124146
}
125147
}
126148

127149
function compileContracts() {
128-
log(COLORS.yellow, "[6/7] Compiling contracts...");
129-
exec("yarn compile:contracts");
130-
log(COLORS.green, "✓ Contracts compiled\n");
150+
log(COLORS.yellow, '[6/7] Compiling contracts...');
151+
exec('yarn compile:contracts');
152+
log(COLORS.green, '✓ Contracts compiled\n');
131153
}
132154

133-
const VALID_NETWORKS = ["local", "devnet", "nextnet"];
155+
const VALID_NETWORKS = ['local', 'devnet', 'nextnet'];
134156

135157
function deploy(network) {
136158
log(COLORS.yellow, `[7/7] Deploying to ${network}...`);
137159
if (!process.env.PASSWORD) {
138-
log(COLORS.red, "ERROR: PASSWORD environment variable not set");
139-
log(COLORS.red, "Please set PASSWORD before running with --deploy flag");
160+
log(COLORS.red, 'ERROR: PASSWORD environment variable not set');
161+
log(COLORS.red, 'Please set PASSWORD before running with --deploy flag');
140162
process.exit(1);
141163
}
142164
exec(`yarn deploy:${network}`);
143165
log(COLORS.green, `✓ Deployed to ${network}\n`);
144166
}
145167

146168
async function main() {
147-
log(COLORS.green, "=== Gregoswap Nightly Update Script ===\n");
169+
log(COLORS.green, '=== Gregoswap Nightly Update Script ===\n');
148170

149171
// Parse arguments
150172
const args = process.argv.slice(2);
@@ -153,30 +175,30 @@ async function main() {
153175
let skipAztecUp = false;
154176

155177
for (let i = 0; i < args.length; i++) {
156-
if (args[i] === "--version" && args[i + 1]) {
157-
version = args[i + 1].replace(/^v/, "");
178+
if (args[i] === '--version' && args[i + 1]) {
179+
version = args[i + 1].replace(/^v/, '');
158180
i++;
159-
} else if (args[i] === "--deploy") {
181+
} else if (args[i] === '--deploy') {
160182
const next = args[i + 1];
161-
if (next && !next.startsWith("--")) {
183+
if (next && !next.startsWith('--')) {
162184
if (!VALID_NETWORKS.includes(next)) {
163-
log(COLORS.red, `ERROR: Unknown network "${next}". Valid networks: ${VALID_NETWORKS.join(", ")}`);
185+
log(COLORS.red, `ERROR: Unknown network "${next}". Valid networks: ${VALID_NETWORKS.join(', ')}`);
164186
process.exit(1);
165187
}
166188
deployNetwork = next;
167189
i++;
168190
} else {
169-
deployNetwork = "nextnet";
191+
deployNetwork = 'nextnet';
170192
}
171-
} else if (args[i] === "--skip-aztec-up") {
193+
} else if (args[i] === '--skip-aztec-up') {
172194
skipAztecUp = true;
173-
} else if (args[i] === "--help") {
174-
console.log("Usage: node scripts/update-to-nightly.js [OPTIONS]");
175-
console.log("\nOptions:");
176-
console.log(" --version VERSION Specify nightly version (e.g., 4.0.0-nightly.20260206)");
177-
console.log(" --deploy [NETWORK] Deploy after update (default: nextnet, options: local, devnet, nextnet)");
178-
console.log(" --skip-aztec-up Skip Aztec CLI installation");
179-
console.log(" --help Show this help message");
195+
} else if (args[i] === '--help') {
196+
console.log('Usage: node scripts/update-to-nightly.js [OPTIONS]');
197+
console.log('\nOptions:');
198+
console.log(' --version VERSION Specify nightly version (e.g., 4.0.0-nightly.20260206)');
199+
console.log(' --deploy [NETWORK] Deploy after update (default: nextnet, options: local, devnet, nextnet)');
200+
console.log(' --skip-aztec-up Skip Aztec CLI installation');
201+
console.log(' --help Show this help message');
180202
process.exit(0);
181203
}
182204
}
@@ -198,25 +220,28 @@ async function main() {
198220
if (!skipAztecUp) {
199221
installAztecCLI(version);
200222
} else {
201-
log(COLORS.yellow, "[5/7] Skipping Aztec CLI installation (--skip-aztec-up flag set)\n");
223+
log(COLORS.yellow, '[5/7] Skipping Aztec CLI installation (--skip-aztec-up flag set)\n');
202224
}
203225

204226
compileContracts();
205227

206228
if (deployNetwork) {
207229
deploy(deployNetwork);
208230
} else {
209-
log(COLORS.yellow, "[7/7] Skipping deployment (use --deploy [network] flag to deploy)\n");
231+
log(COLORS.yellow, '[7/7] Skipping deployment (use --deploy [network] flag to deploy)\n');
210232
}
211233

212-
log(COLORS.green, "=== Update Complete ===");
234+
log(COLORS.green, '=== Update Complete ===');
213235
log(COLORS.green, `Version: v${version}`);
214236
if (!deployNetwork) {
215-
log(COLORS.yellow, "To deploy, run: PASSWORD=<password> node scripts/update-to-nightly.js --deploy [local|devnet|nextnet]");
237+
log(
238+
COLORS.yellow,
239+
'To deploy, run: PASSWORD=<password> node scripts/update-to-nightly.js --deploy [local|devnet|nextnet]',
240+
);
216241
}
217242
}
218243

219-
main().catch((error) => {
244+
main().catch(error => {
220245
log(COLORS.red, `Error: ${error.message}`);
221246
process.exit(1);
222247
});

0 commit comments

Comments
 (0)