Skip to content

Commit 378aab0

Browse files
authored
Merge pull request #286 from Abuchtela/copilot/fix-ed5c280b-c390-4bb0-b7e2-57cedbd508b9
2 parents 00cd6c5 + 201f845 commit 378aab0

File tree

4 files changed

+213
-0
lines changed

4 files changed

+213
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# A sample workflow which sets up Snyk to analyze the full Snyk platform (Snyk Open Source, Snyk Code,
7+
# Snyk Container and Snyk Infrastructure as Code)
8+
# The setup installs the Snyk CLI - for more details on the possible commands
9+
# check https://docs.snyk.io/snyk-cli/cli-reference
10+
# The results of Snyk Code are then uploaded to GitHub Security Code Scanning
11+
#
12+
# In order to use the Snyk Action you will need to have a Snyk API token.
13+
# More details in https://github.com/snyk/actions#getting-your-snyk-token
14+
# or you can signup for free at https://snyk.io/login
15+
#
16+
# For more examples, including how to limit scans to only high-severity issues
17+
# and fail PR checks, see https://github.com/snyk/actions/
18+
19+
name: Snyk Security
20+
21+
on:
22+
push:
23+
branches: ["develop" ]
24+
pull_request:
25+
branches: ["develop"]
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
snyk:
32+
permissions:
33+
contents: read # for actions/checkout to fetch code
34+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
35+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Set up Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
cache: 'pnpm'
44+
- name: Set up Snyk CLI to check for security issues
45+
# Snyk can be used to break the build when it detects security issues.
46+
# In this case we want to upload the SAST issues to GitHub Code Scanning
47+
uses: snyk/actions/setup@806182742461562b67788a64410098c9d9b96adb
48+
env:
49+
# This is where you will need to introduce the Snyk API token created with your Snyk account
50+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
51+
52+
# Runs Snyk Code (SAST) analysis and uploads result into GitHub.
53+
# Use || true to not fail the pipeline
54+
- name: Snyk Code test
55+
run: snyk code test --sarif > snyk-code.sarif # || true
56+
57+
# Runs Snyk Open Source (SCA) analysis and uploads result to Snyk.
58+
- name: Snyk Open Source monitor
59+
run: snyk monitor --all-projects
60+
61+
# Runs Snyk Infrastructure as Code (IaC) analysis and uploads result to Snyk.
62+
# Use || true to not fail the pipeline.
63+
- name: Snyk IaC test and report
64+
run: snyk iac test --report # || true
65+
66+
# Build the docker image for testing
67+
- name: Build a Docker image
68+
run: docker build -t optimism/op-batcher:latest -f ./op-batcher/Dockerfile .
69+
# Runs Snyk Container (Container and SCA) analysis and uploads result to Snyk.
70+
- name: Snyk Container monitor
71+
run: snyk container monitor optimism/op-batcher:latest --file=./op-batcher/Dockerfile
72+
73+
# Push the Snyk Code results into GitHub Code Scanning tab
74+
- name: Upload result to GitHub Code Scanning
75+
uses: github/codeql-action/upload-sarif@v3
76+
with:
77+
sarif_file: snyk-code.sarif

op-batcher/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack-go:latest
2+
FROM $OP_STACK_GO_BUILDER as builder
3+
# See "make golang-docker" and /ops/docker/op-stack-go
4+
5+
FROM alpine:3.20
6+
7+
COPY --from=builder /usr/local/bin/op-batcher /usr/local/bin/op-batcher
8+
9+
EXPOSE 8545 8546 7300 6060 9090
10+
11+
CMD ["op-batcher"]

