[number]) => {
const key = `${nameKey || item.dataKey || 'value'}`;
const itemConfig = getPayloadConfigFromPayload(config, item, key);
diff --git a/apps/lunarswap-ui/components/ui/label.tsx b/apps/lunarswap-ui/components/ui/label.tsx
index 3d5140b1..95754581 100644
--- a/apps/lunarswap-ui/components/ui/label.tsx
+++ b/apps/lunarswap-ui/components/ui/label.tsx
@@ -1,7 +1,7 @@
'use client';
import * as LabelPrimitive from '@radix-ui/react-label';
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';
import { cn } from '@/lib/utils';
diff --git a/apps/lunarswap-ui/components/ui/sheet.tsx b/apps/lunarswap-ui/components/ui/sheet.tsx
index cf9a5b26..3386b723 100644
--- a/apps/lunarswap-ui/components/ui/sheet.tsx
+++ b/apps/lunarswap-ui/components/ui/sheet.tsx
@@ -1,7 +1,7 @@
'use client';
import * as SheetPrimitive from '@radix-ui/react-dialog';
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
import { X } from 'lucide-react';
import * as React from 'react';
diff --git a/apps/lunarswap-ui/components/ui/sidebar.tsx b/apps/lunarswap-ui/components/ui/sidebar.tsx
index fddb6a1a..6fd8b4ce 100644
--- a/apps/lunarswap-ui/components/ui/sidebar.tsx
+++ b/apps/lunarswap-ui/components/ui/sidebar.tsx
@@ -1,7 +1,7 @@
'use client';
import { Slot } from '@radix-ui/react-slot';
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
import { PanelLeft } from 'lucide-react';
import * as React from 'react';
@@ -84,6 +84,7 @@ const SidebarProvider = React.forwardRef<
}
// This sets the cookie to keep the sidebar state.
+ // biome-ignore lint/suspicious/noDocumentCookie: shadcn/ui sidebar persistence pattern
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
},
[setOpenProp, open],
diff --git a/apps/lunarswap-ui/components/ui/toast.tsx b/apps/lunarswap-ui/components/ui/toast.tsx
index f8d43e16..4899f0f6 100644
--- a/apps/lunarswap-ui/components/ui/toast.tsx
+++ b/apps/lunarswap-ui/components/ui/toast.tsx
@@ -1,7 +1,7 @@
'use client';
import * as ToastPrimitives from '@radix-ui/react-toast';
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
import { X } from 'lucide-react';
import * as React from 'react';
diff --git a/apps/lunarswap-ui/components/ui/toggle.tsx b/apps/lunarswap-ui/components/ui/toggle.tsx
index c9a6d9ad..59b6d8be 100644
--- a/apps/lunarswap-ui/components/ui/toggle.tsx
+++ b/apps/lunarswap-ui/components/ui/toggle.tsx
@@ -1,7 +1,7 @@
'use client';
import * as TogglePrimitive from '@radix-ui/react-toggle';
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';
import { cn } from '@/lib/utils';
diff --git a/apps/lunarswap-ui/components/version-switcher.tsx b/apps/lunarswap-ui/components/version-switcher.tsx
index 95d9cf42..5951018c 100644
--- a/apps/lunarswap-ui/components/version-switcher.tsx
+++ b/apps/lunarswap-ui/components/version-switcher.tsx
@@ -1,5 +1,6 @@
'use client';
+import { Check, ChevronsUpDown, ExternalLink } from 'lucide-react';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
@@ -10,7 +11,6 @@ import {
} from '@/components/ui/dropdown-menu';
import { cn } from '@/lib/utils';
import { useVersion } from '@/lib/version-context';
-import { Check, ChevronsUpDown, ExternalLink } from 'lucide-react';
export function VersionSwitcher() {
const { version, setVersion } = useVersion();
diff --git a/apps/lunarswap-ui/components/wallet-connect.tsx b/apps/lunarswap-ui/components/wallet-connect.tsx
index 54991c1f..ad5e2f60 100644
--- a/apps/lunarswap-ui/components/wallet-connect.tsx
+++ b/apps/lunarswap-ui/components/wallet-connect.tsx
@@ -1,11 +1,11 @@
'use client';
+import { useEffect, useState } from 'react';
+import { toast } from 'sonner';
import { Button } from '@/components/ui/button';
import { useWallet } from '@/hooks/use-wallet';
import { cn } from '@/lib/utils';
import { connectToWallet, disconnectWallet } from '@/lib/wallet-utils';
-import { useEffect, useState } from 'react';
-import { toast } from 'sonner';
import { AccountPanel } from './account-panel';
import { Identicon } from './identicon';
diff --git a/apps/lunarswap-ui/hooks/use-network.ts b/apps/lunarswap-ui/hooks/use-network.ts
index 15683a96..2a6afc2b 100644
--- a/apps/lunarswap-ui/hooks/use-network.ts
+++ b/apps/lunarswap-ui/hooks/use-network.ts
@@ -1,5 +1,5 @@
-import { NetworkContext, type NetworkContextType } from '@/lib/network-context';
import { useContext } from 'react';
+import { NetworkContext, type NetworkContextType } from '@/lib/network-context';
/**
* Retrieves the currently in-scope network provider.
diff --git a/apps/lunarswap-ui/hooks/use-wallet.ts b/apps/lunarswap-ui/hooks/use-wallet.ts
index cdea91d3..2305cefd 100644
--- a/apps/lunarswap-ui/hooks/use-wallet.ts
+++ b/apps/lunarswap-ui/hooks/use-wallet.ts
@@ -1,5 +1,5 @@
-import { WalletContext, type WalletContextType } from '@/lib/wallet-context';
import { useContext } from 'react';
+import { WalletContext, type WalletContextType } from '@/lib/wallet-context';
/**
* Retrieves the currently in-scope wallet provider.
diff --git a/apps/lunarswap-ui/lib/network-context.tsx b/apps/lunarswap-ui/lib/network-context.tsx
index 6023cd65..a7e939b3 100644
--- a/apps/lunarswap-ui/lib/network-context.tsx
+++ b/apps/lunarswap-ui/lib/network-context.tsx
@@ -1,15 +1,15 @@
'use client';
-import { useWallet } from '@/hooks/use-wallet';
import {
- type PropsWithChildren,
createContext,
+ type PropsWithChildren,
useCallback,
useEffect,
useMemo,
useState,
} from 'react';
-import { type Network, detectWalletNetwork } from './wallet-utils';
+import { useWallet } from '@/hooks/use-wallet';
+import { detectWalletNetwork, type Network } from './wallet-utils';
export type NetworkContextType = {
currentNetwork: Network;
diff --git a/apps/lunarswap-ui/lib/version-context.tsx b/apps/lunarswap-ui/lib/version-context.tsx
index 36fe24da..a987bc91 100644
--- a/apps/lunarswap-ui/lib/version-context.tsx
+++ b/apps/lunarswap-ui/lib/version-context.tsx
@@ -1,8 +1,8 @@
'use client';
import {
- type ReactNode,
createContext,
+ type ReactNode,
useContext,
useMemo,
useState,
diff --git a/apps/lunarswap-ui/lib/wallet-context.tsx b/apps/lunarswap-ui/lib/wallet-context.tsx
index 6bb7a052..4cf38c2a 100644
--- a/apps/lunarswap-ui/lib/wallet-context.tsx
+++ b/apps/lunarswap-ui/lib/wallet-context.tsx
@@ -5,8 +5,8 @@ import type {
DAppConnectorWalletState,
} from '@midnight-ntwrk/dapp-connector-api';
import {
- type PropsWithChildren,
createContext,
+ type PropsWithChildren,
useCallback,
useEffect,
useMemo,
diff --git a/apps/lunarswap-ui/next.config.mjs b/apps/lunarswap-ui/next.config.mjs
index fa0f9be9..8c5325fc 100644
--- a/apps/lunarswap-ui/next.config.mjs
+++ b/apps/lunarswap-ui/next.config.mjs
@@ -1,4 +1,4 @@
-let userConfig = undefined;
+let userConfig;
try {
userConfig = await import('./v0-user-next.config');
} catch {}
diff --git a/apps/lunarswap-ui/package.json b/apps/lunarswap-ui/package.json
index 7bb04a3a..60dc779d 100644
--- a/apps/lunarswap-ui/package.json
+++ b/apps/lunarswap-ui/package.json
@@ -5,10 +5,12 @@
"scripts": {
"dev": "next dev",
"build": "next build",
+ "build:fast": "next build",
"start": "next start",
- "fmt": "biome format --write",
- "lint": "biome lint",
- "lint:fix": "biome check --write",
+ "types": "tsc --noEmit",
+ "lint": "biome check .",
+ "lint:fix": "biome check . --write",
+ "lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"githook:precommit": "lint-staged && pnpm run types"
},
"dependencies": {
diff --git a/contracts/access/biome.json b/contracts/access/biome.json
index fb02e8e1..84b333d2 100644
--- a/contracts/access/biome.json
+++ b/contracts/access/biome.json
@@ -1,4 +1,3 @@
{
- "root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/contracts/access/package.json b/contracts/access/package.json
index d2da1281..a8259b3c 100644
--- a/contracts/access/package.json
+++ b/contracts/access/package.json
@@ -8,14 +8,16 @@
"types": "dist/index.d.ts",
"scripts": {
"compact": "pnpm exec compact-compiler",
- "compact:show": "pnpm exec compact-compiler --show-circuits",
"compact:fast": "pnpm exec compact-compiler --skip-zk",
+ "compact:fmt": "compact format --check",
+ "compact:fmt:fix": "compact format --write",
"build": "pnpm exec compact-builder && tsc",
+ "build:fast": "pnpm exec compact-builder --skip-zk && tsc",
"test": "vitest run --printConsoleTrace",
"types": "tsc -p tsconfig.json --noEmit",
- "fmt": "biome format --write",
- "lint": "biome lint",
- "lint:fix": "biome check --write",
+ "lint": "biome check .",
+ "lint:fix": "biome check . --write",
+ "lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"precommit": "lint-staged --no-stash && pnpm run types"
},
"keywords": [],
diff --git a/contracts/access/src/index.ts b/contracts/access/src/index.ts
index 14421f90..d4db43a0 100644
--- a/contracts/access/src/index.ts
+++ b/contracts/access/src/index.ts
@@ -4,19 +4,15 @@
* @remarks This module serves as the primary export point for TypeScript consumers of the AccessControl contract.
*/
+export type {
+ AccessControlLedger,
+ AccessControlRole,
+} from './types/ledger';
+export type { RoleValue } from './types/role';
+export type { IContractSimulator } from './types/test';
// biome-ignore lint/performance/noBarrelFile: entrypoint module
export {
AccessContractPrivateState,
AccessControlWitnesses,
} from './witnesses/AccessControlWitnesses';
-
export type { IAccessControlWitnesses } from './witnesses/interface';
-
-export type {
- AccessControlRole,
- AccessControlLedger,
-} from './types/ledger';
-
-export type { RoleValue } from './types/role';
-
-export type { IContractSimulator } from './types/test';
diff --git a/contracts/access/src/test/AccessControlSimulator.ts b/contracts/access/src/test/AccessControlSimulator.ts
index 6f0bb866..b3623f85 100644
--- a/contracts/access/src/test/AccessControlSimulator.ts
+++ b/contracts/access/src/test/AccessControlSimulator.ts
@@ -2,19 +2,19 @@ import {
type CircuitContext,
type CoinPublicKey,
type ContractState,
- QueryContext,
constructorContext,
emptyZswapLocalState,
encodeCoinPublicKey,
+ QueryContext,
} from '@midnight-ntwrk/compact-runtime';
import { sampleContractAddress } from '@midnight-ntwrk/zswap';
import type { ZswapCoinPublicKey } from '@openzeppelin/midnight-apps-compact-std';
import {
type Ledger,
- Contract as MockAccessControl,
ledger,
-} from '../artifacts/AccessControl.mock/contract/index.cjs';
-import type { AccessControl_Role } from '../artifacts/Index/contract/index.cjs';
+ Contract as MockAccessControl,
+} from '../../artifacts/AccessControl.mock/contract/index.cjs';
+import type { AccessControl_Role } from '../../artifacts/Index/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import {
AccessContractPrivateState,
diff --git a/contracts/access/src/test/accessControl.test.ts b/contracts/access/src/test/accessControl.test.ts
index ddcf10ad..de005090 100644
--- a/contracts/access/src/test/accessControl.test.ts
+++ b/contracts/access/src/test/accessControl.test.ts
@@ -4,7 +4,7 @@ import {
} from '@midnight-ntwrk/compact-runtime';
import { sampleCoinPublicKey } from '@midnight-ntwrk/zswap';
import { beforeEach, describe, expect, test } from 'vitest';
-import { pureCircuits } from '../artifacts/AccessControl.mock/contract/index.cjs';
+import { pureCircuits } from '../../artifacts/AccessControl.mock/contract/index.cjs';
import { AccessControlRole } from '../types/ledger';
import type { RoleValue } from '../types/role';
import { AccessControlSimulator } from './AccessControlSimulator';
@@ -140,27 +140,24 @@ describe('AccessControl', () => {
).toThrowError('AccessControl: Role commitments tree is full!');
}, 60000); // 60s timeout
- test.concurrent(
- 'should handle concurrent grants to unique users',
- async () => {
- const user1 = sampleCoinPublicKey();
- const user2 = sampleCoinPublicKey();
- await Promise.all([
- mockAccessControlContract.grantRole(
- { bytes: encodeCoinPublicKey(user1) },
- AccessControlRole.Lp,
- admin,
- ),
- mockAccessControlContract.grantRole(
- { bytes: encodeCoinPublicKey(user2) },
- AccessControlRole.Trader,
- admin,
- ),
- ]);
- const privateState = mockAccessControlContract.getCurrentPrivateState();
- expect(Object.keys(privateState.roles).length).toBe(3); // Admin + 2 new roles
- },
- );
+ test.concurrent('should handle concurrent grants to unique users', async () => {
+ const user1 = sampleCoinPublicKey();
+ const user2 = sampleCoinPublicKey();
+ await Promise.all([
+ mockAccessControlContract.grantRole(
+ { bytes: encodeCoinPublicKey(user1) },
+ AccessControlRole.Lp,
+ admin,
+ ),
+ mockAccessControlContract.grantRole(
+ { bytes: encodeCoinPublicKey(user2) },
+ AccessControlRole.Trader,
+ admin,
+ ),
+ ]);
+ const privateState = mockAccessControlContract.getCurrentPrivateState();
+ expect(Object.keys(privateState.roles).length).toBe(3); // Admin + 2 new roles
+ });
test('should grant None role', () => {
const user = sampleCoinPublicKey();
diff --git a/contracts/access/src/types/ledger.ts b/contracts/access/src/types/ledger.ts
index 912301e8..81c7d5a6 100644
--- a/contracts/access/src/types/ledger.ts
+++ b/contracts/access/src/types/ledger.ts
@@ -12,4 +12,4 @@
export {
AccessControl_Role as AccessControlRole,
Ledger as AccessControlLedger,
-} from '../artifacts/Index/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
diff --git a/contracts/access/src/utils/test.ts b/contracts/access/src/utils/test.ts
index 60b35ce8..b963ff3d 100644
--- a/contracts/access/src/utils/test.ts
+++ b/contracts/access/src/utils/test.ts
@@ -3,9 +3,9 @@ import {
type CoinPublicKey,
type ContractAddress,
type ContractState,
+ emptyZswapLocalState,
type MerkleTreePath,
QueryContext,
- emptyZswapLocalState,
} from '@midnight-ntwrk/compact-runtime';
import type { IContractSimulator } from '../types/test';
diff --git a/contracts/access/src/witnesses/AccessControlWitnesses.ts b/contracts/access/src/witnesses/AccessControlWitnesses.ts
index b8707a5a..6b431016 100644
--- a/contracts/access/src/witnesses/AccessControlWitnesses.ts
+++ b/contracts/access/src/witnesses/AccessControlWitnesses.ts
@@ -8,7 +8,7 @@ import type {
import {
AccessControl_Role,
type Ledger,
-} from '../artifacts/Index/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
import type { RoleValue } from '../types/role';
import { maybeFromNullable } from '../utils/compactHelper';
import { emptyMerkleTreePath } from '../utils/test';
diff --git a/contracts/access/src/witnesses/interface.ts b/contracts/access/src/witnesses/interface.ts
index a313e000..39906388 100644
--- a/contracts/access/src/witnesses/interface.ts
+++ b/contracts/access/src/witnesses/interface.ts
@@ -6,7 +6,7 @@ import type {
import type {
AccessControl_Role,
Ledger,
-} from '../artifacts/Index/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
/**
* @description Interface defining the witness methods for access control operations.
diff --git a/contracts/compact-std/biome.json b/contracts/compact-std/biome.json
index fb02e8e1..84b333d2 100644
--- a/contracts/compact-std/biome.json
+++ b/contracts/compact-std/biome.json
@@ -1,4 +1,3 @@
{
- "root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/contracts/compact-std/package.json b/contracts/compact-std/package.json
index a702a38a..de75d17a 100644
--- a/contracts/compact-std/package.json
+++ b/contracts/compact-std/package.json
@@ -13,14 +13,16 @@
"scripts": {
"prepare": "pnpm compact:fast",
"compact": "pnpm exec compact-compiler",
- "compact:show": "pnpm exec compact-compiler --show-circuits",
"compact:fast": "pnpm exec compact-compiler --skip-zk",
+ "compact:fmt": "compact format --check",
+ "compact:fmt:fix": "compact format --write",
"build": "pnpm exec compact-builder && tsc",
+ "build:fast": "pnpm exec compact-builder --skip-zk && tsc",
"test": "vitest run --printConsoleTrace",
"types": "tsc -p tsconfig.json --noEmit",
- "fmt": "biome format --write",
- "lint": "biome lint",
- "lint:fix": "biome check --write",
+ "lint": "biome check .",
+ "lint:fix": "biome check . --write",
+ "lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"precommit": "lint-staged && pnpm run types"
},
"keywords": [],
@@ -39,4 +41,4 @@
"@midnight-ntwrk/midnight-js-network-id": "^2.0.1",
"@midnight-ntwrk/zswap": "^4.0.0"
}
-}
\ No newline at end of file
+}
diff --git a/contracts/compact-std/src/index.ts b/contracts/compact-std/src/index.ts
index 94fe5248..fb3f71fa 100644
--- a/contracts/compact-std/src/index.ts
+++ b/contracts/compact-std/src/index.ts
@@ -4,15 +4,15 @@
* Excludes standard runtime types from @midnight-ntwrk/compact-runtime.
*/
export type {
- Maybe,
- Either,
+ CoinInfo,
+ ContractAddress,
CurvePoint,
+ Either,
+ Maybe,
MerkleTreeDigest,
- MerkleTreePathEntry,
MerkleTreePath,
- ContractAddress,
- CoinInfo,
+ MerkleTreePathEntry,
QualifiedCoinInfo,
- ZswapCoinPublicKey,
SendResult,
-} from './artifacts/Index/contract/index.cjs';
+ ZswapCoinPublicKey,
+} from '../artifacts/Index/contract/index.cjs';
diff --git a/contracts/math/README.md b/contracts/math/README.md
index e72ae293..0008d7f9 100644
--- a/contracts/math/README.md
+++ b/contracts/math/README.md
@@ -253,8 +253,11 @@ pnpm test
# Type checking
pnpm types
-# Format code
-pnpm fmt
+# Check formatting and linting
+pnpm lint
+
+# Fix formatting and linting
+pnpm lint:fix
# Lint code
pnpm lint
diff --git a/contracts/math/biome.json b/contracts/math/biome.json
index fb02e8e1..84b333d2 100644
--- a/contracts/math/biome.json
+++ b/contracts/math/biome.json
@@ -1,4 +1,3 @@
{
- "root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/contracts/math/package.json b/contracts/math/package.json
index e27ea572..aedd91ac 100644
--- a/contracts/math/package.json
+++ b/contracts/math/package.json
@@ -6,17 +6,18 @@
"type": "module",
"scripts": {
"compact": "pnpm exec compact-compiler",
- "compact:show": "pnpm exec compact-compiler --show-circuits",
"compact:fast": "pnpm exec compact-compiler --skip-zk",
+ "compact:fmt": "compact format --check",
+ "compact:fmt:fix": "compact format --write",
"build": "pnpm exec compact-builder && tsc",
+ "build:fast": "pnpm exec compact-builder --skip-zk && tsc",
"test": "vitest run --printConsoleTrace",
"test:watch": "vitest watch",
"test:ui": "vitest --ui",
"types": "tsc -p tsconfig.json --noEmit",
- "fmt": "biome format --write",
- "fmt:check": "biome format --check",
- "lint": "biome lint",
- "lint:fix": "biome check --write",
+ "lint": "biome check .",
+ "lint:fix": "biome check . --write",
+ "lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"precommit": "lint-staged --no-stash && pnpm run types",
"clean": "rm -rf dist .compact-build"
},
diff --git a/contracts/math/src/index.ts b/contracts/math/src/index.ts
index c5b52c2f..215a053b 100644
--- a/contracts/math/src/index.ts
+++ b/contracts/math/src/index.ts
@@ -2,8 +2,22 @@
* @module @openzeppelin/midnight-apps-math-contract
* @description Main entry point for the Math contract package, exporting private state utilities, witness implementations, and type definitions.
*/
-
-// biome-ignore lint/performance/noBarrelFile: entrypoint module
+export type { EmptyState } from './types/state';
+export type { IContractSimulator } from './types/test';
+// biome-ignore lint/performance/noBarrelFile: entrypoint barrel is intentional
+export { sqrtBigint } from './utils/sqrtBigint';
+export {
+ type Bytes32PrivateState,
+ Bytes32Witnesses,
+} from './witnesses/Bytes32';
+export {
+ type Field254PrivateState,
+ Field254Witnesses,
+} from './witnesses/Field254';
+export {
+ type MaxPrivateState,
+ MaxWitnesses,
+} from './witnesses/Max';
export {
type Uint64PrivateState,
Uint64Witnesses,
@@ -16,18 +30,3 @@ export {
type Uint256PrivateState,
Uint256Witnesses,
} from './witnesses/Uint256';
-export {
- type Field254PrivateState,
- Field254Witnesses,
-} from './witnesses/Field254';
-export {
- type Bytes32PrivateState,
- Bytes32Witnesses,
-} from './witnesses/Bytes32';
-export {
- type MaxPrivateState,
- MaxWitnesses,
-} from './witnesses/Max';
-export { sqrtBigint } from './utils/sqrtBigint';
-export type { IContractSimulator } from './types/test';
-export type { EmptyState } from './types/state';
diff --git a/contracts/math/src/test/Bytes32.test.ts b/contracts/math/src/test/Bytes32.test.ts
index c1e5a5ce..4b12462d 100644
--- a/contracts/math/src/test/Bytes32.test.ts
+++ b/contracts/math/src/test/Bytes32.test.ts
@@ -357,19 +357,24 @@ describe('Bytes32', () => {
},
];
- test.each(createOverflowTestCases())(
- 'should return $expected when comparing $name',
- ({ a, b, expected }) => {
- expect(bytes32Simulator.eq(a, b)).toBe(expected);
- },
- );
-
- test.each(createSelfComparisonTestCases())(
- 'should return $expected when comparing $name',
- ({ value, expected }) => {
- expect(bytes32Simulator.eq(value, value)).toBe(expected);
- },
- );
+ test.each(
+ createOverflowTestCases(),
+ )('should return $expected when comparing $name', ({
+ a,
+ b,
+ expected,
+ }) => {
+ expect(bytes32Simulator.eq(a, b)).toBe(expected);
+ });
+
+ test.each(
+ createSelfComparisonTestCases(),
+ )('should return $expected when comparing $name', ({
+ value,
+ expected,
+ }) => {
+ expect(bytes32Simulator.eq(value, value)).toBe(expected);
+ });
});
});
@@ -448,18 +453,21 @@ describe('Bytes32', () => {
},
];
- test.each(createLtTestCases())(
- 'should handle $name',
- ({ a, b, expected, shouldThrow, errorMessage }) => {
- if (shouldThrow) {
- expect(() => bytes32Simulator.lt(a, b)).toThrow(errorMessage);
- } else {
- expect(() => bytes32Simulator.lt(a, b)).not.toThrow();
- expect(bytes32Simulator.lt(a, b)).toBe(expected);
- expect(typeof bytes32Simulator.lt(a, b)).toBe('boolean');
- }
- },
- );
+ test.each(createLtTestCases())('should handle $name', ({
+ a,
+ b,
+ expected,
+ shouldThrow,
+ errorMessage,
+ }) => {
+ if (shouldThrow) {
+ expect(() => bytes32Simulator.lt(a, b)).toThrow(errorMessage);
+ } else {
+ expect(() => bytes32Simulator.lt(a, b)).not.toThrow();
+ expect(bytes32Simulator.lt(a, b)).toBe(expected);
+ expect(typeof bytes32Simulator.lt(a, b)).toBe('boolean');
+ }
+ });
});
});
diff --git a/contracts/math/src/test/Bytes32Simulator.ts b/contracts/math/src/test/Bytes32Simulator.ts
index 8fafd870..69db632e 100644
--- a/contracts/math/src/test/Bytes32Simulator.ts
+++ b/contracts/math/src/test/Bytes32Simulator.ts
@@ -1,9 +1,9 @@
import {
type CircuitContext,
type ContractState,
+ constructorContext,
QueryContext,
type WitnessContext,
- constructorContext,
} from '@midnight-ntwrk/compact-runtime';
import {
sampleCoinPublicKey,
@@ -13,7 +13,7 @@ import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/Bytes32.mock/contract/index.cjs';
+} from '../../artifacts/Bytes32.mock/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import { Bytes32PrivateState, Bytes32Witnesses } from '../witnesses/Bytes32';
diff --git a/contracts/math/src/test/Field254Simulator.ts b/contracts/math/src/test/Field254Simulator.ts
index 164e0596..d14208a6 100644
--- a/contracts/math/src/test/Field254Simulator.ts
+++ b/contracts/math/src/test/Field254Simulator.ts
@@ -1,9 +1,9 @@
import {
type CircuitContext,
type ContractState,
+ constructorContext,
QueryContext,
type WitnessContext,
- constructorContext,
} from '@midnight-ntwrk/compact-runtime';
import {
sampleCoinPublicKey,
@@ -13,11 +13,11 @@ import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/Field254.mock/contract/index.cjs';
+} from '../../artifacts/Field254.mock/contract/index.cjs';
import type {
DivResultU256,
U256,
-} from '../artifacts/Index/contract/index.d.cts';
+} from '../../artifacts/Index/contract/index.d.cts';
import type { IContractSimulator } from '../types/test';
import { Field254PrivateState, Field254Witnesses } from '../witnesses/Field254';
diff --git a/contracts/math/src/test/MaxSimulator.ts b/contracts/math/src/test/MaxSimulator.ts
index 310f5ddb..331c0c4b 100644
--- a/contracts/math/src/test/MaxSimulator.ts
+++ b/contracts/math/src/test/MaxSimulator.ts
@@ -1,16 +1,16 @@
import {
type CircuitContext,
type ContractState,
- QueryContext,
constructorContext,
+ QueryContext,
} from '@midnight-ntwrk/compact-runtime';
import { sampleContractAddress } from '@midnight-ntwrk/zswap';
-import type { U128, U256 } from '../artifacts/Index/contract/index.d.cts';
+import type { U128, U256 } from '../../artifacts/Index/contract/index.d.cts';
import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/Max.mock/contract/index.cjs';
+} from '../../artifacts/Max.mock/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import { type MaxPrivateState, MaxWitnesses } from '../witnesses/Max';
diff --git a/contracts/math/src/test/Uint128.test.ts b/contracts/math/src/test/Uint128.test.ts
index deae83a8..9715ec08 100644
--- a/contracts/math/src/test/Uint128.test.ts
+++ b/contracts/math/src/test/Uint128.test.ts
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, test } from 'vitest';
-import type { U128, U256 } from '../artifacts/Index/contract/index.d.cts';
+import type { U128, U256 } from '../../artifacts/Index/contract/index.d.cts';
import {
MAX_UINT8,
MAX_UINT16,
@@ -7,7 +7,7 @@ import {
MAX_UINT64,
MAX_UINT128,
} from '../utils/consts';
-import { Uint128Simulator, createMaliciousSimulator } from './Uint128Simulator';
+import { createMaliciousSimulator, Uint128Simulator } from './Uint128Simulator';
let uint128Simulator: Uint128Simulator;
diff --git a/contracts/math/src/test/Uint128Simulator.ts b/contracts/math/src/test/Uint128Simulator.ts
index 7c2dbdb2..f4a999ce 100644
--- a/contracts/math/src/test/Uint128Simulator.ts
+++ b/contracts/math/src/test/Uint128Simulator.ts
@@ -1,9 +1,9 @@
import {
type CircuitContext,
type ContractState,
+ constructorContext,
QueryContext,
type WitnessContext,
- constructorContext,
} from '@midnight-ntwrk/compact-runtime';
import {
sampleCoinPublicKey,
@@ -13,12 +13,12 @@ import type {
DivResultU128,
U128,
U256,
-} from '../artifacts/Index/contract/index.d.cts';
+} from '../../artifacts/Index/contract/index.d.cts';
import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/Uint128.mock/contract/index.cjs';
+} from '../../artifacts/Uint128.mock/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import { Uint128PrivateState, Uint128Witnesses } from '../witnesses/Uint128';
diff --git a/contracts/math/src/test/Uint256.test.ts b/contracts/math/src/test/Uint256.test.ts
index be076738..b8a557f8 100644
--- a/contracts/math/src/test/Uint256.test.ts
+++ b/contracts/math/src/test/Uint256.test.ts
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, test } from 'vitest';
-import type { U256 } from '../artifacts/Index/contract/index.d.cts';
+import type { U256 } from '../../artifacts/Index/contract/index.d.cts';
import {
MAX_UINT8,
MAX_UINT16,
@@ -8,7 +8,7 @@ import {
MAX_UINT128,
MAX_UINT256,
} from '../utils/consts';
-import { Uint256Simulator, createMaliciousSimulator } from './Uint256Simulator';
+import { createMaliciousSimulator, Uint256Simulator } from './Uint256Simulator';
let uint256Simulator: Uint256Simulator;
diff --git a/contracts/math/src/test/Uint256Simulator.ts b/contracts/math/src/test/Uint256Simulator.ts
index cf9d4121..2b49fa32 100644
--- a/contracts/math/src/test/Uint256Simulator.ts
+++ b/contracts/math/src/test/Uint256Simulator.ts
@@ -1,9 +1,9 @@
import {
type CircuitContext,
type ContractState,
+ constructorContext,
QueryContext,
type WitnessContext,
- constructorContext,
} from '@midnight-ntwrk/compact-runtime';
import {
sampleCoinPublicKey,
@@ -13,12 +13,12 @@ import type {
DivResultU128,
DivResultU256,
U256,
-} from '../artifacts/Index/contract/index.d.cts';
+} from '../../artifacts/Index/contract/index.d.cts';
import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/Uint256.mock/contract/index.cjs';
+} from '../../artifacts/Uint256.mock/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import { Uint256PrivateState, Uint256Witnesses } from '../witnesses/Uint256';
diff --git a/contracts/math/src/test/Uint64.test.ts b/contracts/math/src/test/Uint64.test.ts
index 42c54247..0ebf3e56 100644
--- a/contracts/math/src/test/Uint64.test.ts
+++ b/contracts/math/src/test/Uint64.test.ts
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, test } from 'vitest';
import { MAX_UINT32, MAX_UINT64 } from '../utils/consts';
-import { Uint64Simulator, createMaliciousSimulator } from './Uint64Simulator';
+import { createMaliciousSimulator, Uint64Simulator } from './Uint64Simulator';
let uint64Simulator: Uint64Simulator;
diff --git a/contracts/math/src/test/Uint64Simulator.ts b/contracts/math/src/test/Uint64Simulator.ts
index 90f4d7e4..8de51ac5 100644
--- a/contracts/math/src/test/Uint64Simulator.ts
+++ b/contracts/math/src/test/Uint64Simulator.ts
@@ -1,20 +1,20 @@
import {
type CircuitContext,
type ContractState,
+ constructorContext,
QueryContext,
type WitnessContext,
- constructorContext,
} from '@midnight-ntwrk/compact-runtime';
import {
sampleCoinPublicKey,
sampleContractAddress,
} from '@midnight-ntwrk/zswap';
-import type { DivResultU64 } from '../artifacts/Index/contract/index.cjs';
+import type { DivResultU64 } from '../../artifacts/Index/contract/index.cjs';
import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/Uint64.mock/contract/index.cjs';
+} from '../../artifacts/Uint64.mock/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import { Uint64PrivateState, Uint64Witnesses } from '../witnesses/Uint64';
diff --git a/contracts/math/src/utils/u256.ts b/contracts/math/src/utils/u256.ts
index 5f42d3be..8c632114 100644
--- a/contracts/math/src/utils/u256.ts
+++ b/contracts/math/src/utils/u256.ts
@@ -1,4 +1,4 @@
-import type { U256 } from '../artifacts/Index/contract/index.d.cts';
+import type { U256 } from '../../artifacts/Index/contract/index.d.cts';
import { MAX_UINT64 } from './consts';
/**
diff --git a/contracts/math/src/witnesses/Bytes32.ts b/contracts/math/src/witnesses/Bytes32.ts
index 95b59d85..7c6981ea 100644
--- a/contracts/math/src/witnesses/Bytes32.ts
+++ b/contracts/math/src/witnesses/Bytes32.ts
@@ -1,9 +1,9 @@
import type { WitnessContext } from '@midnight-ntwrk/compact-runtime';
-import type { Ledger } from '../artifacts/Bytes32/contract/index.d.cts';
+import type { Ledger } from '../../artifacts/Bytes32/contract/index.d.cts';
import type {
DivResultU128,
U256,
-} from '../artifacts/Index/contract/index.d.cts';
+} from '../../artifacts/Index/contract/index.d.cts';
import type { EmptyState } from '../types/state';
/**
diff --git a/contracts/math/src/witnesses/Field254.ts b/contracts/math/src/witnesses/Field254.ts
index dd24f733..81864ad2 100644
--- a/contracts/math/src/witnesses/Field254.ts
+++ b/contracts/math/src/witnesses/Field254.ts
@@ -1,10 +1,10 @@
import type { WitnessContext } from '@midnight-ntwrk/compact-runtime';
-import type { Ledger } from '../artifacts/Field254/contract/index.cjs';
+import type { Ledger } from '../../artifacts/Field254/contract/index.cjs';
import type {
DivResultU128,
DivResultU256,
U256,
-} from '../artifacts/Index/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
import type { EmptyState } from '../types/state';
import { sqrtBigint } from '../utils/sqrtBigint';
diff --git a/contracts/math/src/witnesses/Uint128.ts b/contracts/math/src/witnesses/Uint128.ts
index 08eeea71..e40fa85e 100644
--- a/contracts/math/src/witnesses/Uint128.ts
+++ b/contracts/math/src/witnesses/Uint128.ts
@@ -2,8 +2,8 @@ import type { WitnessContext } from '@midnight-ntwrk/compact-runtime';
import type {
DivResultU128,
U128,
-} from '../artifacts/Index/contract/index.cjs';
-import type { Ledger } from '../artifacts/Uint128/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
+import type { Ledger } from '../../artifacts/Uint128/contract/index.cjs';
import type { EmptyState } from '../types/state';
import { sqrtBigint } from '../utils/sqrtBigint';
import type { IUint128Witnesses } from './interfaces';
diff --git a/contracts/math/src/witnesses/Uint256.ts b/contracts/math/src/witnesses/Uint256.ts
index 376e6cba..152d244a 100644
--- a/contracts/math/src/witnesses/Uint256.ts
+++ b/contracts/math/src/witnesses/Uint256.ts
@@ -4,8 +4,8 @@ import type {
DivResultU256,
U128,
U256,
-} from '../artifacts/Index/contract/index.cjs';
-import type { Ledger } from '../artifacts/Uint256/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
+import type { Ledger } from '../../artifacts/Uint256/contract/index.cjs';
import type { EmptyState } from '../types/state';
import { sqrtBigint } from '../utils/sqrtBigint';
import type { IUint256Witnesses } from './interfaces';
diff --git a/contracts/math/src/witnesses/Uint64.ts b/contracts/math/src/witnesses/Uint64.ts
index 73e3a63b..9a1b78d5 100644
--- a/contracts/math/src/witnesses/Uint64.ts
+++ b/contracts/math/src/witnesses/Uint64.ts
@@ -1,6 +1,6 @@
import type { WitnessContext } from '@midnight-ntwrk/compact-runtime';
-import type { DivResultU64 } from '../artifacts/Index/contract/index.cjs';
-import type { Ledger } from '../artifacts/Uint64/contract/index.cjs';
+import type { DivResultU64 } from '../../artifacts/Index/contract/index.cjs';
+import type { Ledger } from '../../artifacts/Uint64/contract/index.cjs';
import type { EmptyState } from '../types/state';
import { sqrtBigint } from '../utils/sqrtBigint';
import type { IUint64Witnesses } from './interfaces';
diff --git a/contracts/math/src/witnesses/interfaces.ts b/contracts/math/src/witnesses/interfaces.ts
index 26afb853..591810ac 100644
--- a/contracts/math/src/witnesses/interfaces.ts
+++ b/contracts/math/src/witnesses/interfaces.ts
@@ -6,7 +6,7 @@ import type {
Ledger,
U128,
U256,
-} from '../artifacts/Index/contract/index.cjs';
+} from '../../artifacts/Index/contract/index.cjs';
export interface IUint64Witnesses {
sqrtU64Locally(
diff --git a/contracts/shielded-token/biome.json b/contracts/shielded-token/biome.json
index 528d3e74..84b333d2 100644
--- a/contracts/shielded-token/biome.json
+++ b/contracts/shielded-token/biome.json
@@ -1,5 +1,3 @@
{
- "root": false,
- "$schema": "https://biomejs.dev/schemas/2.3.5/schema.json",
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/contracts/shielded-token/package.json b/contracts/shielded-token/package.json
index eeb5cc6a..0047b489 100644
--- a/contracts/shielded-token/package.json
+++ b/contracts/shielded-token/package.json
@@ -17,17 +17,24 @@
},
"scripts": {
"compact": "pnpm exec compact-compiler",
- "compact:show": "pnpm exec compact-compiler --show-circuits",
"compact:fast": "pnpm exec compact-compiler --skip-zk",
+ "compact:fmt": "compact format --check",
+ "compact:fmt:fix": "compact format --write",
"build": "pnpm exec compact-builder && tsc",
+ "build:fast": "pnpm exec compact-builder --skip-zk && tsc",
"test": "vitest run --printConsoleTrace",
"types": "tsc -p tsconfig.build.json --noEmit",
- "fmt": "biome format --write",
- "lint": "biome lint",
- "lint:fix": "biome check --write",
+ "lint": "biome check .",
+ "lint:fix": "biome check . --write",
+ "lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"precommit": "lint-staged --no-stash && pnpm run types"
},
- "keywords": ["midnight", "shielded", "token", "fungible"],
+ "keywords": [
+ "midnight",
+ "shielded",
+ "token",
+ "fungible"
+ ],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.4.1",
diff --git a/contracts/shielded-token/src/ShieldedFungibleToken.compact b/contracts/shielded-token/src/ShieldedFungibleToken.compact
index 91971dde..1fa10ce1 100644
--- a/contracts/shielded-token/src/ShieldedFungibleToken.compact
+++ b/contracts/shielded-token/src/ShieldedFungibleToken.compact
@@ -7,51 +7,40 @@ import CompactStandardLibrary;
import "./openzeppelin/ShieldedERC20" prefix ShieldedFungibleToken_;
-export {
- ShieldedFungibleToken__nonce,
- ShieldedFungibleToken__domain,
-};
+export { ShieldedFungibleToken__nonce, ShieldedFungibleToken__domain, };
-constructor(
- nonce_: Bytes<32>,
- name_: Opaque<"string">,
- symbol_: Opaque<"string">,
- domain_: Bytes<32>
-) {
- const decimals = 18;
- ShieldedFungibleToken_initialize(nonce_, name_, symbol_, decimals, domain_);
+constructor(nonce_: Bytes<32>,
+ name_: Opaque<"string">,
+ symbol_: Opaque<"string">,
+ domain_: Bytes<32>) {
+ const decimals = 18;
+ ShieldedFungibleToken_initialize(nonce_, name_, symbol_, decimals, domain_);
}
export circuit name(): Opaque<"string"> {
- return ShieldedFungibleToken_name();
+ return ShieldedFungibleToken_name();
}
export circuit symbol(): Opaque<"string"> {
- return ShieldedFungibleToken_symbol();
+ return ShieldedFungibleToken_symbol();
}
export circuit decimals(): Uint<8> {
- return ShieldedFungibleToken_decimals();
+ return ShieldedFungibleToken_decimals();
}
export circuit totalSupply(): Uint<128> {
- return ShieldedFungibleToken_totalSupply();
+ return ShieldedFungibleToken_totalSupply();
}
export circuit type(): Bytes<32> {
- return ShieldedFungibleToken_type();
+ return ShieldedFungibleToken_type();
}
-export circuit mint(
- recipient: Either,
- amount: Uint<64>
-): CoinInfo {
- return ShieldedFungibleToken_mint(recipient, amount);
+export circuit mint(recipient: Either, amount: Uint<64>): CoinInfo {
+ return ShieldedFungibleToken_mint(recipient, amount);
}
-export circuit burn(
- coin: CoinInfo,
- amount: Uint<128>
-): SendResult {
- return ShieldedFungibleToken_burn(coin, amount);
+export circuit burn(coin: CoinInfo, amount: Uint<128>): SendResult {
+ return ShieldedFungibleToken_burn(coin, amount);
}
diff --git a/contracts/shielded-token/src/index.ts b/contracts/shielded-token/src/index.ts
index 4d210e31..523e6c6e 100644
--- a/contracts/shielded-token/src/index.ts
+++ b/contracts/shielded-token/src/index.ts
@@ -1,21 +1,21 @@
// Export contract types and interfaces from ShieldedFungibleToken
// biome-ignore lint/performance/noBarrelFile: entrypoint module
export {
- type Witnesses,
- type ImpureCircuits,
- type PureCircuits,
type Circuits,
- type Ledger,
+ Contract,
type ContractReferenceLocations,
contractReferenceLocations,
- Contract,
+ type ImpureCircuits,
+ type Ledger,
ledger,
+ type PureCircuits,
pureCircuits,
-} from './artifacts/ShieldedFungibleToken/contract/index.cjs';
+ type Witnesses,
+} from '../artifacts/ShieldedFungibleToken/contract/index.cjs';
// Export witnesses
export {
+ type IShieldedFungibleTokenWitnesses,
ShieldedFungibleTokenPrivateState,
ShieldedFungibleTokenWitnesses,
- type IShieldedFungibleTokenWitnesses,
} from './witnesses/index.js';
diff --git a/contracts/shielded-token/src/openzeppelin/ShieldedERC20.compact b/contracts/shielded-token/src/openzeppelin/ShieldedERC20.compact
index 38bcd7fa..65876c18 100644
--- a/contracts/shielded-token/src/openzeppelin/ShieldedERC20.compact
+++ b/contracts/shielded-token/src/openzeppelin/ShieldedERC20.compact
@@ -34,7 +34,7 @@ pragma language_version >= 0.18.0;
module ShieldedERC20 { // DO NOT USE IN PRODUCTION!
import CompactStandardLibrary;
import Utils prefix Utils_;
- import "../../node_modules/@openzeppelin/midnight-apps-math/dist/Bytes32" prefix Bytes32_;
+ import "../../../math/src/Bytes32" prefix Bytes32_;
// Public state
export ledger _counter: Counter;
@@ -53,12 +53,12 @@ module ShieldedERC20 { // DO NOT USE IN PRODUCTION!
* @return {[]} - None.
*/
export circuit initialize(
- initNonce: Bytes<32>,
- name_: Opaque<"string">,
- symbol_: Opaque<"string">,
- decimals_ :Uint<8>,
- domain_: Bytes<32>
- ): [] {
+ initNonce: Bytes<32>,
+ name_: Opaque<"string">,
+ symbol_: Opaque<"string">,
+ decimals_: Uint<8>,
+ domain_: Bytes<32>
+ ): [] {
_nonce = disclose(initNonce);
_domain = disclose(domain_);
_name = disclose(name_);
@@ -123,19 +123,19 @@ module ShieldedERC20 { // DO NOT USE IN PRODUCTION!
* @param {amount} - The value of tokens minted.
* @return {CoinInfo} - The description of the newly created coin.
*/
- // TODO: if we use Uint<128> we get this compilation error:
- // no compatible function named mintToken is in scope at this call
- // one function is incompatible with the supplied argument types
- // supplied argument types:
- // (Bytes<32>, Uint<128>, Bytes<32>, struct Either>, right: struct ContractAddress>>)
- // declared argument types for function at :
- // (Bytes<32>, Uint<64>, Bytes<32>, struct Either>, right: struct ContractAddress>>)
+ // TODO: if we use Uint<128> we get this compilation error:
+ // no compatible function named mintToken is in scope at this call
+ // one function is incompatible with the supplied argument types
+ // supplied argument types:
+ // (Bytes<32>, Uint<128>, Bytes<32>, struct Either>, right: struct ContractAddress>>)
+ // declared argument types for function at :
+ // (Bytes<32>, Uint<64>, Bytes<32>, struct Either>, right: struct ContractAddress>>)
export circuit mint(recipient: Either, amount: Uint<64>): CoinInfo {
- assert (!Utils_isKeyOrAddressZero(recipient), "ShieldedToken: invalid recipient");
+ assert(!Utils_isKeyOrAddressZero(recipient), "ShieldedToken: invalid recipient");
// TODO: Is that correct here? Do we need to increment after minting? not before?
_counter.increment(1);
@@ -163,8 +163,8 @@ module ShieldedERC20 { // DO NOT USE IN PRODUCTION!
* spending the output if available.
*/
export circuit burn(coin: CoinInfo, amount: Uint<128>): SendResult {
- assert (coin.color == _type, "ShieldedToken: token not created from this contract");
- assert (coin.value >= amount, "ShieldedToken: insufficient token amount to burn");
+ assert(coin.color == _type, "ShieldedToken: token not created from this contract");
+ assert(coin.value >= amount, "ShieldedToken: insufficient token amount to burn");
receive(disclose(coin));
_totalSupply = _totalSupply - disclose(amount);
diff --git a/contracts/shielded-token/src/openzeppelin/Utils.compact b/contracts/shielded-token/src/openzeppelin/Utils.compact
index 49587d91..6dadfb04 100644
--- a/contracts/shielded-token/src/openzeppelin/Utils.compact
+++ b/contracts/shielded-token/src/openzeppelin/Utils.compact
@@ -14,9 +14,9 @@ module Utils {
*/
export pure circuit isKeyOrAddressZero(keyOrAddress: Either): Boolean {
if (keyOrAddress.is_left) {
- return keyOrAddress == eitherZeroZPK();
+ return keyOrAddress == eitherZeroZPK();
} else {
- return keyOrAddress == eitherZeroContractAddress();
+ return keyOrAddress == eitherZeroContractAddress();
}
}
@@ -26,7 +26,7 @@ module Utils {
* @return {Bytes<32>} - A 32-byte array filled with zeros.
*/
export pure circuit zeroBytes(): Bytes<32> {
- return pad(32, "");
+ return pad(32, "");
}
/**
@@ -73,7 +73,7 @@ module Utils {
*/
export pure circuit eitherZeroZPK(): Either {
return left(zeroZPK());
- }
+ }
/**
* @description Returns a zero contract address as the right variant of an Either type.
@@ -81,7 +81,7 @@ module Utils {
* @return {Either} - Zero ContractAddress as the right variant.
*/
export pure circuit eitherZeroContractAddress(): Either {
- return right(ContractAddress{ zeroBytes() });
+ return right(ContractAddress { zeroBytes() });
}
/**
diff --git a/contracts/shielded-token/src/test/ShieldedFungibleToken.test.ts b/contracts/shielded-token/src/test/ShieldedFungibleToken.test.ts
index 58c546d0..6fb39f68 100644
--- a/contracts/shielded-token/src/test/ShieldedFungibleToken.test.ts
+++ b/contracts/shielded-token/src/test/ShieldedFungibleToken.test.ts
@@ -1,7 +1,7 @@
import { encodeTokenType, tokenType } from '@midnight-ntwrk/compact-runtime';
import {
- NetworkId,
getZswapNetworkId,
+ NetworkId,
setNetworkId,
} from '@midnight-ntwrk/midnight-js-network-id';
import {
diff --git a/contracts/shielded-token/src/test/ShieldedFungibleTokenSimulator.ts b/contracts/shielded-token/src/test/ShieldedFungibleTokenSimulator.ts
index 8c352502..49bf4bb0 100644
--- a/contracts/shielded-token/src/test/ShieldedFungibleTokenSimulator.ts
+++ b/contracts/shielded-token/src/test/ShieldedFungibleTokenSimulator.ts
@@ -1,8 +1,8 @@
import {
type CircuitContext,
type ContractState,
- QueryContext,
constructorContext,
+ QueryContext,
} from '@midnight-ntwrk/compact-runtime';
import {
sampleCoinPublicKey,
@@ -18,7 +18,7 @@ import {
Contract,
type Ledger,
ledger,
-} from '../artifacts/ShieldedFungibleToken/contract/index.cjs';
+} from '../../artifacts/ShieldedFungibleToken/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import {
ShieldedFungibleTokenPrivateState,
diff --git a/contracts/shielded-token/src/types/index.ts b/contracts/shielded-token/src/types/index.ts
index 511548ad..1a107faa 100644
--- a/contracts/shielded-token/src/types/index.ts
+++ b/contracts/shielded-token/src/types/index.ts
@@ -1,2 +1,2 @@
-export type { IContractSimulator } from './test';
export type { EmptyState } from './state';
+export type { IContractSimulator } from './test';
diff --git a/contracts/shielded-token/src/witnesses/index.ts b/contracts/shielded-token/src/witnesses/index.ts
index 8d38864c..7af8b441 100644
--- a/contracts/shielded-token/src/witnesses/index.ts
+++ b/contracts/shielded-token/src/witnesses/index.ts
@@ -1,4 +1,4 @@
-import type { Ledger } from '../artifacts/ShieldedFungibleToken/contract/index.cjs';
+import type { Ledger } from '../../artifacts/ShieldedFungibleToken/contract/index.cjs';
import type { EmptyState } from '../types/state';
export type IShieldedFungibleTokenWitnesses<_L, _P> = Record;
diff --git a/contracts/structs/biome.json b/contracts/structs/biome.json
index fb02e8e1..84b333d2 100644
--- a/contracts/structs/biome.json
+++ b/contracts/structs/biome.json
@@ -1,4 +1,3 @@
{
- "root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/contracts/structs/package.json b/contracts/structs/package.json
index d76c7513..29d7833a 100644
--- a/contracts/structs/package.json
+++ b/contracts/structs/package.json
@@ -6,14 +6,16 @@
"type": "module",
"scripts": {
"compact": "pnpm exec compact-compiler",
- "compact:show": "pnpm exec compact-compiler --show-circuits",
"compact:fast": "pnpm exec compact-compiler --skip-zk",
+ "compact:fmt": "compact format --check",
+ "compact:fmt:fix": "compact format --write",
"build": "pnpm exec compact-builder && tsc",
+ "build:fast": "pnpm exec compact-builder --skip-zk && tsc",
"test": "vitest run --printConsoleTrace",
"types": "tsc -p tsconfig.json --noEmit",
- "fmt": "biome format --write",
- "lint": "biome lint",
- "lint:fix": "biome check --write",
+ "lint": "biome check .",
+ "lint:fix": "biome check . --write",
+ "lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"precommit": "lint-staged --no-stash && pnpm run types"
},
"keywords": [],
diff --git a/contracts/structs/src/test/QueueContractSimulator.ts b/contracts/structs/src/test/QueueContractSimulator.ts
index 14b17ac9..64b1a8c0 100644
--- a/contracts/structs/src/test/QueueContractSimulator.ts
+++ b/contracts/structs/src/test/QueueContractSimulator.ts
@@ -2,15 +2,15 @@ import {
type CircuitContext,
type CoinPublicKey,
type ContractState,
- QueryContext,
constructorContext,
+ QueryContext,
sampleContractAddress,
} from '@midnight-ntwrk/compact-runtime';
import {
type Ledger,
- Contract as MockQueue,
ledger,
-} from '../artifacts/Queue.mock/contract/index.cjs';
+ Contract as MockQueue,
+} from '../../artifacts/Queue.mock/contract/index.cjs';
import type { IContractSimulator } from '../types/test';
import {
QueueContractPrivateState,
diff --git a/contracts/structs/src/utils/test.ts b/contracts/structs/src/utils/test.ts
index 9359098e..5a6f4333 100644
--- a/contracts/structs/src/utils/test.ts
+++ b/contracts/structs/src/utils/test.ts
@@ -1,8 +1,8 @@
import {
type CircuitContext,
type CoinPublicKey,
- QueryContext,
emptyZswapLocalState,
+ QueryContext,
} from '@midnight-ntwrk/compact-runtime';
import type { IContractSimulator } from '../types/test';
diff --git a/package.json b/package.json
index 30e1f7e2..39a9cde4 100644
--- a/package.json
+++ b/package.json
@@ -6,25 +6,27 @@
"main": "index.js",
"scripts": {
"prepare": "is-ci || husky && pnpm --filter @openzeppelin/midnight-apps-logger run build && pnpm --filter @openzeppelin/midnight-apps-compact run build",
- "compact": "pnpm -r --workspace-concurrency=1 run compact --show-circuits",
- "compact:fast": "turbo run compact -- --skip-zk",
- "compact:version": "turbo run compact -- --version",
+ "compact": "turbo run compact",
+ "compact:fast": "turbo run compact:fast",
+ "compact:version": "compact compile --version",
"compact:language-version": "turbo run compact -- --language-version",
- "compact:fmt": "compact format",
+ "compact:fmt": "turbo run compact:fmt",
+ "compact:fmt:fix": "turbo run compact:fmt:fix",
"build": "turbo run build",
"build:contracts": "turbo run build --filter './contracts/*'",
+ "build:fast": "turbo run build:fast",
"build:apps": "turbo run build --filter './apps/*'",
"build:packages": "turbo run build --filter './packages/*'",
"test": "turbo run test",
"test:contracts": "turbo run test --filter './contracts/*'",
"test:apps": "turbo run test --filter './apps/*'",
- "fmt": "turbo run fmt && pnpm compact:fmt --verbose",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
- "types": "pnpm compact:fast && turbo run types",
- "types:apps": "pnpm compact:fast && turbo run types --filter './apps/*'",
- "types:contracts": "pnpm compact:fast && turbo run types --filter './contracts/*'",
- "types:packages": "pnpm compact:fast && turbo run types --filter './packages/*'",
+ "lint:ci": "turbo run lint:ci",
+ "types": "turbo run types",
+ "types:apps": "turbo run types --filter './apps/*'",
+ "types:contracts": "turbo run types --filter './contracts/*'",
+ "types:packages": "turbo run types --filter './packages/*'",
"precommit": "turbo run precommit"
},
"keywords": [],
@@ -32,7 +34,7 @@
"license": "MIT",
"packageManager": "pnpm@10.4.1",
"devDependencies": {
- "@biomejs/biome": "2.3.8",
+ "@biomejs/biome": "2.3.9",
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"@commitlint/types": "^19.8.1",
diff --git a/packages/biome-config/biome.json b/packages/biome-config/biome.json
index bd441c42..663c7816 100644
--- a/packages/biome-config/biome.json
+++ b/packages/biome-config/biome.json
@@ -1,5 +1,5 @@
{
- "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
+ "$schema": "https://biomejs.dev/schemas/2.3.9/schema.json",
"files": {
"includes": [
"**",
@@ -7,7 +7,10 @@
"!**/pnpm-lock.yaml",
"!**/tsconfig.base.json",
"!**/tsconfig*.json",
- "!**/*.compact"
+ "!**/*.compact",
+ "!**/artifacts/**",
+ "!**/*.css",
+ "!**/dist/**"
]
},
"formatter": {
@@ -51,7 +54,9 @@
"level": "error",
"options": {
"allow": [
- "log"
+ "log",
+ "warn",
+ "error"
]
}
}
@@ -75,6 +80,7 @@
"vcs": {
"enabled": true,
"clientKind": "git",
- "useIgnoreFile": true
+ "useIgnoreFile": false,
+ "defaultBranch": "main"
}
-}
\ No newline at end of file
+}
diff --git a/packages/compact/biome.json b/packages/compact/biome.json
index 09ca38f7..c27b1cce 100644
--- a/packages/compact/biome.json
+++ b/packages/compact/biome.json
@@ -1,4 +1,3 @@
{
- "root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/packages/compact/package.json b/packages/compact/package.json
index 2cdc320f..1164cd43 100644
--- a/packages/compact/package.json
+++ b/packages/compact/package.json
@@ -2,7 +2,10 @@
"name": "@openzeppelin/midnight-apps-compact",
"private": true,
"version": "0.0.1",
- "keywords": ["compact", "compiler"],
+ "keywords": [
+ "compact",
+ "compiler"
+ ],
"author": "",
"license": "MIT",
"description": "Compact fetcher",
@@ -17,6 +20,7 @@
},
"scripts": {
"build": "tsc -p .",
+ "build:fast": "tsc -p .",
"types": "tsc -p tsconfig.json --noEmit",
"clean": "git clean -fXd"
},
diff --git a/packages/compact/src/Builder.ts b/packages/compact/src/Builder.ts
index 3fc7c40b..823becd1 100755
--- a/packages/compact/src/Builder.ts
+++ b/packages/compact/src/Builder.ts
@@ -1,11 +1,11 @@
#!/usr/bin/env node
-import { exec } from "node:child_process";
-import { promisify } from "node:util";
-import chalk from "chalk";
-import ora, { type Ora } from "ora";
-import { CompactCompiler } from "./Compiler.js";
-import { isPromisifiedChildProcessError } from "./types/errors.js";
+import { exec } from 'node:child_process';
+import { promisify } from 'node:util';
+import chalk from 'chalk';
+import ora, { type Ora } from 'ora';
+import { CompactCompiler } from './Compiler.js';
+import { isPromisifiedChildProcessError } from './types/errors.js';
// Promisified exec for async execution
const execAsync = promisify(exec);
@@ -57,26 +57,26 @@ const execAsync = promisify(exec);
* ```
*/
export class CompactBuilder {
- private readonly compilerFlags: string;
- private readonly steps: Array<{ cmd: string; msg: string; shell?: string }> =
- [
- // Step 1: Clean dist directory
- {
- cmd: "rm -rf dist && mkdir -p dist",
- msg: "Cleaning dist directory",
- shell: "/bin/bash",
- },
+ private readonly compilerFlags: string;
+ private readonly steps: Array<{ cmd: string; msg: string; shell?: string }> =
+ [
+ // Step 1: Clean dist directory
+ {
+ cmd: 'rm -rf dist && mkdir -p dist',
+ msg: 'Cleaning dist directory',
+ shell: '/bin/bash',
+ },
- // Step 2: TypeScript compilation (witnesses/ -> dist/witnesses/)
- {
- cmd: "tsc --project tsconfig.build.json",
- msg: "Compiling TypeScript",
- },
+ // Step 2: TypeScript compilation (witnesses/ -> dist/witnesses/)
+ {
+ cmd: 'tsc --project tsconfig.build.json',
+ msg: 'Compiling TypeScript',
+ },
- // Step 3: Copy .compact files preserving structure (excludes Mock* files and archive/)
- {
- // biome-ignore-start lint/suspicious/noUselessEscapeInString: Needed inside JS template literal
- cmd: `
+ // Step 3: Copy .compact files preserving structure (excludes Mock* files and archive/)
+ {
+ // biome-ignore-start lint/suspicious/noUselessEscapeInString: Needed inside JS template literal
+ cmd: `
find src -type f -name "*.compact" ! -name "Mock*" ! -path "*/archive/*" | while read file; do
# Remove src/ prefix from path
rel_path="\${file#src/}"
@@ -84,107 +84,107 @@ export class CompactBuilder {
cp "\$file" "dist/\$rel_path"
done
`,
- // biome-ignore-end lint/suspicious/noUselessEscapeInString: Needed inside JS template literal
- msg: "Copying .compact files (excluding mocks and archive)",
- shell: "/bin/bash",
- },
+ // biome-ignore-end lint/suspicious/noUselessEscapeInString: Needed inside JS template literal
+ msg: 'Copying .compact files (excluding mocks and archive)',
+ shell: '/bin/bash',
+ },
- // Step 4: Copy essential files for distribution
- {
- cmd: `
- # Copy package.json and README
+ // Step 4: Copy essential files for distribution
+ {
+ cmd: `
+ # Copy package.json and README if they exist
cp package.json dist/ 2>/dev/null || true
- cp ../README.md dist/ # Go up one level to monorepo root
+ cp README.md dist/ 2>/dev/null || true
`,
- msg: "Copying package metadata",
- shell: "/bin/bash",
- },
- ];
+ msg: 'Copying package metadata',
+ shell: '/bin/bash',
+ },
+ ];
- /**
- * Constructs a new ProjectBuilder instance.
- * @param compilerFlags - Optional space-separated string of `compactc` flags (e.g., "--skip-zk")
- */
- constructor(compilerFlags = "") {
- this.compilerFlags = compilerFlags;
- }
+ /**
+ * Constructs a new ProjectBuilder instance.
+ * @param compilerFlags - Optional space-separated string of `compactc` flags (e.g., "--skip-zk")
+ */
+ constructor(compilerFlags = '') {
+ this.compilerFlags = compilerFlags;
+ }
- /**
- * Executes the full build process: compiles .compact files first, then runs build steps.
- * Displays progress with spinners and outputs results in color.
- *
- * @returns A promise that resolves when all steps complete successfully
- * @throws Error if compilation or any build step fails
- */
- public async build(): Promise {
- // Run compact compilation as a prerequisite
- const compiler = new CompactCompiler(this.compilerFlags);
- await compiler.compile();
+ /**
+ * Executes the full build process: compiles .compact files first, then runs build steps.
+ * Displays progress with spinners and outputs results in color.
+ *
+ * @returns A promise that resolves when all steps complete successfully
+ * @throws Error if compilation or any build step fails
+ */
+ public async build(): Promise {
+ // Run compact compilation as a prerequisite
+ const compiler = new CompactCompiler(this.compilerFlags);
+ await compiler.compile();
- // Proceed with build steps
- for (const [index, step] of this.steps.entries()) {
- await this.executeStep(step, index, this.steps.length);
- }
+ // Proceed with build steps
+ for (const [index, step] of this.steps.entries()) {
+ await this.executeStep(step, index, this.steps.length);
+ }
- console.log(chalk.green("\n✅ Build complete!"));
- }
+ console.log(chalk.green('\n✅ Build complete!'));
+ }
- /**
- * Executes a single build step.
- * Runs the command, shows a spinner, and prints output with indentation.
- *
- * @param step - The build step containing command and message
- * @param index - Current step index (0-based) for progress display
- * @param total - Total number of steps for progress display
- * @returns A promise that resolves when the step completes successfully
- * @throws Error if the step fails
- */
- private async executeStep(
- step: { cmd: string; msg: string; shell?: string },
- index: number,
- total: number,
- ): Promise {
- const stepLabel: string = `[${index + 1}/${total}]`;
- const spinner: Ora = ora(`[BUILD] ${stepLabel} ${step.msg}`).start();
+ /**
+ * Executes a single build step.
+ * Runs the command, shows a spinner, and prints output with indentation.
+ *
+ * @param step - The build step containing command and message
+ * @param index - Current step index (0-based) for progress display
+ * @param total - Total number of steps for progress display
+ * @returns A promise that resolves when the step completes successfully
+ * @throws Error if the step fails
+ */
+ private async executeStep(
+ step: { cmd: string; msg: string; shell?: string },
+ index: number,
+ total: number,
+ ): Promise {
+ const stepLabel: string = `[${index + 1}/${total}]`;
+ const spinner: Ora = ora(`[BUILD] ${stepLabel} ${step.msg}`).start();
- try {
- const { stdout, stderr }: { stdout: string; stderr: string } =
- await execAsync(step.cmd, {
- shell: step.shell, // Only pass shell where needed
- });
- spinner.succeed(`[BUILD] ${stepLabel} ${step.msg}`);
- this.printOutput(stdout, chalk.cyan);
- this.printOutput(stderr, chalk.yellow); // Show stderr (warnings) in yellow if present
- } catch (error: unknown) {
- spinner.fail(`[BUILD] ${stepLabel} ${step.msg}`);
- if (isPromisifiedChildProcessError(error)) {
- this.printOutput(error.stdout, chalk.cyan);
- this.printOutput(error.stderr, chalk.red);
- // biome-ignore lint/suspicious/noConsole: Needed to display build failure reason
- console.error(chalk.red("[BUILD] ❌ Build failed:", error.message));
- } else if (error instanceof Error) {
- // biome-ignore lint/suspicious/noConsole: Needed to display build failure reason
- console.error(chalk.red("[BUILD] ❌ Build failed:", error.message));
- }
+ try {
+ const { stdout, stderr }: { stdout: string; stderr: string } =
+ await execAsync(step.cmd, {
+ shell: step.shell, // Only pass shell where needed
+ });
+ spinner.succeed(`[BUILD] ${stepLabel} ${step.msg}`);
+ this.printOutput(stdout, chalk.cyan);
+ this.printOutput(stderr, chalk.yellow); // Show stderr (warnings) in yellow if present
+ } catch (error: unknown) {
+ spinner.fail(`[BUILD] ${stepLabel} ${step.msg}`);
+ if (isPromisifiedChildProcessError(error)) {
+ this.printOutput(error.stdout, chalk.cyan);
+ this.printOutput(error.stderr, chalk.red);
+ // biome-ignore lint/suspicious/noConsole: Needed to display build failure reason
+ console.error(chalk.red('[BUILD] ❌ Build failed:', error.message));
+ } else if (error instanceof Error) {
+ // biome-ignore lint/suspicious/noConsole: Needed to display build failure reason
+ console.error(chalk.red('[BUILD] ❌ Build failed:', error.message));
+ }
- process.exit(1);
- }
- }
+ process.exit(1);
+ }
+ }
- /**
- * Prints command output with indentation and specified color.
- * Filters out empty lines and indents each line for readability.
- *
- * @param output - The command output string to print (stdout or stderr)
- * @param colorFn - Chalk color function to style the output (e.g., `chalk.cyan` for success, `chalk.red` for errors)
- */
- private printOutput(output: string, colorFn: (text: string) => string): void {
- const lines: string[] = output
- .split("\n")
- .filter((line: string): boolean => line.trim() !== "")
- .map((line: string): string => ` ${line}`);
- if (lines.length > 0) {
- console.log(colorFn(lines.join("\n")));
- }
- }
+ /**
+ * Prints command output with indentation and specified color.
+ * Filters out empty lines and indents each line for readability.
+ *
+ * @param output - The command output string to print (stdout or stderr)
+ * @param colorFn - Chalk color function to style the output (e.g., `chalk.cyan` for success, `chalk.red` for errors)
+ */
+ private printOutput(output: string, colorFn: (text: string) => string): void {
+ const lines: string[] = output
+ .split('\n')
+ .filter((line: string): boolean => line.trim() !== '')
+ .map((line: string): string => ` ${line}`);
+ if (lines.length > 0) {
+ console.log(colorFn(lines.join('\n')));
+ }
+ }
}
diff --git a/packages/logger/biome.json b/packages/logger/biome.json
index fb02e8e1..84b333d2 100644
--- a/packages/logger/biome.json
+++ b/packages/logger/biome.json
@@ -1,4 +1,3 @@
{
- "root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
}
diff --git a/packages/logger/package.json b/packages/logger/package.json
index 051ef362..4ddbf537 100644
--- a/packages/logger/package.json
+++ b/packages/logger/package.json
@@ -20,6 +20,7 @@
},
"scripts": {
"build": "tsc -p .",
+ "build:fast": "tsc -p .",
"types": "tsc -p tsconfig.json --noEmit",
"clean": "git clean -fXd"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5074f10f..88ae62c5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -9,8 +9,8 @@ importers:
.:
devDependencies:
'@biomejs/biome':
- specifier: 2.3.8
- version: 2.3.8
+ specifier: 2.3.9
+ version: 2.3.9
'@commitlint/cli':
specifier: ^19.8.1
version: 19.8.1(@types/node@24.10.0)(typescript@5.8.3)
@@ -495,55 +495,55 @@ packages:
resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==}
engines: {node: '>=18'}
- '@biomejs/biome@2.3.8':
- resolution: {integrity: sha512-Qjsgoe6FEBxWAUzwFGFrB+1+M8y/y5kwmg5CHac+GSVOdmOIqsAiXM5QMVGZJ1eCUCLlPZtq4aFAQ0eawEUuUA==}
+ '@biomejs/biome@2.3.9':
+ resolution: {integrity: sha512-js+34KpnY65I00k8P71RH0Uh2rJk4BrpxMGM5m2nBfM9XTlKE5N1URn5ydILPRyXXq4ebhKCjsvR+txS+D4z2A==}
engines: {node: '>=14.21.3'}
hasBin: true
- '@biomejs/cli-darwin-arm64@2.3.8':
- resolution: {integrity: sha512-HM4Zg9CGQ3txTPflxD19n8MFPrmUAjaC7PQdLkugeeC0cQ+PiVrd7i09gaBS/11QKsTDBJhVg85CEIK9f50Qww==}
+ '@biomejs/cli-darwin-arm64@2.3.9':
+ resolution: {integrity: sha512-hHbYYnna/WBwem5iCpssQQLtm5ey8ADuDT8N2zqosk6LVWimlEuUnPy6Mbzgu4GWVriyL5ijWd+1zphX6ll4/A==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [darwin]
- '@biomejs/cli-darwin-x64@2.3.8':
- resolution: {integrity: sha512-lUDQ03D7y/qEao7RgdjWVGCu+BLYadhKTm40HkpJIi6kn8LSv5PAwRlew/DmwP4YZ9ke9XXoTIQDO1vAnbRZlA==}
+ '@biomejs/cli-darwin-x64@2.3.9':
+ resolution: {integrity: sha512-sKMW5fpvGDmPdqCchtVH5MVlbVeSU3ad4CuKS45x8VHt3tNSC8CZ2QbxffAOKYK9v/mAeUiPC6Cx6+wtyU1q7g==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [darwin]
- '@biomejs/cli-linux-arm64-musl@2.3.8':
- resolution: {integrity: sha512-PShR4mM0sjksUMyxbyPNMxoKFPVF48fU8Qe8Sfx6w6F42verbwRLbz+QiKNiDPRJwUoMG1nPM50OBL3aOnTevA==}
+ '@biomejs/cli-linux-arm64-musl@2.3.9':
+ resolution: {integrity: sha512-JOHyG2nl8XDpncbMazm1uBSi1dPX9VbQDOjKcfSVXTqajD0PsgodMOKyuZ/PkBu5Lw877sWMTGKfEfpM7jE7Cw==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
- '@biomejs/cli-linux-arm64@2.3.8':
- resolution: {integrity: sha512-Uo1OJnIkJgSgF+USx970fsM/drtPcQ39I+JO+Fjsaa9ZdCN1oysQmy6oAGbyESlouz+rzEckLTF6DS7cWse95g==}
+ '@biomejs/cli-linux-arm64@2.3.9':
+ resolution: {integrity: sha512-BXBB6HbAgZI6T6QB8q6NSwIapVngqArP6K78BqkMerht7YjL6yWctqfeTnJm0qGF2bKBYFexslrbV+VTlM2E6g==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
- '@biomejs/cli-linux-x64-musl@2.3.8':
- resolution: {integrity: sha512-YGLkqU91r1276uwSjiUD/xaVikdxgV1QpsicT0bIA1TaieM6E5ibMZeSyjQ/izBn4tKQthUSsVZacmoJfa3pDA==}
+ '@biomejs/cli-linux-x64-musl@2.3.9':
+ resolution: {integrity: sha512-FUkb/5beCIC2trpqAbW9e095X4vamdlju80c1ExSmhfdrojLZnWkah/XfTSixKb/dQzbAjpD7vvs6rWkJ+P07Q==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
- '@biomejs/cli-linux-x64@2.3.8':
- resolution: {integrity: sha512-QDPMD5bQz6qOVb3kiBui0zKZXASLo0NIQ9JVJio5RveBEFgDgsvJFUvZIbMbUZT3T00M/1wdzwWXk4GIh0KaAw==}
+ '@biomejs/cli-linux-x64@2.3.9':
+ resolution: {integrity: sha512-PjYuv2WLmvf0WtidxAkFjlElsn0P6qcvfPijrqu1j+3GoW3XSQh3ywGu7gZ25J25zrYj3KEovUjvUZB55ATrGw==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
- '@biomejs/cli-win32-arm64@2.3.8':
- resolution: {integrity: sha512-H4IoCHvL1fXKDrTALeTKMiE7GGWFAraDwBYFquE/L/5r1927Te0mYIGseXi4F+lrrwhSWbSGt5qPFswNoBaCxg==}
+ '@biomejs/cli-win32-arm64@2.3.9':
+ resolution: {integrity: sha512-w48Yh/XbYHO2cBw8B5laK3vCAEKuocX5ItGXVDAqFE7Ze2wnR00/1vkY6GXglfRDOjWHu2XtxI0WKQ52x1qxEA==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [win32]
- '@biomejs/cli-win32-x64@2.3.8':
- resolution: {integrity: sha512-RguzimPoZWtBapfKhKjcWXBVI91tiSprqdBYu7tWhgN8pKRZhw24rFeNZTNf6UiBfjCYCi9eFQs/JzJZIhuK4w==}
+ '@biomejs/cli-win32-x64@2.3.9':
+ resolution: {integrity: sha512-90+J63VT7qImy9s3pkWL0ZX27VzVwMNCRzpLpe5yMzMYPbO1vcjL/w/Q5f/juAGMvP7a2Fd0H7IhAR6F7/i78A==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [win32]
@@ -3997,39 +3997,39 @@ snapshots:
'@bcoe/v8-coverage@1.0.2': {}
- '@biomejs/biome@2.3.8':
+ '@biomejs/biome@2.3.9':
optionalDependencies:
- '@biomejs/cli-darwin-arm64': 2.3.8
- '@biomejs/cli-darwin-x64': 2.3.8
- '@biomejs/cli-linux-arm64': 2.3.8
- '@biomejs/cli-linux-arm64-musl': 2.3.8
- '@biomejs/cli-linux-x64': 2.3.8
- '@biomejs/cli-linux-x64-musl': 2.3.8
- '@biomejs/cli-win32-arm64': 2.3.8
- '@biomejs/cli-win32-x64': 2.3.8
-
- '@biomejs/cli-darwin-arm64@2.3.8':
+ '@biomejs/cli-darwin-arm64': 2.3.9
+ '@biomejs/cli-darwin-x64': 2.3.9
+ '@biomejs/cli-linux-arm64': 2.3.9
+ '@biomejs/cli-linux-arm64-musl': 2.3.9
+ '@biomejs/cli-linux-x64': 2.3.9
+ '@biomejs/cli-linux-x64-musl': 2.3.9
+ '@biomejs/cli-win32-arm64': 2.3.9
+ '@biomejs/cli-win32-x64': 2.3.9
+
+ '@biomejs/cli-darwin-arm64@2.3.9':
optional: true
- '@biomejs/cli-darwin-x64@2.3.8':
+ '@biomejs/cli-darwin-x64@2.3.9':
optional: true
- '@biomejs/cli-linux-arm64-musl@2.3.8':
+ '@biomejs/cli-linux-arm64-musl@2.3.9':
optional: true
- '@biomejs/cli-linux-arm64@2.3.8':
+ '@biomejs/cli-linux-arm64@2.3.9':
optional: true
- '@biomejs/cli-linux-x64-musl@2.3.8':
+ '@biomejs/cli-linux-x64-musl@2.3.9':
optional: true
- '@biomejs/cli-linux-x64@2.3.8':
+ '@biomejs/cli-linux-x64@2.3.9':
optional: true
- '@biomejs/cli-win32-arm64@2.3.8':
+ '@biomejs/cli-win32-arm64@2.3.9':
optional: true
- '@biomejs/cli-win32-x64@2.3.8':
+ '@biomejs/cli-win32-x64@2.3.9':
optional: true
'@commitlint/cli@19.8.1(@types/node@24.10.0)(typescript@5.8.3)':
diff --git a/turbo.json b/turbo.json
index a3f2c1ff..b1921842 100644
--- a/turbo.json
+++ b/turbo.json
@@ -2,9 +2,6 @@
"$schema": "https://turbo.build/schema.json",
"tasks": {
"compact": {
- "dependsOn": [
- "^build"
- ],
"env": [
"COMPACT_HOME"
],
@@ -13,26 +10,50 @@
],
"outputLogs": "new-only",
"outputs": [
- "src/artifacts/**",
- "src/gen/**",
- "gen/**"
+ "artifacts/**"
+ ]
+ },
+ "compact:fast": {
+ "env": [
+ "COMPACT_HOME",
+ "SKIP_ZK"
+ ],
+ "inputs": [
+ "src/**/*.compact"
+ ],
+ "outputLogs": "new-only",
+ "outputs": [
+ "artifacts/**"
]
},
+ "compact:fmt": {
+ "inputs": [
+ "src/**/*.compact"
+ ],
+ "outputs": []
+ },
+ "compact:fmt:fix": {
+ "cache": false
+ },
"test": {
- "outputs": [],
+ "dependsOn": [
+ "compact:fast",
+ "^compact:fast"
+ ],
+ "env": [
+ "COMPACT_HOME"
+ ],
"cache": false
},
"build": {
"dependsOn": [
- "^build",
- "compact"
+ "^build"
],
"env": [
"COMPACT_HOME"
],
"inputs": [
"src/**/*.ts",
- "src/**/*.mts",
"src/**/*.tsx",
"!src/**/*.test.ts",
"!tests/**/*.ts",
@@ -41,29 +62,72 @@
".env"
],
"outputs": [
- "dist/**"
+ "dist/**",
+ ".next/**"
+ ]
+ },
+ "build:fast": {
+ "dependsOn": [
+ "^build:fast"
+ ],
+ "env": [
+ "COMPACT_HOME",
+ "SKIP_ZK"
+ ],
+ "inputs": [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ "!src/**/*.test.ts",
+ "!tests/**/*.ts",
+ "tsconfig.json",
+ "tsconfig.build.json",
+ ".env"
+ ],
+ "outputs": [
+ "dist/**",
+ ".next/**"
]
},
"types": {
- "outputs": [],
- "cache": false
+ "dependsOn": [
+ "compact:fast",
+ "^compact:fast",
+ "^build:fast"
+ ],
+ "inputs": [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ "tsconfig.json",
+ "tsconfig.build.json"
+ ],
+ "outputs": []
},
"precommit": {
- "dependsOn": [],
- "outputs": [],
- "cache": false
- },
- "fmt": {
- "outputs": [],
+ "dependsOn": [
+ "types",
+ "^types"
+ ],
"cache": false
},
"lint": {
- "outputs": [],
- "cache": false
+ "inputs": [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ "src/**/*.compact",
+ "biome.json"
+ ],
+ "outputs": []
},
"lint:fix": {
- "outputs": [],
"cache": false
+ },
+ "lint:ci": {
+ "inputs": [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ "biome.json"
+ ],
+ "outputs": []
}
}
-}
\ No newline at end of file
+}