Skip to content

Commit

Permalink
chore: init from https://github.com/settlemint/solidity-empty at e94314e
Browse files Browse the repository at this point in the history
  • Loading branch information
bl0up committed Mar 27, 2024
0 parents commit 4353add
Show file tree
Hide file tree
Showing 19 changed files with 668 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Add your Etherscan (or altrnative network variant) to verify your smart contract on Etherscam
ETHERSCAN_API_KEY=

## Override the default --from address when deploying on BTP
# ETH_FROM=0x0000000000000000000000000000000000000000
15 changes: 15 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: v1

labels:
- label: 'feat'
matcher:
title: '^feat:.*'
- label: 'fix'
matcher:
title: '^fix:.*'
- label: 'chore'
matcher:
title: '^chore:.*'
- label: 'docs'
matcher:
title: '^docs:.*'
20 changes: 20 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: Exciting New Features 🎉
labels:
- feat
- title: Important Bug Fixes 🐛
labels:
- fix
- title: Documentation 📚
labels:
- docs
- title: Other changes 🏗️
labels:
- chore
- title: Dependencies 📦
labels:
- dependencies
28 changes: 28 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":automergeMinor",
":automergePr",
":automergeRequireAllStatusChecks",
":gitSignOff",
":pinVersions",
":semanticCommits",
":semanticCommitTypeAll(chore)",
":enableVulnerabilityAlerts",
":combinePatchMinorReleases",
":prConcurrentLimitNone",
":prHourlyLimitNone",
"security:openssf-scorecard",
"schedule:nonOfficeHours",
":disableDependencyDashboard"
],
"labels": ["dependencies"],
"rebaseWhen": "conflicted",
"packageRules": [],
"hostRules": [
{
"timeout": 3000000
}
]
}
110 changes: 110 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Branch

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*"

env:
FOUNDRY_PROFILE: ci

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: namespace-profile-foundry
steps:
- name: Checkout
uses: namespacelabs/nscloud-checkout-action@v2
with:
submodules: recursive

- name: Setup caches
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
cache
out
~/.foundry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/settlemint/solidity-empty
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push
uses: docker/build-push-action@v5
with:
load: false
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
28 changes: 28 additions & 0 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Labels

on:
pull_request:
types: [opened, closed]
branches:
- main

permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@v4
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env

# Subgraphs
deployment.txt
deployment-anvil.txt
subgraph/subgraph.config.json
subgraph/node_modules
subgraph/generated
subgraph/build

.pnpm
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"nomicfoundation.hardhat-solidity",
"miguelsolorio.fluent-icons",
"vscode-icons-team.vscode-icons",
"genieai.chatgpt-vscode",
"esbenp.prettier-vscode",
"dracula-theme.theme-dracula",
"cnshenj.vscode-task-manager"
]
}
102 changes: 102 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "test",
"type": "shell",
"command": "make test",
"group": "test",
"problemMatcher": []
},
{
"label": "format",
"type": "shell",
"command": "make format",
"problemMatcher": []
},
{
"label": "snapshot",
"type": "shell",
"command": "make snapshot",
"problemMatcher": []
},
{
"label": "anvil",
"type": "shell",
"command": "make anvil",
"problemMatcher": []
},
{
"label": "deploy-anvil",
"type": "shell",
"command": "make deploy-anvil",
"problemMatcher": []
},
{
"label": "deploy-btp",
"type": "shell",
"command": "EXTRA_ARGS=\"${input:extra-deployment-verify} ${input:extra-deployment-other}\" make deploy-btp",
"problemMatcher": []
},
{
"label": "script-anvil",
"type": "shell",
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script-anvil",
"problemMatcher": []
},
{
"label": "script",
"type": "shell",
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script",
"problemMatcher": []
},
{
"label": "help",
"type": "shell",
"command": "make help",
"problemMatcher": []
}
],
"inputs": [
{
"id": "extra-deployment-verify",
"description": "Extra deployment options?",
"default": "",
"type": "pickString",
"options": [
"",
"--verify --verifier sourcify",
"--verify --verifier etherscan --etherscan-api-key ${ETHERSCAN_API_KEY}"
]
},
{
"id": "extra-deployment-other",
"description": "Other extra deployment options?",
"default": "",
"type": "promptString"
},
{
"id": "extra-script-broadcast",
"description": "Broadcast?",
"default": "",
"type": "pickString",
"options": ["", "--broadcast"]
},
{
"id": "extra-script-other",
"description": "Other extra script options?",
"default": "",
"type": "promptString"
}
]
}
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:20.11.1-bookworm as build

ENV FOUNDRY_DIR /usr/local
RUN curl -L https://foundry.paradigm.xyz | bash && \
/usr/local/bin/foundryup

WORKDIR /

RUN git config --global user.email "hello@settlemint.com" && \
git config --global user.name "SettleMint" && \
forge init usecase --template settlemint/solidity-empty && \
cd usecase && \
forge build

USER root

FROM busybox

COPY --from=build /usecase /usecase
COPY --from=build /root/.svm /usecase-svm
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 SettleMint

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 4353add

Please sign in to comment.