Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d9e2030
refactor(contracts): restructure contracts package
0xisk Jan 22, 2026
f473ca2
fix: remove compact pkg and use compact-tools better
0xisk Jan 22, 2026
609bf7e
fix: remove next linter as in the LunarSwap app future PR will be in …
0xisk Jan 22, 2026
422bb60
fix: solve enviroment setup
0xisk Jan 22, 2026
e871cb3
fix: solve github token to install mn.js
0xisk Jan 22, 2026
803da89
fix: solve github token to install mn.js
0xisk Jan 22, 2026
e6e56d3
fix: conflit on dapps connector package version
0xisk Jan 22, 2026
886b8f8
fix: adding secrets gh token
0xisk Jan 22, 2026
803f42d
fix: upgrade ledger version
0xisk Jan 22, 2026
e6b15e7
fix: upgrade ledger version
0xisk Jan 22, 2026
2ac49e7
chore: remove the npm private registry
0xisk Jan 28, 2026
1c9621e
chore: update README
0xisk Jan 30, 2026
39c656a
fix: contracts/src/archive/test/Uint256.test.ts
0xisk Jan 30, 2026
3bdeb10
fix: contracts/src/archive/test/mocks/witnesses/Field254.ts
0xisk Jan 30, 2026
07ae9d4
fix: contracts/src/archive/utils/u256.ts
0xisk Jan 30, 2026
2834ac9
fix: contracts/src/archive/test/mocks/Uint256Simulator.ts
0xisk Jan 30, 2026
9d7bf04
fix: README.md
0xisk Jan 30, 2026
f96dcc0
refactor: clean old contracts structure, upgrade language-version and…
0xisk Jan 30, 2026
7566109
refactor: .cjs into .js
0xisk Jan 30, 2026
c405deb
refactor: lint cheks
0xisk Jan 30, 2026
0c3ebf4
refactor: upgrade to ledger-v7
0xisk Jan 30, 2026
3246260
fix: remove uneeded gh token
0xisk Jan 30, 2026
3f3ab67
refactor: use hex for the max uint128 contracts/src/math/test/Uint128…
0xisk Feb 3, 2026
7b97c61
refactor: use hex for the max uint128 contracts/src/math/test/Uint128…
0xisk Feb 3, 2026
ac461a8
refactor: use hex to name max uint128 contracts/src/math/Uint128.com…
0xisk Feb 3, 2026
8784ecc
refactor: using pattern contracts/vitest.config.ts
0xisk Feb 3, 2026
1f7ad14
refactor: not using compact-contracts contracts/src/shielded-token/op…
0xisk Feb 3, 2026
e77747d
refactor: using alias
0xisk Feb 3, 2026
f9e6650
refactor: remove uneeded github token from the actions
0xisk Feb 3, 2026
303d99c
fix: accesscontrol wrong prefix
0xisk Feb 3, 2026
5e4f135
refactor: accept secretkey param for generate
0xisk Feb 3, 2026
40be66e
refactor: catch error if the path is not found for a leaf
0xisk Feb 3, 2026
0d92607
fix: build:fast types issues
0xisk Feb 3, 2026
0bd7de5
fix: lint issue
0xisk Feb 3, 2026
987b886
fix: importing issues
0xisk Feb 3, 2026
4038796
refactor: remove compact-contracts submodule
0xisk Feb 4, 2026
3a58650
refactor: upgrade compact-tools v0.28.0
0xisk Feb 4, 2026
20789e4
fix: lint issue
0xisk Feb 4, 2026
0f6a8cd
refactor: using hex rep contracts/src/math/Uint64.compact
0xisk Feb 4, 2026
9803634
refactor: using hex rep contracts/src/math/Uint64.compact
0xisk Feb 4, 2026
0017e23
refacor: using hex rep contracts/src/math/Uint64.compact
0xisk Feb 4, 2026
6486e24
fix: typo contracts/src/shielded-token/openzeppelin/ShieldedERC20.com…
0xisk Feb 4, 2026
eb0b364
refactor: remoce compact-contracts from github actions
0xisk Feb 4, 2026
4b10b56
refactor: use pad as it is cheaper
0xisk Feb 4, 2026
1bef83c
fix: adding missing inputs for frontend build
0xisk Feb 4, 2026
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
34 changes: 33 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout submodules
shell: bash
run: git submodule update --init --recursive

- name: Cache turbo build setup
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
Expand All @@ -31,7 +35,7 @@ runs:
if: ${{ inputs.skip-compact != 'true' }}
uses: midnightntwrk/setup-compact-action@4130145456ad3f45934788dd4a65647eb283e658
with:
compact-version: "0.26.0"
compact-version: "0.28.0"

- name: Verify Compact Compiler Installation
if: ${{ inputs.skip-compact != 'true' }}
Expand All @@ -44,6 +48,34 @@ runs:
echo "✅ Compact CLI is available"
compact --version || true

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

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

- name: Validate compact-tools artifacts
shell: bash
run: |
REQUIRED_FILES=(
"compact-tools/packages/cli/dist/runCompiler.js"
"compact-tools/packages/cli/dist/runBuilder.js"
Comment on lines +68 to +69
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both? Consider that build already includes compact in the turbo.json

)
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: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --prefer-offline
3 changes: 2 additions & 1 deletion .github/workflows/apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 2 # Recommended by turbo team
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 @@ -27,6 +27,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 @@ -24,6 +24,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
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "compact-tools"]
path = compact-tools
url = https://github.com/OpenZeppelin/compact-tools
Comment thread
0xisk marked this conversation as resolved.
branch = main
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ registry=https://registry.npmjs.org/
# Token to auth yourself (make sure the env‐var matches below)
# //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}

# Always send auth on every request to GitHubs registry
# Always send auth on every request to GitHub's registry
# //npm.pkg.github.com/:always-auth=true
52 changes: 34 additions & 18 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,35 +33,51 @@ 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
```

2. **Install Dependencies**:
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.

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
# Navigate to each contract package and run build
cd contracts/access && pnpm build
cd ../math && pnpm build
cd ../structs && pnpm build
pnpm build:contracts
```
- **Note**: Running `pnpm build:contracts`, `pnpm compact`, or `pnpm compact:fast` 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.
- **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
Turbo manages tasks across the monorepo, defined in `turbo.json`. Key tasks:

Expand All @@ -81,7 +97,7 @@ Turbo manages tasks across the monorepo, defined in `turbo.json`. Key tasks:
- **`build:apps`**
- Builds apps projects.
- Run: `pnpm build:apps`.

- **`test`**:
- Runs tests with Vitest.
- Run: `pnpm test`.
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 @@ -13,9 +13,9 @@
},
"dependencies": {
"@hookform/resolvers": "^5.1.1",
"@midnight-ntwrk/dapp-connector-api": "^3.0.0",
"@midnight-ntwrk/ledger": "^4.0.0",
"@midnight-ntwrk/wallet-api": "^3.0.0",
"@midnight-ntwrk/dapp-connector-api": "4.0.0",
"@midnight-ntwrk/ledger-v7": "7.0.0",
"@midnight-ntwrk/wallet-api": "5.0.0",
"@openzeppelin/midnight-apps-logger": "workspace:^",
"@radix-ui/react-accordion": "^1.2.11",
"@radix-ui/react-alert-dialog": "^1.1.14",
Expand Down
1 change: 1 addition & 0 deletions compact-tools
Comment thread
0xisk marked this conversation as resolved.
Submodule compact-tools added at e66525
4 changes: 0 additions & 4 deletions contracts/access/.lintstagedrc.json

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading
Loading