package.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"name": "optimism",
3+
"version": "1.0.0",
4+
"description": "Optimism is Ethereum, scaled.",
5+
"main": "index.js",
6+
"scripts": {
7+
"clean": "pnpm clean:workspaces && pnpm clean:node_modules",
8+
"clean:workspaces": "pnpm --filter \"./packages/**\" clean",
9+
"clean:node_modules": "rm -rf node_modules/",
10+
"build": "pnpm build:packages",
11+
"build:packages": "pnpm --filter \"./packages/**\" build",
12+
"build:fresh": "pnpm clean && pnpm install && pnpm build",
13+
"start": "pnpm --filter \"./packages/**\" start",
14+
"test": "pnpm --filter \"./packages/**\" test",
15+
"test:coverage": "pnpm --filter \"./packages/**\" test:coverage",
16+
"lint": "pnpm lint:packages",
17+
"lint:packages": "pnpm --filter \"./packages/**\" lint",
18+
"lint:fix": "pnpm --filter \"./packages/**\" lint:fix",
19+
"changeset": "changeset",
20+
"changeset:version": "changeset version && pnpm install --lockfile-only",
21+
"changeset:publish": "pnpm build && changeset publish"
22+
},
23+
"workspaces": [
24+
"packages/*"
25+
],
26+
"devDependencies": {
27+
"@babel/eslint-parser": "^7.23.3",
28+
"@changesets/changelog-github": "^0.4.8",
29+
"@changesets/cli": "^2.26.2",
30+
"@types/chai": "^4.3.6",
31+
"@types/mocha": "^10.0.2",
32+
"@types/node": "^20.10.4",
33+
"@typescript-eslint/eslint-plugin": "^6.13.2",
34+
"@typescript-eslint/parser": "^6.13.2",
35+
"chai": "^4.3.10",
36+
"depcheck": "^1.4.7",
37+
"doctoc": "^2.2.0",
38+
"eslint": "^8.57.0",
39+
"eslint-config-prettier": "^9.1.0",
40+
"eslint-config-standard": "^16.0.3",
41+
"eslint-plugin-import": "^2.29.0",
42+
"eslint-plugin-jsdoc": "^35.1.2",
43+
"eslint-plugin-node": "^11.1.0",
44+
"eslint-plugin-prefer-arrow": "^1.2.3",
45+
"eslint-plugin-prettier": "^4.0.0",
46+
"eslint-plugin-promise": "^5.1.0",
47+
"eslint-plugin-react": "^7.24.0",
48+
"eslint-plugin-unicorn": "^49.0.0",
49+
"husky": "^8.0.3",
50+
"mocha": "^10.2.0",
51+
"prettier": "^2.8.8",
52+
"solhint": "^3.4.1",
53+
"ts-node": "^10.9.1",
54+
"typescript": "^5.3.3"
55+
},
56+
"engines": {
57+
"node": ">=16.0.0",
58+
"pnpm": ">=8.0.0"
59+
},
60+
"packageManager": "pnpm@8.15.1"
61+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@eth-optimism/contracts-bedrock",
3+
"version": "0.17.2",
4+
"description": "Optimism Bedrock smart contracts",
5+
"main": "forge-artifacts",
6+
"scripts": {
7+
"build": "pnpm compile",
8+
"build:forge": "forge build",
9+
"build:go-ffi": "cd ./scripts/go-ffi && go build",
10+
"clean": "rm -rf ./artifacts ./forge-artifacts ./cache ./scripts/go-ffi/go-ffi ./deployments/hardhat/*",
11+
"pre-pr": "pnpm clean && pnpm build && pnpm autogen:invariant-docs && pnpm test && pnpm lint:check",
12+
"compile": "forge build",
13+
"test": "forge test",
14+
"test:coverage": "forge coverage",
15+
"test:fuzz": "forge test --fuzz-runs 512",
16+
"deploy": "forge script",
17+
"deploy:devnetL1": "forge script scripts/Deploy.s.sol:Deploy --sig 'deployL1()' --rpc-url http://localhost:8545 --broadcast --private-key 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97",
18+
"slither": "./scripts/slither.sh",
19+
"clean:slither": "rm -rf crytic-export/",
20+
"storage-snapshot": "./scripts/storage-snapshot.sh",
21+
"storage-snapshot:check": "./scripts/storage-snapshot.sh --check",
22+
"validate:codegen": "./scripts/validate-codegen.sh",
23+
"validate:deploy": "./scripts/validate-deploy.sh",
24+
"gas-snapshot": "forge snapshot --no-storage-caching --isolate --optimize --optimizer-runs 999999",
25+
"gas-snapshot:check": "forge snapshot --no-storage-caching --isolate --optimize --optimizer-runs 999999 --check",
26+
"autogen:invariant-docs": "ts-node scripts/autogen/generate-invariant-docs.ts",
27+
"semver-lock": "forge script scripts/SemverLock.s.sol",
28+
"validate:spacers": "forge build && go run ./scripts/checks/spacers",
29+
"validate:deploy-configs": "./scripts/checks/check-deploy-configs.sh",
30+
"lint:ts:check": "eslint . --max-warnings=0",
31+
"lint:contracts:check": "forge fmt --check",
32+
"lint:check": "pnpm lint:contracts:check && pnpm lint:ts:check",
33+
"lint:ts:fix": "eslint --fix .",
34+
"lint:contracts:fix": "forge fmt",
35+
"lint:fix": "pnpm lint:contracts:fix && pnpm lint:ts:fix",
36+
"lint": "pnpm lint:fix && pnpm lint:check",
37+
"typechain": "typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'",
38+
"echidna:aliasing": "echidna-test --contract EchidnaFuzzAddressAliasing --config ./echidna.yaml .",
39+
"echidna:burn:gas": "echidna-test --contract EchidnaFuzzBurnGas --config ./echidna.yaml .",
40+
"echidna:burn:eth": "echidna-test --contract EchidnaFuzzBurnEth --config ./echidna.yaml .",
41+
"echidna:encoding": "echidna-test --contract EchidnaFuzzEncoding --config ./echidna.yaml .",
42+
"echidna:portal": "echidna-test --contract EchidnaFuzzOptimismPortal --config ./echidna.yaml .",
43+
"echidna:hashing": "echidna-test --contract EchidnaFuzzHashing --config ./echidna.yaml .",
44+
"echidna:metering": "echidna-test --contract EchidnaFuzzResourceMetering --config ./echidna.yaml ."
45+
},
46+
"dependencies": {
47+
"@eth-optimism/core-utils": "^0.12.0",
48+
"@openzeppelin/contracts": "4.7.3",
49+
"@openzeppelin/contracts-upgradeable": "4.7.3",
50+
"ethers": "^5.7.0",
51+
"hardhat": "^2.9.8"
52+
},
53+
"devDependencies": {
54+
"@typescript-eslint/eslint-plugin": "^6.13.2",
55+
"@typescript-eslint/parser": "^6.13.2",
56+
"eslint": "^8.57.0",
57+
"eslint-config-prettier": "^9.1.0",
58+
"eslint-plugin-import": "^2.29.0",
59+
"eslint-plugin-prettier": "^4.0.0",
60+
"prettier": "^2.8.8",
61+
"ts-node": "^10.9.1",
62+
"typescript": "^5.3.3"
63+
}
64+
}

0 commit comments

Comments
 (0)