Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9900b2a
advance-worflows
aniket866 Mar 24, 2026
680be7f
advance-worflows
aniket866 Mar 24, 2026
7a46d10
Code rabbit follow up
aniket866 Mar 25, 2026
085732e
Code rabbit follow up
aniket866 Mar 25, 2026
1b5f9e3
Code rabbit follow up
aniket866 Mar 25, 2026
0b1af16
Code rabbit follow up
aniket866 Mar 25, 2026
73974b9
code-rabbit-local-fix
aniket866 Mar 25, 2026
917f07a
Merge branch 'advance-workflows' of https://github.com/aniket866/Iden…
aniket866 Mar 25, 2026
5cb0bb4
code-rabbit-local-fix
aniket866 Mar 25, 2026
8761690
local-code-rabbit-fix
aniket866 Mar 25, 2026
d3b3d1e
local-code-rabbit-fix
aniket866 Mar 25, 2026
8912709
Code rabbit follow up
aniket866 Mar 25, 2026
aa44c29
Code rabbit follow up
aniket866 Mar 25, 2026
f2da137
Code rabbit follow up
aniket866 Mar 25, 2026
c493e3a
Code rabbit follow-up
aniket866 Mar 25, 2026
c0320de
code-rabbit-followup
aniket866 Mar 25, 2026
b321fba
gas-snap-shot-fix
aniket866 Mar 25, 2026
c23b99e
gas-snapshot
aniket866 Mar 25, 2026
3d6a0f8
Copilot-suggestions
aniket866 Mar 27, 2026
198453c
Copilot-suggestions
aniket866 Mar 27, 2026
f4ea87e
Copilot-fix
aniket866 Mar 27, 2026
eec5ddf
Update 4naly3er workflow for optimization report
aniket866 Mar 27, 2026
cafd272
Update .github/workflows/contract-size.yml
aniket866 Mar 27, 2026
631ca6a
Update .github/workflows/mythril.yml
aniket866 Mar 27, 2026
c1ffe53
Update .github/workflows/mythril.yml
aniket866 Mar 27, 2026
835e9b4
Code rabbit follow-up
aniket866 Mar 27, 2026
4a41210
Code rabbit follow-up
aniket866 Mar 27, 2026
e14020c
Code rabbit follow-up
aniket866 Mar 27, 2026
c37c2ed
Fixing-ci-fails
aniket866 Mar 27, 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
33 changes: 33 additions & 0 deletions .github/workflows/4naly3er.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 4naly3er Report

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
analyzer_4naly3er:
name: 4naly3er Gas Optimization Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
Comment thread
aniket866 marked this conversation as resolved.
Outdated

- name: Install 4naly3er
run: |
git clone https://github.com/Picodes/4naly3er
cd 4naly3er
rm -f src/issues/NC/uselessOverride.ts || true
yarn

Comment thread
aniket866 marked this conversation as resolved.
Outdated
- name: Run 4naly3er on src/
run: |
cd 4naly3er
yarn analyze ../src ../4naly3er-report.md
Comment thread
coderabbitai[bot] marked this conversation as resolved.
65 changes: 65 additions & 0 deletions .github/workflows/abi-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: ABI Diff Check

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
abi-diff:
name: ABI Diff Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Build contracts
run: forge build

- name: Generate ABIs and diff against baseline
run: |
mkdir -p .abi-current
CHANGED=0

if [ ! -d .abi-baselines ]; then
echo "No .abi-baselines directory. Skipping check."
exit 0
fi

# Derive contract names from existing baselines to avoid placeholder drift.
mapfile -t CONTRACTS < <(find .abi-baselines -type f -name '*.json' -exec basename {} .json \;)
if [ "${#CONTRACTS[@]}" -eq 0 ]; then
echo "No ABI baselines found in .abi-baselines/. Skipping ABI diff."
exit 0
fi

for contract in "${CONTRACTS[@]}"; do
if ! forge inspect "$contract" abi > ".abi-current/${contract}.json" 2>/dev/null; then
echo "::error::Failed to generate ABI for $contract"
CHANGED=1
continue
fi

