Skip to content

Upgrade Contracts for Optimism Granite Network Upgrade - op contracts v1.6.0 #331

Upgrade Contracts for Optimism Granite Network Upgrade - op contracts v1.6.0

Upgrade Contracts for Optimism Granite Network Upgrade - op contracts v1.6.0 #331

Workflow file for this run

name: slither analysis
on:
pull_request:
paths:
- 'packages/tokamak/contracts-bedrock/**'
jobs:
analyze:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Add the repository to safe directories
- name: Add repo to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE
# Setup Node.js environment
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
# Copy necessary tools from Docker container
- name: Copy foundry from Docker container
run: |
container_id=$(docker create tokamaknetwork/thanos-ci-builder:latest)
mkdir -p $HOME/bin
docker cp $container_id:/usr/local/bin/cast $HOME/bin/
docker cp $container_id:/usr/local/bin/anvil $HOME/bin/
docker cp $container_id:/usr/local/bin/forge $HOME/bin/
docker rm $container_id
# Set permissions for the copied tools and add them to the PATH
- name: Set permissions and add PATH
run: |
chmod +x $HOME/bin/*
echo "$HOME/bin" >> $GITHUB_PATH
# Install pnpm and dependencies
- name: Install pnpm and dependencies
run: |
npm install --global pnpm
- name: Restore PNPM Package Cache
uses: actions/cache@v4
with:
path: node_modules
key: pnpm-packages-v2-slither-${{ hashFiles('pnpm-lock.yaml') }}
- name: Fetch dependencies
run: pnpm fetch --frozen-lockfile --prefer-offline
- name: Save PNPM Package Cache
uses: actions/cache@v4
with:
path: node_modules
key: pnpm-packages-v2-slither-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile --offline
# Build smart contracts
- name: Build the contracts
run: |
cd packages/tokamak/contracts-bedrock
forge build --build-info --skip '*/test/**' '*/scripts/**' '*/src/USDC/L1/tokamak-UsdcBridge/L1UsdcBridge.sol' '*/src/USDC/L2/tokamak-UsdcBridge/L2UsdcBridge.sol'
# Analyze smart contracts with Slither
- name: Run Slither
uses: crytic/[email protected]
with:
target: packages/tokamak/contracts-bedrock
slither-config: packages/tokamak/contracts-bedrock/slither.config.json
fail-on: config
slither-version: 0.10.3
slither-args: --triage-database packages/tokamak/contracts-bedrock/slither.db.json
ignore-compile: true
node-version: 20