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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dist-ssr
*.sw?

.yarn/*
!.yarn/patches
!.yarn/releases
vite.config.ts.*
*.module.css.d.ts
Expand Down
6 changes: 3 additions & 3 deletions contracts/amm/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ authors = [""]
type = "contract"

[dependencies]
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/aztec" }
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/uint-note" }
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260417", directory = "noir-projects/aztec-nr/aztec" }
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260417", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260417", directory = "noir-projects/aztec-nr/uint-note" }
8 changes: 4 additions & 4 deletions contracts/proof_of_password/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type = "contract"
authors = [""]

[dependencies]
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/aztec" }
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.2.0-nightly.20260412", directory = "noir-projects/aztec-nr/compressed-string" }
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260417", directory = "noir-projects/aztec-nr/aztec" }
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260417", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
poseidon = { tag = "v0.3.0", git = "https://github.com/noir-lang/poseidon" }
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v4.3.0-nightly.20260417", directory = "noir-projects/aztec-nr/compressed-string" }
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,32 @@
"local-aztec:status": "node scripts/toggle-local-aztec.js status"
},
"dependencies": {
"@aztec/accounts": "v4.2.0-nightly.20260412",
"@aztec/aztec.js": "v4.2.0-nightly.20260412",
"@aztec/constants": "v4.2.0-nightly.20260412",
"@aztec/entrypoints": "v4.2.0-nightly.20260412",
"@aztec/foundation": "v4.2.0-nightly.20260412",
"@aztec/noir-contracts.js": "v4.2.0-nightly.20260412",
"@aztec/protocol-contracts": "v4.2.0-nightly.20260412",
"@aztec/pxe": "v4.2.0-nightly.20260412",
"@aztec/stdlib": "v4.2.0-nightly.20260412",
"@aztec/wallet-sdk": "v4.2.0-nightly.20260412",
"@aztec/accounts": "v4.3.0-nightly.20260417",
"@aztec/aztec.js": "v4.3.0-nightly.20260417",
"@aztec/constants": "v4.3.0-nightly.20260417",
"@aztec/entrypoints": "v4.3.0-nightly.20260417",
"@aztec/foundation": "v4.3.0-nightly.20260417",
"@aztec/noir-contracts.js": "v4.3.0-nightly.20260417",
"@aztec/protocol-contracts": "v4.3.0-nightly.20260417",
"@aztec/pxe": "v4.3.0-nightly.20260417",
"@aztec/stdlib": "v4.3.0-nightly.20260417",
"@aztec/wallet-sdk": "v4.3.0-nightly.20260417",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@gregojuice/contracts": "^0.0.15",
"@gregojuice/embedded-wallet": "^0.0.15",
"@gregojuice/contracts": "^0.0.18",
"@gregojuice/embedded-wallet": "^0.0.18",
"@mui/icons-material": "^6.3.1",
"@mui/material": "^6.3.1",
"@mui/styles": "^6.3.1",
"buffer-json": "^2.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-dropzone": "^14.3.5",
"zod": "^3.23.8"
"zod": "^3.23.8",
"zone.js": "^0.16.1"
},
"devDependencies": {
"@aztec/wallets": "v4.2.0-nightly.20260412",
"@aztec/wallets": "v4.3.0-nightly.20260417",
"@eslint/js": "^9.18.0",
"@playwright/test": "1.49.0",
"@types/buffer-json": "^2",
Expand Down
159 changes: 92 additions & 67 deletions scripts/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
* node scripts/update.js [--version VERSION] [--deploy [NETWORK]] [--skip-aztec-up]
*/

import { readFileSync, writeFileSync } from "fs";
import { resolve, dirname } from "path";
import { fileURLToPath } from "url";
import { execSync } from "child_process";
import { readFileSync, writeFileSync } from 'fs';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import { execSync } from 'child_process';

const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");
const ROOT = resolve(__dirname, '..');

// Color codes
const COLORS = {
reset: "\x1b[0m",
red: "\x1b[31m",
green: "\x1b[32m",
yellow: "\x1b[33m",
reset: '\x1b[0m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
};

