Skip to content

Commit 4df3f19

Browse files
committed
merge: resolve interest rate and lending contract conflicts
2 parents 2651086 + 220199a commit 4df3f19

1,205 files changed

Lines changed: 155050 additions & 16165 deletions

File tree

Some content is hidden

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

.devcontainer/devcontainer.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"name": "StellarLend Devnet",
3+
"dockerComposeFile": "../docker/devnet/docker-compose.yml",
4+
"service": "api",
5+
"workspaceFolder": "/workspace",
6+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
7+
"shutdownAction": "stopCompose",
8+
9+
"features": {
10+
"ghcr.io/devcontainers/features/rust:1": {
11+
"version": "latest",
12+
"targets": "wasm32-unknown-unknown"
13+
},
14+
"ghcr.io/devcontainers/features/node:1": {
15+
"version": "20"
16+
},
17+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
18+
"ghcr.io/devcontainers/features/git:1": {}
19+
},
20+
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"rust-lang.rust-analyzer",
25+
"ms-azuretools.vscode-docker",
26+
"dbaeumer.vscode-eslint",
27+
"esbenp.prettier-vscode",
28+
"bradlc.vscode-tailwindcss",
29+
"ms-vscode.vscode-typescript-next"
30+
],
31+
"settings": {
32+
"terminal.integrated.defaultProfile.linux": "bash",
33+
"rust-analyzer.cargo.target": "wasm32-unknown-unknown",
34+
"editor.formatOnSave": true,
35+
"editor.defaultFormatter": "esbenp.prettier-vscode",
36+
"[rust]": {
37+
"editor.defaultFormatter": "rust-lang.rust-analyzer"
38+
}
39+
}
40+
}
41+
},
42+
43+
"forwardPorts": [
44+
3000,
45+
4000,
46+
5432,
47+
6379,
48+
8000
49+
],
50+
"portsAttributes": {
51+
"3000": { "label": "API", "onAutoForward": "notify" },
52+
"4000": { "label": "Oracle", "onAutoForward": "notify" },
53+
"5432": { "label": "PostgreSQL", "onAutoForward": "silent" },
54+
"6379": { "label": "Redis", "onAutoForward": "silent" },
55+
"8000": { "label": "Soroban RPC / Horizon", "onAutoForward": "notify" }
56+
},
57+
58+
"postCreateCommand": "bash -c 'echo \"StellarLend Devnet ready. Run: cd docker/devnet && ./healthcheck.sh\" && which stellar > /dev/null 2>&1 || (curl -sf https://raw.githubusercontent.com/nicholasgasior/stellar-cli-install/main/install.sh | bash || echo \"Stellar CLI install skipped\")'",
59+
60+
"remoteUser": "node",
61+
62+
"remoteEnv": {
63+
"STELLAR_NETWORK": "local",
64+
"SOROBAN_RPC_URL": "http://soroban-devnet:8000/soroban/rpc",
65+
"HORIZON_URL": "http://soroban-devnet:8000",
66+
"FRIENDBOT_URL": "http://soroban-devnet:8000/friendbot",
67+
"NETWORK_PASSPHRASE": "Standalone Network ; February 2017",
68+
"DATABASE_URL": "postgres://stellarlend:stellarlend@postgres:5432/stellarlend",
69+
"REDIS_URL": "redis://redis:6379"
70+
}
71+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug Bounty Report
3+
about: Report a security vulnerability for the StellarLend bug bounty program
4+
title: '[BUG BOUNTY] '
5+
labels: 'security, bug-bounty'
6+
assignees: ''
7+
8+
---
9+
10+
## Vulnerability Description
11+
Please provide a clear and concise description of the vulnerability.
12+
13+
## Impact
14+
What is the potential impact of this vulnerability? (e.g., loss of funds, denial of service).
15+
16+
## Severity Self-Assessment
17+
(Critical, High, Medium, Low)
18+
19+
## Steps to Reproduce
20+
1.
21+
2.
22+
3.
23+
24+
## Proof of Concept
25+
(Code snippets, scripts, or transaction hashes)
26+
27+
## Proposed Remediation (Optional)
28+
How would you fix this issue?
29+
30+
## Researcher Information
31+
- Name/Handle:
32+
- Email/Contact:
33+
- ETH Wallet Address (for reward payout):

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/api"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
minor-and-patch:
9+
update-types:
10+
- "minor"
11+
- "patch"
12+
13+
- package-ecosystem: "npm"
14+
directory: "/oracle"
15+
schedule:
16+
interval: "weekly"
17+
groups:
18+
minor-and-patch:
19+
update-types:
20+
- "minor"
21+
- "patch"
22+
23+
- package-ecosystem: "cargo"
24+
directory: "/stellar-lend"
25+
schedule:
26+
interval: "weekly"
27+
groups:
28+
minor-and-patch:
29+
update-types:
30+
- "minor"
31+
- "patch"

.github/workflows/ci-cd.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: CI/CD Pipeline
22

3-
on:
4-
push:
5-
branches: ["main", "dev"]
6-
pull_request:
7-
branches: ["main", "dev"]
3+
on: workflow_dispatch
84

95
concurrency:
106
group: ${{ github.workflow }}-${{ github.ref }}
@@ -29,13 +25,20 @@ jobs:
2925
toolchain: stable
3026
components: rustfmt, clippy
3127

