Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2a7132f
refactor: follow compact-contracts contracts file structure
0xisk Dec 3, 2025
34c8777
fix: contracts/tsconfig.json
0xisk Dec 4, 2025
101342d
refactor: follow node24 default configs
0xisk Dec 4, 2025
89fa665
refactor: adding submodule options in gh actions
0xisk Dec 9, 2025
70128a6
refactor: using OZ compact-contracts
0xisk Dec 9, 2025
9b5fa49
refactor: delete packages/compact and use compact-tools instead
0xisk Dec 9, 2025
db81b1f
chore: update README
0xisk Dec 9, 2025
9fb51b9
fix: contracts/tsConfig include patterns to include all .ts
0xisk Dec 9, 2025
f37245e
refactor: improvements on accesscontrol by using the simulator and se…
0xisk Dec 16, 2025
b9888dc
refactor: huge improvments upgrade to 0.27.0, archive Uint256, Field2…
0xisk Dec 16, 2025
cd3009d
refactor: archive some of math liberaries, and the std:
0xisk Dec 16, 2025
c399c42
refactor: upgrade shielded token contracts, delete types dir, and mov…
0xisk Dec 16, 2025
1b35022
refactor: upgrade struct contracts, delete types, utils dir, and move…
0xisk Dec 16, 2025
6faa6ee
refactor: remove the types package for now as it is outdated and need…
0xisk Dec 16, 2025
3f43313
chore: pin compact-contracts to v0.0.1-alpha.1
0xisk Dec 16, 2025
6f6a5a7
refactor: update compact-runtime pkg
0xisk Dec 16, 2025
fac8a95
refactor: fix turbo scripts and fix Math bug
0xisk Dec 18, 2025
8f292ee
refactor: seperate compact format commands and fix lint
0xisk Dec 18, 2025
2af332d
refactor: clean turbo inputs/outputs
0xisk Dec 18, 2025
7d11ff1
refactor: upgrade U256 and Bytes32
0xisk Dec 19, 2025
4187d28
refactor: upgrade Field255 contract
0xisk Dec 19, 2025
30c61bf
refactor: huge improvments and optimizations on the math library
0xisk Dec 25, 2025
e180fa9
refactor: improvements on abstracting the recommended implementations
0xisk Dec 25, 2025
8ddfa91
refactor: adding missing tests and circuits
0xisk Dec 29, 2025
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
31 changes: 24 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ runs:
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive

- name: Set Compact environment variables
shell: bash
Expand Down Expand Up @@ -75,26 +76,42 @@ runs:
node-version: '22.x'
cache: 'pnpm'

- name: Build compact package
- name: Enable Corepack for Yarn
shell: bash
run: corepack enable

- name: Build compact-tools submodule
shell: bash
run: |
cd packages/compact
pnpm install
pnpm run build
echo "📦 Building compact-tools submodule..."
cd compact-tools
yarn install --immutable
yarn build
echo "✅ compact-tools built successfully"

- name: Validate build artifacts
- name: Validate compact-tools artifacts
shell: bash
run: |
REQUIRED_FILES=(
"packages/compact/dist/runCompiler.js"
"packages/compact/dist/runBuilder.js"
"compact-tools/packages/cli/dist/runCompiler.js"
"compact-tools/packages/cli/dist/runBuilder.js"
)
for file in "${REQUIRED_FILES[@]}"; do
if [ ! -f "$file" ]; then
echo "::error::❌ Missing required file: $file"
exit 1
fi
done
echo "✅ compact-tools artifacts validated"

- name: Build compact-contracts submodule
shell: bash
run: |
echo "📦 Building compact-contracts submodule..."
cd compact-contracts
yarn install --immutable
SKIP_ZK=true yarn compact
echo "✅ compact-contracts built successfully"

- name: Install dependencies
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
submodules: recursive

- name: Setup Environment
uses: ./.github/actions/setup
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
submodules: recursive

- name: Setup Environment
uses: ./.github/actions/setup
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 2 # Recommended by turbo team
submodules: recursive

- name: Setup Environment
uses: ./.github/actions/setup
Expand Down
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submodule "compact-tools"]
path = compact-tools
url = https://github.com/OpenZeppelin/compact-tools

[submodule "compact-contracts"]
path = compact-contracts
url = https://github.com/OpenZeppelin/compact-contracts
60 changes: 43 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Midnight DApps
# Midnight Apps

