Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slither config, ci #1213

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ jobs:
- name: Formatting
run: yarn format:ci

analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Slither
run: pip3 install slither-analyzer

- name: Running Slither
run: yarn analyze:ci

test:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This mono-repo contains The Sandbox smart contracts, underpinning The Sandbox me

- ⚙️ [NodeJS](https://nodejs.org/)
- 🧰 [Yarn](https://yarnpkg.com/)
- 🐍 [Python](https://www.python.org/)

## Tech stack and getting started

Expand All @@ -45,6 +46,11 @@ Each package should follow the [audit best practices](./audit-best-practices.md)
yarn install
```

Install Slither (optional)
```bash
pip3 install -r requirements.txt
```

## Architecture Overview

- 📦 This mono-repository contains a suite of smart contract packages.
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
"lint": "nx run-many --target=lint",
"format": "nx run-many --target=format",
"deploy": "nx run-many --target=deploy",
"all": "nx run-many --all --parallel --targets=lint,format,test,deploy && nx run-many --all --targets=coverage",
"analyze": "nx run-many --target=analyze",
"all": "nx run-many --all --parallel --targets=lint,format,analyze,test,deploy && nx run-many --all --targets=coverage",
"test:ci": "nx affected --target=test --parallel=1",
"coverage:ci": "nx affected --target=coverage --parallel=1 && istanbul-combine -r lcov -r html 'packages/*/coverage.json'",
"lint:ci": "nx affected --target=lint",
"format:ci": "nx affected --target=format",
"deploy:ci": "nx affected --target=deploy --parallel=1",
"analyze:ci": "nx affected --target=analyze",
"clean": "rimraf coverage/* && nx run-many --target=clean"
},
"repository": "https://github.com/thesandboxgame/sandbox-smart-contracts",
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"format:fix": "prettier --write \"**/*.{ts,js,sol}\"",
"test": "hardhat test",
"coverage": "hardhat coverage --testfiles 'test/*.ts''test/*.js'",
"analyze": "slither .",
"hardhat": "hardhat",
"compile": "hardhat compile"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/marketplace/slither.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printers_to_run": "human-summary",
"detectors_to_exclude": "naming-convention",
"filter_paths": "(mocks/|@openzeppelin/|@sandbox-smart-contracts/)"
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
slither-analyzer==0.9.6
Loading