Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
22 changes: 12 additions & 10 deletions deploy.sh → .bash/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ fi
if [[ $network_upper == "POLYGON" ]]; then
params+=(--gas-estimate-multiplier 300)
fi
if [ $broadcast == "broadcast" ]; then
if [ "$broadcast" == "broadcast" ]; then
params+=(--broadcast)
if [ -n "$verifier" ]; then
params+=(--verify)
params+=(--verifier "${verifier}")
if [ $verifier == "etherscan" ]; then
params+=(--etherscan-api-key ${!blockscan_key})
elif [ $verifier == "routescan" ]; then
if [ "$verifier" == "etherscan" ]; then
params+=(--etherscan-api-key "${!blockscan_key}")
elif [ "$verifier" == "routescan" ]; then
params+=(--verifier-url "https://api.routescan.io/v2/network/mainnet/evm/80094/etherscan")
params+=(--etherscan-api-key "verifyContract")
elif [ $verifier == "blockscout" ]; then
if [ $network_upper == "INK"]; then
elif [ "$verifier" == "blockscout" ]; then
if [ "$network_upper" == "INK" ]; then
params+=(--verifier-url "https://explorer.inkonchain.com/api")
elif [ $network_upper == "PLUME"]; then
elif [ "$network_upper" == "PLUME" ]; then
params+=(--verifier-url "https://explorer.plume.org/api")
elif [ $network_upper == "KATANA"]; then
elif [ "$network_upper" == "KATANA" ]; then
params+=(--verifier-url "https://explorer.katanarpc.com/api")
else
params+=(--verifier-url "https://${network}.blockscout.com/api")
Expand All @@ -49,5 +49,7 @@ if [ $broadcast == "broadcast" ]; then
params+=(-vvvv)
fi

set -x
forge script script/${script} --private-key $PRIVATE_KEY --rpc-url ${!rpc} "${params[@]}"
{ set +x; } 2>/dev/null

PRIVATE_KEY="$PRIVATE_KEY" \
forge script "script/${script}" --rpc-url "${!rpc}" "${params[@]}"
5 changes: 5 additions & 0 deletions .bash/forge-fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

echo "🔎 Running forge fmt (default profile in foundry.toml)..."
forge fmt
29 changes: 29 additions & 0 deletions .bash/forge-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
set -eu

echo "🔎 Running forge lint (default profile in foundry.toml)..."

# Capture BOTH stdout and stderr, but don't fail on forge's exit code
set +e
RAW_OUTPUT="$(forge lint --color never 2>&1)"
set -e

# Show raw linter output (so CI logs display everything)
printf '%s\n' "$RAW_OUTPUT"

# Normalize line endings (remove any CRs from CRLF)
SANITIZED="$(printf '%s\n' "$RAW_OUTPUT" | tr -d '\r')"

# Extract diagnostic lines that start with a severity (allow optional leading spaces),
# and ignore codesize warnings
DIAGNOSTICS="$(printf '%s\n' "$SANITIZED" \
| grep -a -E '^[[:space:]]*(high|med|low|info|gas|warning|note)\[' \
| grep -vF '[codesize]' \
|| true)"

if [ -n "$DIAGNOSTICS" ]; then
echo "❌ Linting failed: either fix or disable [high|med|low|info|gas|warning|note] before committing."
exit 1
fi

echo "✅ Pre-commit checks passed."
57 changes: 49 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- "*" # Trigger on any push to any branch
- '*' # Trigger on any push to any branch

pull_request:
branches:
Expand All @@ -24,12 +24,19 @@ env:
ETHEREUM_RPC_URL: ${{ secrets.ETHEREUM_RPC_URL }}
GNOSIS_RPC_URL: ${{ secrets.GNOSIS_RPC_URL }}
HYPER_RPC_URL: ${{ secrets.HYPER_RPC_URL }}
INK_RPC_URL: ${{ secrets.INK_RPC_URL }}
KATANA_RPC_URL: ${{ secrets.KATANA_RPC_URL }}
LINEA_RPC_URL: ${{ secrets.LINEA_RPC_URL }}
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }}
PLASMA_RPC_URL: ${{ secrets.PLASMA_RPC_URL }}
PLUME_RPC_URL: ${{ secrets.PLUME_RPC_URL }}
POLYGON_RPC_URL: ${{ secrets.POLYGON_RPC_URL }}
SONIC_RPC_URL: ${{ secrets.SONIC_RPC_URL }}
SONEIUM_RPC_URL: ${{ secrets.SONEIUM_RPC_URL }}
UNICHAIN_RPC_URL: ${{ secrets.UNICHAIN_RPC_URL }}
WORLD_RPC_URL: ${{ secrets.WORLD_RPC_URL }}
ZKSYNC_RPC_URL: ${{ secrets.ZKSYNC_RPC_URL }}
PLUME_RPC_URL: ${{ secrets.PLUME_RPC_URL }}
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}

jobs:
check:
Expand All @@ -39,19 +46,53 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm 10.11.0
uses: pnpm/action-setup@v4
with:
version: 10.11.0

- name: Install Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'

- name: Install Node dependencies
run: |
pnpm install --frozen-lockfile --ignore-scripts
id: pnpm

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Show Forge version
run: forge --version
run: |
forge --version
id: version

- name: Install Forge dependencies
run: forge soldeer update
run: |
forge soldeer update
id: soldeer

- name: Run Forge fmt
run: |
forge fmt --check
id: fmt

- name: Run Forge lint
run: |
bash .bash/forge-lint.sh
id: lint

- name: Build contracts
run: forge build --sizes
- name: Run Forge build
run: |
forge build --sizes
id: build

- name: Run tests
run: forge test -vvv
- name: Run Forge tests
run: |
forge test -vvv --no-match-test "invariant_.*"
id: test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ zkout/

# Dependencies
node_modules/
dependencies/

# Deprecated submodule folder
lib/
Expand Down
Loading