baseline=".abi-baselines/${contract}.json"
if [ -f "$baseline" ]; then
if ! diff -u "$baseline" ".abi-current/${contract}.json"; then
echo "❌ ABI changed for $contract — this may be a breaking change!"
CHANGED=1
fi
else
echo "::error::No ABI baseline for $contract. Add .abi-baselines/${contract}.json"
CHANGED=1
fi
Comment thread
aniket866 marked this conversation as resolved.
done

if [ "$CHANGED" -eq 1 ]; then
exit 1
fi
31 changes: 31 additions & 0 deletions .github/workflows/contract-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Contract Size Check

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
contract-size:
name: Contract Size Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Build and check contract sizes
run: |
forge build --sizes 2>&1 | tee sizes.txt
# Fail if any contract is >= 23616 bytes (warn zone before 24KB EIP-170 limit)
if grep -E '^\s*\|.*\s([2-9][0-9]{3}|[1-9][0-9]{4})\s' sizes.txt; then
Comment thread
aniket866 marked this conversation as resolved.
Outdated
echo "❌ One or more contracts are dangerously close to or over the 24KB limit."
exit 1
fi
37 changes: 37 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Coverage Report

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
coverage:
name: Coverage Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Generate coverage report
run: forge coverage --report lcov

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: ./lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/gas-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Gas Report

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
gas-report:
name: Gas Report on Test Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Run tests with gas report
run: forge test --gas-report
34 changes: 34 additions & 0 deletions .github/workflows/gas-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Gas Snapshot Diff

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
gas-snapshot:
name: Gas Snapshot Diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Comment thread
aniket866 marked this conversation as resolved.

- name: Compare gas snapshot diff
run: |
if [ ! -f .gas-snapshot ]; then
echo "No .gas-snapshot found. Generating one now instead of diffing."
forge snapshot
exit 0
fi
if ! forge snapshot --diff .gas-snapshot; then
echo "❌ Gas usage increased. Review the diff above."
exit 1
Comment thread
aniket866 marked this conversation as resolved.
fi
36 changes: 36 additions & 0 deletions .github/workflows/mythril.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Mythril Security Scan

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
mythril:
name: Mythril Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Build contracts
run: forge build

- name: Run Mythril on all contracts
run: |
find src -name "*.sol" | while read contract; do
echo "🔍 Scanning $contract ..."
docker run --rm \
-v "$(pwd):/project" \
mythril/myth analyze "/project/$contract" \
--solv 0.8.24 \
--execution-timeout 60
Comment thread
aniket866 marked this conversation as resolved.
Outdated
done
Comment thread
aniket866 marked this conversation as resolved.
Outdated
77 changes: 77 additions & 0 deletions .github/workflows/storage-layout-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Storage Layout Diff

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
FOUNDRY_PROFILE: ci

jobs:
storage-layout-diff:
name: Storage Layout Diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Build contracts
run: forge build

- name: Generate storage layouts
run: |
set -euo pipefail
if [ ! -d .storage-baselines ]; then
echo "No .storage-baselines directory. Skipping generation."
exit 0
fi

mkdir -p .storage-layouts
mapfile -t CONTRACTS < <(find .storage-baselines -type f -name '*.json' -exec basename {} .json \;)

if [ "${#CONTRACTS[@]}" -eq 0 ]; then
echo "No baselines found in .storage-baselines. Skipping generation."
exit 0
fi

for contract in "${CONTRACTS[@]}"; do
forge inspect "$contract" storage-layout > ".storage-layouts/${contract}.json"
done

- name: Diff against baseline
run: |
shopt -s nullglob
CHANGED=0
if [ ! -d .storage-layouts ]; then
echo "No .storage-layouts generated. Skipping diff."
exit 0
fi
files=(.storage-layouts/*.json)
if [ ${#files[@]} -eq 0 ]; then
echo "No storage layouts were generated. Skipping diff."
exit 0
fi

for file in "${files[@]}"; do
name=$(basename "$file")
baseline=".storage-baselines/$name"
if [ -f "$baseline" ]; then
if ! diff -u "$baseline" "$file"; then
echo "❌ Storage layout changed for $name"
CHANGED=1
fi
else
echo "❌ No baseline found for $name — add it to .storage-baselines/"
CHANGED=1
fi
done

if [ "$CHANGED" -eq 1 ]; then
exit 1
fi
Loading