function log(color, message) {
Expand All @@ -30,76 +30,95 @@ function log(color, message) {
function exec(command, options = {}) {
return execSync(command, {
cwd: ROOT,
stdio: options.silent ? "pipe" : "inherit",
encoding: "utf-8",
stdio: options.silent ? 'pipe' : 'inherit',
encoding: 'utf-8',
...options,
});
}

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

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

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

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

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

function updateNargoToml(version) {
log(COLORS.yellow, "[2/7] Updating Nargo.toml files...");
const path = resolve(ROOT, "contracts/proof_of_password/Nargo.toml");
let content = readFileSync(path, "utf-8");

content = content.replace(/(git = "https:\/\/github\.com\/AztecProtocol\/aztec-packages[^"]*",\s*tag = ")v[^"]+"/g, `$1v${version}"`);
log(COLORS.yellow, '[2/7] Updating Nargo.toml files...');
const path = resolve(ROOT, 'contracts');
const contracts = ['proof_of_password', 'amm'];
for (const contract of contracts) {
const nargoPath = resolve(path, contract, 'Nargo.toml');
let content = readFileSync(nargoPath, 'utf-8');

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

writeFileSync(nargoPath, content, 'utf-8');
}

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

function updateReadme(version) {
log(COLORS.yellow, "[3/7] Updating README.md...");
const path = resolve(ROOT, "README.md");
let content = readFileSync(path, "utf-8");
log(COLORS.yellow, '[3/7] Updating README.md...');
const path = resolve(ROOT, 'README.md');
let content = readFileSync(path, 'utf-8');

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

writeFileSync(path, content, "utf-8");
log(COLORS.green, "✓ README.md updated\n");
writeFileSync(path, content, 'utf-8');
log(COLORS.green, '✓ README.md updated\n');
}

function installDependencies() {
log(COLORS.yellow, "[4/7] Running yarn install...");
exec("yarn install");
log(COLORS.green, "✓ Dependencies installed\n");
log(COLORS.yellow, '[4/7] Running yarn install...');
exec('yarn install');
log(COLORS.green, '✓ Dependencies installed\n');
}

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

// Check if already at the right version
try {
const current = exec('aztec --version', { silent: true }).trim();
if (current === version) {
log(COLORS.green, `✓ Aztec CLI already at v${version}, skipping\n`);
return;
}
} catch {
// aztec not installed, proceed with installation
}

const isCI = !!process.env.CI;

if (isCI) {
Expand All @@ -111,40 +130,43 @@ function installAztecCLI(version) {
// Update PATH for current session
process.env.PATH = `${process.env.HOME}/.aztec/versions/${version}/bin:${process.env.PATH}`;
process.env.PATH = `${process.env.HOME}/.aztec/versions/${version}/node_modules/.bin:${process.env.PATH}`;
log(COLORS.green, "✓ Aztec CLI installed (CI mode)\n");
log(COLORS.green, '✓ Aztec CLI installed (CI mode)\n');
} else {
// Local environment with aztec-up
try {
exec("command -v aztec-up", { silent: true });
exec('command -v aztec-up', { silent: true });
exec(`aztec-up install ${version}`);
log(COLORS.green, "✓ Aztec CLI updated\n");
log(COLORS.green, '✓ Aztec CLI updated\n');
} catch {
log(COLORS.red, `Warning: aztec-up not found in PATH. Please install manually with: aztec-up install ${version}\n`);
log(
COLORS.red,
`Warning: aztec-up not found in PATH. Please install manually with: aztec-up install ${version}\n`,
);
}
}
}

function compileContracts() {
log(COLORS.yellow, "[6/7] Compiling contracts...");
exec("yarn compile:contracts");
log(COLORS.green, "✓ Contracts compiled\n");
log(COLORS.yellow, '[6/7] Compiling contracts...');
exec('yarn compile:contracts');
log(COLORS.green, '✓ Contracts compiled\n');
}

const VALID_NETWORKS = ["local", "devnet", "nextnet"];
const VALID_NETWORKS = ['local', 'devnet', 'nextnet'];

function deploy(network) {
log(COLORS.yellow, `[7/7] Deploying to ${network}...`);
if (!process.env.PASSWORD) {
log(COLORS.red, "ERROR: PASSWORD environment variable not set");
log(COLORS.red, "Please set PASSWORD before running with --deploy flag");
log(COLORS.red, 'ERROR: PASSWORD environment variable not set');
log(COLORS.red, 'Please set PASSWORD before running with --deploy flag');
process.exit(1);
}
exec(`yarn deploy:${network}`);
log(COLORS.green, `✓ Deployed to ${network}\n`);
}

async function main() {
log(COLORS.green, "=== Gregoswap Nightly Update Script ===\n");
log(COLORS.green, '=== Gregoswap Nightly Update Script ===\n');

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

for (let i = 0; i < args.length; i++) {
if (args[i] === "--version" && args[i + 1]) {
version = args[i + 1].replace(/^v/, "");
if (args[i] === '--version' && args[i + 1]) {
version = args[i + 1].replace(/^v/, '');
i++;
} else if (args[i] === "--deploy") {
} else if (args[i] === '--deploy') {
const next = args[i + 1];
if (next && !next.startsWith("--")) {
if (next && !next.startsWith('--')) {
if (!VALID_NETWORKS.includes(next)) {
log(COLORS.red, `ERROR: Unknown network "${next}". Valid networks: ${VALID_NETWORKS.join(", ")}`);
log(COLORS.red, `ERROR: Unknown network "${next}". Valid networks: ${VALID_NETWORKS.join(', ')}`);
process.exit(1);
}
deployNetwork = next;
i++;
} else {
deployNetwork = "nextnet";
deployNetwork = 'nextnet';
}
} else if (args[i] === "--skip-aztec-up") {
} else if (args[i] === '--skip-aztec-up') {
skipAztecUp = true;
} else if (args[i] === "--help") {
console.log("Usage: node scripts/update-to-nightly.js [OPTIONS]");
console.log("\nOptions:");
console.log(" --version VERSION Specify nightly version (e.g., 4.0.0-nightly.20260206)");
console.log(" --deploy [NETWORK] Deploy after update (default: nextnet, options: local, devnet, nextnet)");
console.log(" --skip-aztec-up Skip Aztec CLI installation");
console.log(" --help Show this help message");
} else if (args[i] === '--help') {
console.log('Usage: node scripts/update-to-nightly.js [OPTIONS]');
console.log('\nOptions:');
console.log(' --version VERSION Specify nightly version (e.g., 4.0.0-nightly.20260206)');
console.log(' --deploy [NETWORK] Deploy after update (default: nextnet, options: local, devnet, nextnet)');
console.log(' --skip-aztec-up Skip Aztec CLI installation');
console.log(' --help Show this help message');
process.exit(0);
}
}
Expand All @@ -198,25 +220,28 @@ async function main() {
if (!skipAztecUp) {
installAztecCLI(version);
} else {
log(COLORS.yellow, "[5/7] Skipping Aztec CLI installation (--skip-aztec-up flag set)\n");
log(COLORS.yellow, '[5/7] Skipping Aztec CLI installation (--skip-aztec-up flag set)\n');
}

compileContracts();

if (deployNetwork) {
deploy(deployNetwork);
} else {
log(COLORS.yellow, "[7/7] Skipping deployment (use --deploy [network] flag to deploy)\n");
log(COLORS.yellow, '[7/7] Skipping deployment (use --deploy [network] flag to deploy)\n');
}

log(COLORS.green, "=== Update Complete ===");
log(COLORS.green, '=== Update Complete ===');
log(COLORS.green, `Version: v${version}`);
if (!deployNetwork) {
log(COLORS.yellow, "To deploy, run: PASSWORD=<password> node scripts/update-to-nightly.js --deploy [local|devnet|nextnet]");
log(
COLORS.yellow,
'To deploy, run: PASSWORD=<password> node scripts/update-to-nightly.js --deploy [local|devnet|nextnet]',
);
}
}

main().catch((error) => {
main().catch(error => {
log(COLORS.red, `Error: ${error.message}`);
process.exit(1);
});
16 changes: 16 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import { useOnboarding } from './contexts/onboarding';
import { OnboardingModal } from './components/OnboardingModal';
import { TxNotificationCenter } from '@gregojuice/embedded-wallet/ui';
import type { AztecAddress } from '@aztec/aztec.js/addresses';
import { lazy, Suspense } from 'react';

// Dev-only lazy import so ProfilePanel + its deps (canvas flame chart) are
// tree-shaken from prod builds. `import.meta.env.DEV` is replaced with the
// literal boolean at build time; in prod the `?:` picks `null`.
const ProfilePanel = import.meta.env.DEV
? lazy(() => import('./components/ProfilePanel').then(m => ({ default: m.ProfilePanel })))
: null;

export function App() {
const { disconnectWallet, setCurrentAddress, currentAddress, error: walletError, isLoading: walletLoading } = useWallet();
Expand Down Expand Up @@ -137,6 +145,14 @@ export function App() {

{/* Transaction Progress Toasts (embedded wallet only) */}
<TxNotificationCenter account={currentAddress?.toString()} />

{/* Performance profiling panel — dev only (zone.js async-context tracking
requires transpiled async/await which we enable only in dev mode). */}
{ProfilePanel && (
<Suspense fallback={null}>
<ProfilePanel />
</Suspense>
)}
</ThemeProvider>
);
}
Loading
Loading