[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://opensource.org/licenses/MIT)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/midnight-apps/badge)](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/midnight-apps)

A collection of starter dapps on the Midnight Network
A collection of sample (starter) apps on the Midnight Network

## Overview
This monorepo contains experimental sample projects built on top of the Midnight Network using Compact. It includes contract, utility, and application code.
Expand Down Expand Up @@ -33,33 +33,59 @@ compact --version
```

### Setup
1. **Clone the Repository**:
1. **Clone the Repository with Submodules**:
```bash
git clone <repository-url>
cd openzeppelin-midnight-apps
git clone --recurse-submodules <repository-url>
cd midnight-apps
```

If you already cloned without submodules, initialize them:
```bash
git submodule update --init --recursive
```

2. **Build the compact-tools Submodule**:
```bash
cd compact-tools
yarn install
yarn build
cd ..
```
This builds the CLI tools (`compact-compiler`, `compact-builder`) required by the contracts.

2. **Install Dependencies**:
3. **Build the compact-contracts Submodule**:
```bash
cd compact-contracts
yarn install
SKIP_ZK=true yarn compact
cd ..
```
This compiles the OpenZeppelin Compact contracts library.

4. **Install Main Project Dependencies**:
```bash
pnpm install
```
- This installs all workspace dependencies and runs the `prepare` script, which sets up Husky and builds `@openzeppelin/midnight-apps-compact`.
This installs all workspace dependencies and runs the `prepare` script, which sets up Husky.

3. **Workspace Structure**:
- `contracts/*`: Compact Smart contract projects (e.g., `@openzeppelin/midnight-apps-access-contract`).
- `packages/*`: Utility packages (e.g., `@openzeppelin/midnight-apps-compact`).
- `apps/*`: Frontend applications (e.g., `@openzeppelin/midnight-apps-lunarswap-ui`).
5. **Workspace Structure**:
- `compact-tools/`: Git submodule - CLI tools for compiling Compact contracts.
- `compact-contracts/`: Git submodule - OpenZeppelin Compact contracts library.
- `contracts/`: Compact smart contract projects for this repo.
- `packages/`: Utility packages (e.g., `@openzeppelin/midnight-apps-logger`).
- `apps/`: Frontend applications (e.g., `@openzeppelin/midnight-apps-lunarswap-ui`).

See `pnpm-workspace.yaml` for the full list.

4. **Build Contracts Packages**:
6. **Build Contracts Packages**:
```bash
pnpm build:contracts
```
Or navigate to individual contract packages:
```bash
# Navigate to each contract package and run build
cd contracts/access && pnpm build
cd ../math && pnpm build
cd ../structs && pnpm build
cd contracts && pnpm build
```
- **Note**: Running `pnpm build:contracts`, `pnpm compact`, `pnpm compact:fast`, `pnpm compact:version`, or `pnpm compact:language-version` from the root may cause repetitive output due to Turbo's logging behavior. It's recommended to compile contracts individually from within each package directory.
- **Note**: Running `pnpm compact`, `pnpm compact:fast`, `pnpm compact:version`, or `pnpm compact:language-version` from the root may cause repetitive output due to Turbo's logging behavior.
- **Feature Request**: A logging output mode flag is being requested to fix Turbo animation log flooding. See [GitHub Issue #1188](https://github.com/midnightntwrk/compactc/issues/1188) for more details.

### Tasks with Turbo
Expand Down
6 changes: 3 additions & 3 deletions apps/lunarswap-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"fmt": "biome format --write",
"lint": "biome lint",
"lint:fix": "biome check --write",
"lint": "biome check . && next lint",
"lint:fix": "biome check . --write",
"lint:ci": "biome ci . --changed --since=main --no-errors-on-unmatched",
"githook:precommit": "lint-staged && pnpm run types"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions compact-contracts
Submodule compact-contracts added at 84e8c7
1 change: 1 addition & 0 deletions compact-tools
Submodule compact-tools added at 0cd727
4 changes: 0 additions & 4 deletions contracts/access/.lintstagedrc.json

This file was deleted.

38 changes: 0 additions & 38 deletions contracts/access/package.json

This file was deleted.

22 changes: 0 additions & 22 deletions contracts/access/src/Index.compact

This file was deleted.

22 changes: 0 additions & 22 deletions contracts/access/src/index.ts

This file was deleted.

Loading
Loading