Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
508084c
feat: slack notification support
PraneshASP Mar 6, 2025
99a8463
feat: use slack bot instad of webhook
bernacodesido Mar 10, 2025
e2f0d50
feat: add rootstock mainnet and testnet
bernacodesido Mar 7, 2025
5a76ac3
feat: add descriptor/name to safe addresses
bernacodesido Mar 7, 2025
fcc968a
feat: print multisig descriptor
bernacodesido Mar 10, 2025
b3da583
feat: decouple container
bernacodesido Apr 10, 2025
044030f
feat: clean yarn.lock
bernacodesido Apr 10, 2025
0010b38
feat: prepare the repo to be moved
bernacodesido Apr 10, 2025
c51136b
feat: configure dependabot
bernacodesido Apr 10, 2025
3f75243
feat: configure codeQL
bernacodesido Apr 10, 2025
c8e80c3
feat: configure dependency review
bernacodesido Apr 10, 2025
1ea3fe7
feat: configure scorecard
bernacodesido Apr 10, 2025
7989a2a
fix: codeql action
bernacodesido Apr 11, 2025
5c1c538
fix: dependency review action
bernacodesido Apr 11, 2025
e6a2c3a
fix: lint pr title action
bernacodesido Apr 11, 2025
d8287a5
fix: pr check action
bernacodesido Apr 11, 2025
0777357
fix: release action
bernacodesido Apr 11, 2025
4f00704
fix: update checkout action in scorecard
bernacodesido Apr 11, 2025
2f9d290
fix: TS2322
bernacodesido Apr 11, 2025
6d19fb8
fix: TS2322
bernacodesido Apr 14, 2025
c984572
fix: TS2739, TS7053, TS2420
bernacodesido Apr 11, 2025
3fde770
fix: Ignore errors
bernacodesido Apr 14, 2025
46218e9
firx: run prettier
bernacodesido Apr 14, 2025
04b8e5d
build(deps-dev): bump esbuild from 0.24.2 to 0.25.0
dependabot[bot] Apr 14, 2025
66a3463
feat: deploy into AWS ECR
bernacodesido Apr 10, 2025
c21c7aa
feat: detect if running on ECS
bernacodesido Apr 10, 2025
449434e
feat: retrieve secrets from AWS Secret Manager
bernacodesido Apr 15, 2025
af84279
feat: dynamodb
bernacodesido May 6, 2025
d071716
fix: modify trigger
bernacodesido May 7, 2025
4e7ee4b
fix: address review comments
bernacodesido May 7, 2025
f5c6a39
fix: fix yarn.lock file
bernacodesido May 7, 2025
ed40c56
feat: add logs to healthcheck
bernacodesido May 9, 2025
44ff570
fix: change container, add curl
bernacodesido May 12, 2025
bf01f4c
fix: check if ECS
bernacodesido May 9, 2025
7dff54d
fix: fix safe_adressess from aws dynamodb
bernacodesido May 13, 2025
d2d2c80
feat: integrate safe-tx-hashes
bernacodesido Apr 15, 2025
e479fe0
feat: use and notify safe tx hashes
bernacodesido Apr 16, 2025
87eeb8d
feat: update Dockerfile to run safe-tx-hashes
bernacodesido Apr 16, 2025
d23a96d
feat: include method and parameters
bernacodesido May 13, 2025
f2f2fb7
fix: fix script name
bernacodesido May 14, 2025
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
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

# Maintain dependencies for Docker
- package-ecosystem: docker
directory: /
schedule:
interval: daily

# Maintain dependencies for npm and yarn
- package-ecosystem: npm
directory: /
schedule:
interval: daily
47 changes: 47 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "CodeQL"

on:
push:
branches: ["rootstock", "main"]
pull_request:
branches: ["rootstock", "main"]
schedule:
- cron: "0 0 * * *"

permissions: read-all

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [javascript]

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2

- name: Before Index (java)
if: ${{ matrix.language == 'java' }}
run: ./configure.sh

- name: Initialize CodeQL
uses: github/codeql-action/init@5973e2313ac1b9aaedb1f911a1e91228cde07d28 # v2.26.0
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@5973e2313ac1b9aaedb1f911a1e91228cde07d28 # v2.26.0

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5973e2313ac1b9aaedb1f911a1e91228cde07d28 # v2.26.0
with:
category: "/language:${{ matrix.language }}"
21 changes: 21 additions & 0 deletions .github/workflows/dependency_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Dependency Review"

on: [pull_request]

permissions: read-all

