Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TIMBER2024 authored Oct 14, 2024
0 parents commit b1c03ea
Show file tree
Hide file tree
Showing 513 changed files with 84,313 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"node": true,
"es6": true
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
"no-var": "error",
"no-constant-condition": "off",
"comma-dangle": ["error", "never"],

"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/no-use-before-define": ["error", { "functions": false }],
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{ "allowArgumentsExplicitlyTypedAsAny": true }
]
},
"ignorePatterns": [
"src/spec-lang/expr_parser_header.ts",
"src/spec-lang/expr_parser.ts",
"src/rewriter/import_directive_parser.ts",
"src/rewriter/import_directive_header.ts"
]
}
88 changes: 88 additions & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: NodeJS CI

on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# See https://nodejs.org/en/about/releases/
node-version: [ 20.x ]

env:
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install and lint
run: |
npm install
npm link
npm run lint
# See https://github.com/ethereum/solc-bin
# See https://binaries.soliditylang.org/
# Also, remove list files and one rarely used compiler to still test downloading on-demand.
- name: Pre-download compilers from historical builds archive
run: |
scribble --download-compilers native wasm
find $SOL_AST_COMPILER_CACHE -name 'list.json' -delete
find $SOL_AST_COMPILER_CACHE -name '*v0.5.17*' -delete
- name: Test and generate coverage report
run: |
npm run test:ci
npm run coverage
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v4
with:
name: codecov-umbrella
directory: ./coverage/
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

notify-slack:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- id: non_merge_commit_message
run: echo "commit_message=$(git log --pretty=format:'%s' --no-merges -n 1)" >> $GITHUB_OUTPUT
shell: bash
- name: Send slack Notification
uses: slackapi/[email protected]
with:
payload: |
{
"project": "${{ github.repository }}",
"env": "${{ github.ref_name }}",
"version": "",
"actor": "${{ github.triggering_actor }}",
"commit_sha": "${{ github.sha }}",
"commit_message": "${{ steps.non_merge_commit_message.outputs.commit_message }}",
"commit_link": "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}",
"message": ""
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_url }}
21 changes: 21 additions & 0 deletions .github/workflows/npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and release package

on:
release:
types: [ published ]

permissions: read-all

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.nyc_output
node_modules
dist
coverage
*.tgz
src/spec-lang/expr_parser.ts
src/spec-lang/annotation_parser.ts
src/spec-lang/typeString_parser.ts
src/rewriter/import_directive_parser.ts
.vscode/launch.json
test/multifile_samples/*/__scribble_ReentrancyUtils.sol
test/multifile_samples/*/*.sol.instrumented
.idea
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"package": "./package.json",
"timeout": false,
"require": "ts-node/register",
"spec": ["./test/unit/**/*.spec.ts", "./test/integration/**/*.spec.ts"]
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
21 changes: 21 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extension": [".ts"],
"exclude": [
"**/*.d.ts",
"**/node_modules/**",
"**/test/**",
"**/coverage/**",
"**/.compiler_cache/**",
"**/src/spec-lang/*_parser.ts",
"**/src/spec-lang/*_parser_header.ts",
"**/src/rewriter/*_parser.ts",
"**/src/rewriter/*_header.ts"
],
"reporter": ["lcov", "text-summary"],
"all": true,
"check-coverage": true,
"statements": 90,
"branches": 85,
"functions": 90,
"lines": 90
}
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"arrowParens": "always",
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"printWidth": 100,
"bracketSpacing": true
}
25 changes: 25 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"json.format.enable": false,
"eslint.alwaysShowStatus": true,
"eslint.validate": ["javascript", "typescript"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dimitar Bounov <[email protected]> (https://github.com/cd1m0)
Pavel Zverev <[email protected]> (https://github.com/blitz-1306)
Loading

0 comments on commit b1c03ea

Please sign in to comment.