28+
- name: Install sccache
29+
uses: mozilla-actions/sccache-action@v0.0.4
30+
31+
- name: Configure sccache
32+
run: |
33+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
34+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
35+
3236
- name: Cache cargo registry & build
3337
uses: actions/cache@v4
3438
with:
3539
path: |
3640
~/.cargo/registry
3741
~/.cargo/git
38-
stellar-lend/target
3942
key: ${{ runner.os }}-cargo-${{ hashFiles('stellar-lend/Cargo.lock') }}
4043
restore-keys: |
4144
${{ runner.os }}-cargo-
@@ -97,7 +100,9 @@ jobs:
97100
run: |
98101
cd stellar-lend
99102
cargo test --package hello-world --lib tests::differential_test -- --nocapture 2>&1 | tee differential-test-report.txt
103+
cargo test --package hello-world --lib tests::hello_world_vs_lending_test -- --nocapture 2>&1 | tee -a differential-test-report.txt
100104
cargo test --package hello-world --lib tests::migration_verification_test -- --nocapture 2>&1 | tee -a differential-test-report.txt
105+
cargo test --package stellarlend-lending --lib migration_verification_test -- --nocapture 2>&1 | tee -a differential-test-report.txt
101106
grep "test result:" differential-test-report.txt
102107
103108
- name: Upload differential test report
@@ -107,10 +112,18 @@ jobs:
107112
name: differential-test-report
108113
path: stellar-lend/differential-test-report.txt
109114

115+
- name: Cache cargo-audit binary
116+
uses: actions/cache@v4
117+
with:
118+
path: ~/.cargo/bin/cargo-audit
119+
key: ${{ runner.os }}-cargo-audit-${{ hashFiles('stellar-lend/.cargo/audit.toml') }}
120+
121+
- name: Install cargo-audit
122+
run: cargo install cargo-audit --locked
123+
110124
- name: Run security audit
111125
run: |
112126
cd stellar-lend
113-
cargo install cargo-audit --locked
114127
cargo audit
115128
116129
fuzzing:
@@ -143,6 +156,14 @@ jobs:
143156
restore-keys: |
144157
${{ runner.os }}-cargo-fuzz-
145158
159+
- name: Cache cargo-fuzz binary
160+
uses: actions/cache@v4
161+
with:
162+
path: ~/.cargo/bin/cargo-fuzz
163+
key: ${{ runner.os }}-cargo-fuzz-nightly-${{ hashFiles('stellar-lend/Cargo.lock') }}
164+
restore-keys: |
165+
${{ runner.os }}-cargo-fuzz-nightly-
166+
146167
- name: Install cargo-fuzz
147168
run: cargo +nightly install cargo-fuzz --locked
148169

@@ -186,6 +207,14 @@ jobs:
186207
restore-keys: |
187208
${{ runner.os }}-cargo-invariant-
188209
210+
- name: Cache cargo-fuzz binary
211+
uses: actions/cache@v4
212+
with:
213+
path: ~/.cargo/bin/cargo-fuzz
214+
key: ${{ runner.os }}-cargo-fuzz-nightly-${{ hashFiles('stellar-lend/Cargo.lock') }}
215+
restore-keys: |
216+
${{ runner.os }}-cargo-fuzz-nightly-
217+
189218
- name: Install cargo-fuzz
190219
run: cargo +nightly install cargo-fuzz --locked
191220

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
NODE_VERSION: '20'
11+
12+
jobs:
13+
lint:
14+
name: Lint & Format
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ env.NODE_VERSION }}
21+
- uses: actions/cache@v4
22+
with:
23+
path: node_modules
24+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
25+
- run: npm ci --workspaces
26+
- run: npm run format --workspace=api && npm run format --workspace=oracle
27+
- run: npm run lint --workspace=api && npm run lint --workspace=oracle
28+
29+
typecheck:
30+
name: Type Check
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: ${{ env.NODE_VERSION }}
37+
- uses: actions/cache@v4
38+
with:
39+
path: node_modules
40+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
41+
- run: npm ci --workspaces
42+
- run: npm run typecheck --workspace=api && npm run typecheck --workspace=oracle
43+
44+
test:
45+
name: Tests
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: ${{ env.NODE_VERSION }}
52+
- uses: actions/cache@v4
53+
with:
54+
path: node_modules
55+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
56+
- run: npm ci --workspaces
57+
- run: npm run test --workspace=api && npm run test --workspace=oracle
58+
59+
e2e:
60+
name: E2E Tests
61+
runs-on: ubuntu-latest
62+
defaults:
63+
run:
64+
working-directory: tests/e2e
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: actions/setup-node@v4
68+
with:
69+
node-version: ${{ env.NODE_VERSION }}
70+
- uses: actions/cache@v4
71+
with:
72+
path: tests/e2e/node_modules
73+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-e2e-${{ hashFiles('tests/e2e/package-lock.json') }}
74+
- run: npm ci
75+
- run: npm run test:report
76+
- name: Upload E2E test report
77+
if: always()
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: e2e-test-report
81+
path: tests/e2e/e2e-report.json
82+
retention-days: 30
83+

0 commit comments

Comments
 (0)