Skip to content

Commit 577b724

Browse files
Oba-Oneclaude
andcommitted
fix(ci): add OZ v5 ERC777 compatibility shims for Superfluid
OZ v5 moved ERC777 interfaces from token/ERC777/ to interfaces/. Superfluid protocol-monorepo still imports from the old v4 path. Add oz-compat.sh script that copies the interface files to the expected location, run in CI workflows and postinstall hook. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d750241 commit 577b724

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.github/workflows/contract-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ jobs:
3232
version: nightly
3333

3434
# Skip all bun/Node.js dependencies - contracts tests don't need them
35-
35+
36+
- name: Create OZ v5 compatibility shims
37+
run: ./scripts/oz-compat.sh
38+
3639
- name: Build contracts
3740
run: |
3841
echo "🔧 Building contracts..."

.github/workflows/integration-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ jobs:
7171
fi
7272
done
7373
74+
- name: Create OZ v5 compatibility shims
75+
run: ./scripts/oz-compat.sh
76+
7477
- name: Deploy contracts (using dev-start.sh deployment logic)
7578
run: |
7679
echo "🚀 Deploying contracts for integration testing..."

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "MIT",
88
"scripts": {
99
"preinstall": "./scripts/install-deps.sh",
10-
"postinstall": "rm -f package-lock.json && (command -v forge > /dev/null && git submodule update --init --recursive && cd contracts && forge install || echo 'Forge not found, skipping forge operations')",
10+
"postinstall": "rm -f package-lock.json && (command -v forge > /dev/null && git submodule update --init --recursive && ./scripts/oz-compat.sh && cd contracts && forge install || echo 'Forge not found, skipping forge operations')",
1111
"dev": "bun run dev:stop && ./scripts/dev-start.sh",
1212
"dev:client": "cd client && bun dev",
1313
"dev:stop": "pkill -f anvil || true && pkill -f 'forge script.*watch' || true && pkill -f 'next dev' || true && pkill -f 'npm run dev' || true",

scripts/oz-compat.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# OZ v5 compatibility: ERC777 interfaces moved from token/ERC777/ to interfaces/
3+
# Superfluid protocol-monorepo still imports from the old v4 path.
4+
# This script creates the missing files so builds work on fresh clones.
5+
6+
set -euo pipefail
7+
8+
OZ_DIR="lib/openzeppelin-contracts/contracts"
9+
10+
# Only run if OZ submodule exists but ERC777 dir is missing
11+
if [ -d "$OZ_DIR/interfaces" ] && [ ! -f "$OZ_DIR/token/ERC777/IERC777.sol" ]; then
12+
mkdir -p "$OZ_DIR/token/ERC777"
13+
for f in IERC777.sol IERC777Recipient.sol IERC777Sender.sol; do
14+
if [ -f "$OZ_DIR/interfaces/$f" ]; then
15+
cp "$OZ_DIR/interfaces/$f" "$OZ_DIR/token/ERC777/$f"
16+
fi
17+
done
18+
echo "Created OZ v5 ERC777 compatibility shims"
19+
fi

0 commit comments

Comments
 (0)