feat: use wagmi to generate contract types

This commit is contained in:
Arseniy Klempner 2025-10-23 13:19:49 -07:00
parent 8221064d4f
commit 7d386cecb7
No known key found for this signature in database
GPG Key ID: 51653F18863BD24B
4 changed files with 1183 additions and 381 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "packages/rln/waku-rlnv2-contract"]
path = packages/rln/waku-rlnv2-contract
url = git@github.com:waku-org/waku-rlnv2-contract.git

1530
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,7 @@
"@waku/build-utils": "^1.0.0",
"@waku/interfaces": "0.0.34",
"@waku/message-encryption": "^0.0.37",
"@wagmi/cli": "^2.7.0",
"deep-equal-in-any-order": "^2.0.6",
"fast-check": "^3.23.2",
"rollup-plugin-copy": "^3.5.0"

View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SUBMODULE_DIR="$SCRIPT_DIR/waku-rlnv2-contract"
echo "Setting up waku-rlnv2-contract submodule..."
# Initialize submodule if needed
if [ ! -d "$SUBMODULE_DIR/.git" ]; then
echo "Initializing submodule..."
cd "$SCRIPT_DIR/../.."
git submodule update --init --recursive packages/rln/waku-rlnv2-contract
fi
# Install dependencies
echo "Installing submodule dependencies..."
cd "$SUBMODULE_DIR"
npm install
# Build contracts with Foundry
echo "Building contracts with Foundry..."
forge build
# Generate ABIs
echo "Generating contract ABIs..."
cd "$SCRIPT_DIR"
npx wagmi generate
echo "✅ Contract ABI setup complete!"