Skip to content

Commit 8f26f4e

Browse files
committed
added ci/cd repo
0 parents  commit 8f26f4e

File tree

940 files changed

+268199
-0
lines changed

Some content is hidden

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

940 files changed

+268199
-0
lines changed

.DS_Store

8 KB
Binary file not shown.

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FOUNDRY_FUZZ_SEED=0x4444

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sol linguist-language=Solidity

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @uniswap/protocols
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bug report
2+
description: File a bug report to help us improve the code
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Please check that the bug is not already being tracked.
11+
- type: textarea
12+
attributes:
13+
label: Describe the bug
14+
description: Provide a clear and concise description of what the bug is and which contracts it affects.
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: Expected Behavior
20+
description: Provide a clear and concise description of the desired fix.
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: To Reproduce
26+
description: If you have written tests to showcase the bug, what can we run to reproduce the issue?
27+
placeholder: "git checkout <branchname> / forge test --isolate --mt <testName>"
28+
- type: textarea
29+
attributes:
30+
label: Additional context
31+
description: If there is any additional context needed like a dependency or integrating contract that is affected please describe it below.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Feature Improvement
2+
description: Suggest an improvement to v4-core.
3+
labels: ["triage"]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please ensure that the feature has not already been requested.
10+
- type: dropdown
11+
attributes:
12+
label: Component
13+
description: Which area of code does your idea improve?
14+
multiple: true
15+
options:
16+
- Hooks
17+
- Singleton
18+
- Lock and Call
19+
- Delta accounting
20+
- 1155 Balances
21+
- Pool Actions (swap, modifyLiquidity, donate, take, settle, mint)
22+
- Gas Optimization
23+
- General design optimization (improving efficiency, cleanliness, or developer experience)
24+
- Documentation
25+
- type: textarea
26+
attributes:
27+
label: Describe the suggested feature and problem it solves.
28+
description: Provide a clear and concise description of what feature you would like to see, and what problems it solves.
29+
validations:
30+
required: true
31+
- type: textarea
32+
attributes:
33+
label: Describe the desired implementation.
34+
description: If possible, provide a suggested architecture change or implementation.
35+
- type: textarea
36+
attributes:
37+
label: Describe alternatives.
38+
description: If possible, describe the alternatives you've considered, or describe the current functionality and how it may be sub-optimal.
39+
- type: textarea
40+
attributes:
41+
label: Additional context.
42+
description: Please list any additional dependencies or integrating contacts that are affected.

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Related Issue
2+
3+
Which issue does this pull request resolve?
4+
5+
## Description of changes

.github/workflows/buildbear.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: V4-Core-Workflow
2+
3+
on: [push]
4+
5+
# Workflow
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
17+
- name: Install Rust
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
override: true
22+
23+
# Cache Foundry repository
24+
- name: Cache Foundry repository
25+
uses: actions/cache@v3
26+
with:
27+
path: foundry
28+
key: ${{ runner.os }}-foundry-${{ hashFiles('**/foundry/.gitmodules') }}
29+
restore-keys: |
30+
${{ runner.os }}-foundry-
31+
32+
# Cache build artifacts
33+
- name: Cache build artifacts
34+
uses: actions/cache@v3
35+
with:
36+
path: $HOME/.config/.foundry/bin
37+
key: ${{ runner.os }}-forge-${{ hashFiles('foundry/Cargo.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-forge-
40+
41+
- name: Clone Foundry repository
42+
run: |
43+
if [ ! -d "foundry" ]; then
44+
git clone https://github.com/BuildBearLabs/foundry.git
45+
fi
46+
shell: bash
47+
48+
- name: Build Foundry from source
49+
run: |
50+
cd foundry
51+
cargo build
52+
mkdir -p $HOME/.config/.foundry/bin
53+
cp target/debug/forge $HOME/.config/.foundry/bin/
54+
echo "PATH=$HOME/.config/.foundry/bin:$PATH" >> $GITHUB_ENV
55+
shell: bash
56+
57+
- name: Show Forge version
58+
run: forge --version
59+
60+
- name: Make bbOut dir
61+
run: mkdir bbOut
62+
shell: bash
63+
64+
- name: Run BB Action Test
65+
run: forge test
66+
67+
- name: test_ci
68+
uses: BuildBearLabs/[email protected]
69+
with:
70+
network: |
71+
[
72+
{
73+
"chainId": 1
74+
}
75+
]
76+
77+
deploy-command: "make exe"
78+
buildbear-api-key: "${{secrets.BUILDBEAR_API_KEY}}"

.github/workflows/deploy.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
on:
3+
# manual trigger
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy:
8+
name: release
9+
runs-on:
10+
group: npm-deploy
11+
environment:
12+
name: release
13+
permissions:
14+
id-token: write
15+
contents: write
16+
steps:
17+
- name: Load secret
18+
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0
19+
with:
20+
# Export loaded secrets as environment variables
21+
export-env: true
22+
env:
23+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
24+
# You may need to change this to your vault name and secret name
25+
# Refer to it by calling env.NPM_TOKEN
26+
# This token is also limited by IP to ONLY work on the runner
27+
NPM_TOKEN: op://npm-deploy/npm-runner-token/secret
28+
29+
- name: Checkout
30+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
31+
32+
- name: Setup Node
33+
uses: actions/[email protected]
34+
with:
35+
node-version: "20.x"
36+
registry-url: "https://registry.npmjs.org"
37+
scope: "@uniswap"
38+
39+
- name: Install Foundry
40+
uses: foundry-rs/foundry-toolchain@v1
41+
with:
42+
version: stable
43+
44+
- name: Install dependencies
45+
run: |
46+
git submodule update --init --recursive
47+
48+
- name: Compile
49+
run: forge build
50+
51+
- name: Release
52+
env:
53+
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
npm set "//registry.npmjs.org/:_authToken" ${{ env.NPM_TOKEN }}
57+
npm publish --provenance --access public

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
run-linters:
11+
name: Run linters
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out Git repository
16+
uses: actions/checkout@v3
17+
18+
- name: Install Foundry
19+
uses: foundry-rs/foundry-toolchain@v1
20+
with:
21+
version: stable
22+
23+
- name: Lint
24+
run: forge fmt --check
25+
26+
- uses: actions/cache@v3
27+
name: Configure npm caching
28+
with:
29+
path: ~/.npm
30+
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/prettier.yml') }}
31+
restore-keys: |
32+
${{ runner.os }}-npm-
33+
34+
- name: Check code formatting
35+
run: |-
36+
npx prettier --check .

0 commit comments

Comments
 (0)