Skip to content

Commit 5081255

Browse files
committed
chore: forge init
0 parents  commit 5081255

19 files changed

+687
-0
lines changed

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Add your Etherscan (or altrnative network variant) to verify your smart contract on Etherscam
2+
ETHERSCAN_API_KEY=
3+
4+
## Override the default --from address when deploying on BTP
5+
# ETH_FROM=0x0000000000000000000000000000000000000000

.github/labeler.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: v1
2+
3+
labels:
4+
- label: 'feat'
5+
matcher:
6+
title: '^feat:.*'
7+
- label: 'fix'
8+
matcher:
9+
title: '^fix:.*'
10+
- label: 'chore'
11+
matcher:
12+
title: '^chore:.*'
13+
- label: 'docs'
14+
matcher:
15+
title: '^docs:.*'

.github/release.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- renovate
5+
categories:
6+
- title: Breaking Changes 🛠
7+
labels:
8+
- breaking-change
9+
- title: Exciting New Features 🎉
10+
labels:
11+
- feat
12+
- title: Important Bug Fixes 🐛
13+
labels:
14+
- fix
15+
- title: Documentation 📚
16+
labels:
17+
- docs
18+
- title: Other changes 🏗️
19+
labels:
20+
- chore
21+
- title: Dependencies 📦
22+
labels:
23+
- dependencies

.github/renovate.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
":automergeMinor",
6+
":automergePr",
7+
":automergeRequireAllStatusChecks",
8+
":gitSignOff",
9+
":pinVersions",
10+
":semanticCommits",
11+
":semanticCommitTypeAll(chore)",
12+
":enableVulnerabilityAlerts",
13+
":combinePatchMinorReleases",
14+
":prConcurrentLimitNone",
15+
":prHourlyLimitNone",
16+
"security:openssf-scorecard",
17+
"schedule:nonOfficeHours"
18+
],
19+
"labels": ["dependencies"],
20+
"rebaseWhen": "conflicted",
21+
"packageRules": [],
22+
"hostRules": [
23+
{
24+
"timeout": 3000000
25+
}
26+
]
27+
}

.github/workflows/branch.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Branch
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
tags:
11+
- "v*"
12+
13+
env:
14+
FOUNDRY_PROFILE: ci
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
actions: write
22+
checks: write
23+
contents: write
24+
deployments: write
25+
id-token: write
26+
issues: write
27+
discussions: write
28+
packages: write
29+
pages: write
30+
pull-requests: write
31+
repository-projects: write
32+
security-events: write
33+
statuses: write
34+
35+
jobs:
36+
check:
37+
strategy:
38+
fail-fast: true
39+
40+
name: Foundry project
41+
runs-on: namespace-profile-foundry
42+
steps:
43+
- name: Checkout
44+
uses: namespacelabs/nscloud-checkout-action@v2
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup caches
49+
uses: namespacelabs/nscloud-cache-action@v1
50+
with:
51+
path: |
52+
cache
53+
out
54+
~/.foundry
55+
56+
- name: Login to GitHub Container Registry
57+
uses: docker/login-action@v3
58+
with:
59+
registry: ghcr.io
60+
username: ${{ github.repository_owner }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Login to DockerHub
64+
uses: docker/login-action@v3
65+
with:
66+
username: ${{ secrets.DOCKERHUB_USER }}
67+
password: ${{ secrets.DOCKERHUB_PASS }}
68+
69+
- name: Install Foundry
70+
uses: foundry-rs/foundry-toolchain@v1
71+
with:
72+
version: nightly
73+
74+
- name: Run Forge build
75+
run: |
76+
forge --version
77+
forge build --sizes
78+
id: build
79+
80+
- name: Run Forge tests
81+
run: |
82+
forge test -vvv
83+
id: test
84+
85+
- name: Docker meta
86+
id: meta
87+
uses: docker/metadata-action@v5
88+
with:
89+
# list of Docker images to use as base name for tags
90+
images: |
91+
ghcr.io/settlemint/solidity-empty
92+
# generate Docker tags based on the following events/attributes
93+
tags: |
94+
type=schedule
95+
type=ref,event=branch
96+
type=ref,event=pr
97+
type=semver,pattern={{version}}
98+
type=semver,pattern={{major}}.{{minor}}
99+
type=semver,pattern={{major}}
100+
type=sha
101+
102+
- name: Build and push
103+
uses: docker/build-push-action@v5
104+
with:
105+
platforms: linux/amd64,linux/arm64
106+
push: ${{ github.event_name != 'pull_request' }}
107+
tags: ${{ steps.meta.outputs.tags }}
108+
labels: ${{ steps.meta.outputs.labels }}
109+
no-cache: true

.github/workflows/pr-labels.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR Labels
2+
3+
on:
4+
pull_request:
5+
types: [opened, closed]
6+
branches:
7+
- main
8+
9+
permissions:
10+
actions: write
11+
checks: write
12+
contents: write
13+
deployments: write
14+
id-token: write
15+
issues: write
16+
discussions: write
17+
packages: write
18+
pages: write
19+
pull-requests: write
20+
repository-projects: write
21+
security-events: write
22+
statuses: write
23+
24+
jobs:
25+
labels:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: fuxingloh/multi-labeler@v4

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compiler files
2+
cache/
3+
out/
4+
5+
# Ignores development broadcast logs
6+
!/broadcast
7+
/broadcast/*/31337/
8+
/broadcast/**/dry-run/
9+
10+
# Docs
11+
docs/
12+
13+
# Dotenv file
14+
.env
15+
16+
# Subgraphs
17+
deployment.txt
18+
deployment-anvil.txt
19+
subgraph/subgraph.config.json
20+
subgraph/node_modules
21+
subgraph/generated
22+
subgraph/build
23+
24+
.pnpm

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib/forge-std"]
2+
path = lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std

.vscode/extensions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"nomicfoundation.hardhat-solidity",
4+
"miguelsolorio.fluent-icons",
5+
"vscode-icons-team.vscode-icons",
6+
"genieai.chatgpt-vscode",
7+
"esbenp.prettier-vscode",
8+
"dracula-theme.theme-dracula",
9+
"cnshenj.vscode-task-manager"
10+
]
11+
}

