Skip to content

Commit be35fde

Browse files
committed
Add initial commit
0 parents  commit be35fde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+27038
-0
lines changed

.gas-snapshot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CounterTest:testFuzz_SetNumber(uint256) (runs: 500, μ: 30950, ~: 31229)
2+
CounterTest:test_Increment() (gas: 31239)

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.sol linguist-language=Solidity
2+
.gas-snapshot linguist-language=Julia

.github/workflows/analyze.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Static Analysis
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
analyze:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Install Foundry
13+
uses: foundry-rs/foundry-toolchain@v1
14+
15+
- name: Check Foundry version
16+
run: |
17+
forge --version
18+
19+
- name: Install Slither
20+
run: pip install slither-analyzer==0.10.0
21+
22+
- name: Run Slither
23+
run: slither .

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Install Foundry
13+
uses: foundry-rs/foundry-toolchain@v1
14+
15+
- name: Check Foundry version
16+
run: |
17+
forge --version
18+
19+
- name: Install dependencies
20+
run: forge install
21+
22+
- name: Check contract sizes
23+
run: forge build --sizes
24+
25+
- name: Check gas snapshots
26+
run: forge snapshot --check

.github/workflows/lint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Install Foundry
13+
uses: foundry-rs/foundry-toolchain@v1
14+
15+
- name: Check formatting
16+
run: forge fmt --check

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Install Foundry
13+
uses: foundry-rs/foundry-toolchain@v1
14+
15+
- name: Install dependencies
16+
run: forge install
17+
18+
- name: Run tests
19+
run: forge test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/cache
2+
/node_modules
3+
/out

.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

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# sol-template
2+
3+
[![Build](https://github.com/0xmichalis/sol-template/actions/workflows/build.yml/badge.svg)](https://github.com/0xmichalis/sol-template/actions/workflows/build.yml) [![Tests](https://github.com/0xmichalis/sol-template/actions/workflows/test.yml/badge.svg)](https://github.com/0xmichalis/sol-template/actions/workflows/test.yml) [![Lint](https://github.com/0xmichalis/sol-template/actions/workflows/lint.yml/badge.svg)](https://github.com/0xmichalis/sol-template/actions/workflows/lint.yml) [![Static analysis](https://github.com/0xmichalis/sol-template/actions/workflows/analyze.yml/badge.svg)](https://github.com/0xmichalis/sol-template/actions/workflows/analyze.yml)
4+
5+
Barebones template to get started with Solidity projects.
6+
7+
## Install
8+
9+
```sh
10+
git clone https://github.com/0xmichalis/sol-template.git
11+
cd sol-template
12+
forge install
13+
```
14+
15+
## Build
16+
17+
```sh
18+
forge build
19+
```
20+
21+
## Test
22+
23+
```sh
24+
forge test
25+
```
26+
27+
## Update Gas Snapshot
28+
29+
```sh
30+
forge snapshot
31+
```

foundry.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[profile.default]
2+
optimizer_runs = 1000000
3+
libs = ['node_modules', 'lib']
4+
5+
[fuzz]
6+
runs = 500
7+
fail_on_revert = false
8+
show_metrics = true
9+
10+
[fmt]
11+
line_length = 100

0 commit comments

Comments
 (0)