Skip to content

Commit bf44771

Browse files
authored
Merge pull request #357 from LIT-Protocol/feature/morpho-fee
Fee Diamond Contract with Morpho and Aave
2 parents 9a42afa + eebe37d commit bf44771

38 files changed

+4187
-486
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
pull_request:
8+
workflow_dispatch:
89

910
permissions:
1011
actions: read
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
env:
11+
FOUNDRY_PROFILE: ci
12+
13+
jobs:
14+
check:
15+
strategy:
16+
fail-fast: true
17+
18+
name: Contract Blockchain Tests
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
working-directory: ./packages/libs/contracts-sdk
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
28+
- uses: pnpm/action-setup@v4
29+
with:
30+
version: 10.7.0
31+
32+
- name: Install Foundry
33+
uses: foundry-rs/foundry-toolchain@v1
34+
with:
35+
version: nightly
36+
37+
- name: Run Forge fmt
38+
run: |
39+
forge fmt --check
40+
id: fmt
41+
42+
- name: Install dependencies
43+
run: |
44+
pnpm install
45+
46+
- name: Run Forge build
47+
run: |
48+
forge build --sizes
49+
id: build
50+
51+
- name: Run Regular Forge tests
52+
run: |
53+
forge test --ffi -vvv --no-match-path 'test/**/*ForkTest*.t.sol'
54+
id: test
55+
56+
- name: Run Forked Forge tests
57+
env:
58+
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }}
59+
run: |
60+
forge test --ffi -vvv --match-path 'test/**/*ForkTest*.t.sol' --fork-url "$BASE_RPC_URL"
61+
id: test-forked

.gitmodules

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"typedoc:build": "pnpm typedoc --skipErrorChecking --logLevel Verbose --options ./typedoc.site.config.js",
2828
"typedoc:serve": "node scripts/typedocServer.mjs",
2929
"typedoc:watch": "chokidar 'docs/src/**/*' 'docs/custom.css' './typedoc.site.config.js' './packages/libs/**/docs/json' --initial --await-write-finish --delay 250 -c 'pnpm typedoc:build'",
30-
"install:contracts": "cd packages/lib/contracts-sdk && forge install",
31-
"make:contracts": "cd packages/lib/contracts-sdk && make",
30+
"install:contracts": "cd packages/libs/contracts-sdk && forge install",
31+
"make:contracts": "cd packages/libs/contracts-sdk && make",
3232
"gen:contracts": "bun run make:contracts get-abis run-postbuild-scripts",
3333
"clean": "nx reset && nx run-many --target=clean --all && rm -Rf node_modules bun.lock",
3434
"prepare": "husky",

packages/libs/contracts-sdk/.github/workflows/test.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/libs/contracts-sdk/Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,15 @@ get-abis: ## Get human-readable ABIs for all facets
9999
@forge inspect VincentUserFacet abi --json > abis/VincentUserFacet.abi.json
100100
@echo "Getting ABI for VincentUserViewFacet..."
101101
@forge inspect VincentUserViewFacet abi --json > abis/VincentUserViewFacet.abi.json
102-
@echo "ABIs written to abis/*.abi.json"
102+
103+
@echo "Merging facet ABIs into abis/FeeDiamond.abi.json..."
104+
@jq -s '[.[].abi] | add | unique_by(.type, .name, ((.inputs // []) | map(.type) | join(",")))' \
105+
out/OwnershipFacet.sol/OwnershipFacet.json \
106+
out/FeeViewsFacet.sol/FeeViewsFacet.json \
107+
out/FeeAdminFacet.sol/FeeAdminFacet.json \
108+
out/MorphoPerfFeeFacet.sol/MorphoPerfFeeFacet.json \
109+
out/AavePerfFeeFacet.sol/AavePerfFeeFacet.json \
110+
> abis/FeeDiamond.abi.json
111+
@echo "✅ Combined ABI written to abis/FeeDiamond.abi.json"
112+
113+
@echo "ABIs written to abis/*.abi.json"

0 commit comments

Comments
 (0)