.vscode/tasks.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"type": "shell",
7+
"command": "make build",
8+
"group": {
9+
"kind": "build",
10+
"isDefault": true
11+
},
12+
"problemMatcher": []
13+
},
14+
{
15+
"label": "test",
16+
"type": "shell",
17+
"command": "make test",
18+
"group": "test",
19+
"problemMatcher": []
20+
},
21+
{
22+
"label": "format",
23+
"type": "shell",
24+
"command": "make format",
25+
"problemMatcher": []
26+
},
27+
{
28+
"label": "snapshot",
29+
"type": "shell",
30+
"command": "make snapshot",
31+
"problemMatcher": []
32+
},
33+
{
34+
"label": "anvil",
35+
"type": "shell",
36+
"command": "make anvil",
37+
"problemMatcher": []
38+
},
39+
{
40+
"label": "deploy-anvil",
41+
"type": "shell",
42+
"command": "make deploy-anvil",
43+
"problemMatcher": []
44+
},
45+
{
46+
"label": "deploy",
47+
"type": "shell",
48+
"command": "EXTRA_ARGS=\"${input:extra-deployment-verify} ${input:extra-deployment-other}\" make deploy",
49+
"problemMatcher": []
50+
},
51+
{
52+
"label": "script-anvil",
53+
"type": "shell",
54+
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script-anvil",
55+
"problemMatcher": []
56+
},
57+
{
58+
"label": "script",
59+
"type": "shell",
60+
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script",
61+
"problemMatcher": []
62+
},
63+
{
64+
"label": "cast",
65+
"type": "shell",
66+
"command": "make cast",
67+
"problemMatcher": []
68+
},
69+
{
70+
"label": "subgraph",
71+
"type": "shell",
72+
"command": "make subgraph",
73+
"problemMatcher": []
74+
},
75+
{
76+
"label": "help",
77+
"type": "shell",
78+
"command": "make help",
79+
"problemMatcher": []
80+
}
81+
],
82+
"inputs": [
83+
{
84+
"id": "extra-deployment-verify",
85+
"description": "Extra deployment options?",
86+
"default": "",
87+
"type": "pickString",
88+
"options": [
89+
"",
90+
"--verify --verifier sourcify",
91+
"--verify --verifier etherscan --etherscan-api-key ${ETHERSCAN_API_KEY}"
92+
]
93+
},
94+
{
95+
"id": "extra-deployment-other",
96+
"description": "Other extra deployment options?",
97+
"default": "",
98+
"type": "promptString"
99+
},
100+
{
101+
"id": "extra-script-broadcast",
102+
"description": "Broadcast?",
103+
"default": "",
104+
"type": "pickString",
105+
"options": ["", "--broadcast"]
106+
},
107+
{
108+
"id": "extra-script-other",
109+
"description": "Other extra script options?",
110+
"default": "",
111+
"type": "promptString"
112+
}
113+
]
114+
}

0 commit comments

Comments
 (0)