jobs:
dependency-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: "Checkout Repository"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2

- name: "Dependency Review"
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
with:
fail-on-severity: high
comment-summary-in-pr: true
85 changes: 85 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Deploy to Amazon ECS

on:
release:
types: [created, edited, published]

permissions: read-all

env:
IMAGE_NAME: safe-watcher
IMAGE_TAG: ${{ github.sha }}

jobs:
build-and-deploy:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 #v3.10.0

- name: Generate local image name
id: generate-local-img-name
run: |
echo "image-name=${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" \
>> $GITHUB_OUTPUT

- name: Build and tag Container image
id: build-image
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 #v6.16.0
with:
tags: ${{ steps.generate-local-img-name.outputs.image-name }}
file: Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 1200

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 #v2.0.1

- name: Generate image name
id: generate-img-name
run: |
echo "image-name=${{ steps.login-ecr.outputs.registry }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" \
>> $GITHUB_OUTPUT

- name: Rebuild, tag and push Container image
id: rebuild--push-image
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 #v6.16.0
with:
push: true
tags: ${{ steps.generate-img-name.outputs.image-name }}
file: Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@e89b6874818d80bb892e7010a5013519bde9d9a6 #v1.7.2
with:
task-definition-arn: ${{ secrets.AWS_ECS_TASK_DEFINITION_ARN }}
container-name: ${{ secrets.AWS_ECS_CONTAINER_NAME }}
image: ${{ steps.generate-img-name.outputs.image-name }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@538b32884c2bf327057c6805f0315e5ee92102cc #v2.3.2
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ secrets.AWS_ECS_SERVICE }}
cluster: ${{ secrets.AWS_ECS_CLUSTER }}
wait-for-service-stability: true
4 changes: 3 additions & 1 deletion .github/workflows/lint_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:
- edited
- synchronize

permissions: read-all

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 #v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
types: [opened, reopened, synchronize]

permissions: read-all

env:
HUSKY: 0
CI: true
Expand All @@ -13,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0
submodules: true
Expand All @@ -25,7 +27,7 @@ jobs:
echo "After : corepack version => $(corepack --version)"
corepack enable

- uses: actions/setup-node@v4
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e #v4.3.0
with:
cache: "yarn"
node-version-file: ".nvmrc"
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: Release
on:
push:
branches:
- "main"
- "next"
- "rootstock"
workflow_dispatch:

permissions: read-all

env:
HUSKY: 0
CI: true
Expand All @@ -16,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0
submodules: true
Expand All @@ -28,7 +29,7 @@ jobs:
echo "After : corepack version => $(corepack --version)"
corepack enable

- uses: actions/setup-node@v4
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e #v4.3.0
with:
cache: "yarn"
node-version-file: ".nvmrc"
Expand All @@ -40,15 +41,8 @@ jobs:
- name: Build
run: yarn build

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@0a51e81a6baff2acad3ee88f4121c589c73d0f0e #v4.2.0
with:
extra_plugins: |
@codedependant/semantic-release-docker
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: "33 2 * * 2"
push:
branches: ["rootstock"]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
with:
sarif_file: results.sarif
27 changes: 25 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
FROM gcr.io/distroless/nodejs22-debian12
FROM node:23 AS build

WORKDIR /app
COPY package.json /app/

RUN npm install

COPY . /app
RUN npm run build

FROM node:23-alpine

# Update packages and install dependencies
RUN apk --no-cache add curl jq xxd

# Set the default shell to zsh
ENV SHELL=/usr/bin/zsh
SHELL ["/usr/bin/zsh", "-c"]

USER 1000:1000

Expand All @@ -9,6 +26,12 @@ ENV NODE_ENV=production
ARG PACKAGE_VERSION
LABEL org.opencontainers.image.version="${PACKAGE_VERSION}"

COPY dist /app
COPY --from=build /app/dist /app

COPY src/safe-hashes/safe_hashes.sh /app/safe-hashes.sh

# Copy foundry tools
COPY --from=ghcr.io/foundry-rs/foundry:stable /usr/local/bin/chisel /usr/local/bin/chisel
COPY --from=ghcr.io/foundry-rs/foundry:stable /usr/local/bin/cast /usr/local/bin/cast

CMD ["/app/index.mjs"]
2 changes: 1 addition & 1 deletion config.example.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
telegramBotToken: "xxxx"
telegramChannelId: "-1111"
safeAddresses:
- "eth:0x11111"
- "desc: eth:0x11111"
signers:
"0x22222": "alice"
"0x33333": "bob"
Loading
Loading