Skip to content

Commit 993bfd3

Browse files
committed
Scaffold ledgerlens-score Soroban contract and project docs
Adds the on-chain risk score registry contract (submit_score/get_score plus admin/service management), workspace tooling (CI, rustfmt, clippy), and consolidates project docs into a single README covering the contract and the org-wide architecture.
1 parent a13c520 commit 993bfd3

23 files changed

Lines changed: 4850 additions & 1 deletion

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Contract CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
fmt:
13+
name: Format check
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@stable
18+
with:
19+
components: rustfmt
20+
- run: cargo fmt --all -- --check
21+
22+
clippy:
23+
name: Clippy
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
with:
29+
components: clippy
30+
- run: cargo clippy --all-targets -- -D warnings
31+
32+
test:
33+
name: Test
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: dtolnay/rust-toolchain@stable
38+
- run: cargo test
39+
40+
build:
41+
name: Build (wasm32)
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: dtolnay/rust-toolchain@stable
46+
with:
47+
targets: wasm32-unknown-unknown
48+
- run: cargo build --target wasm32-unknown-unknown --release

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/target
2+
**/*.rs.bk
3+
.soroban
4+
*.wasm
5+
.env

CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing to LedgerLens Contract
2+
3+
Thanks for your interest in improving the LedgerLens on-chain risk score registry.
4+
5+
## Getting Started
6+
7+
1. Install the Rust toolchain (stable) and the `wasm32-unknown-unknown` target:
8+
```bash
9+
rustup target add wasm32-unknown-unknown
10+
```
11+
2. Fork the repo and create a feature branch off `main`.
12+
3. Make your changes inside `contracts/ledgerlens-score/`.
13+
14+
## Before Opening a Pull Request
15+
16+
Run the same checks CI runs:
17+
18+
```bash
19+
cargo fmt --all -- --check
20+
cargo clippy --all-targets -- -D warnings
21+
cargo test
22+
cargo build --target wasm32-unknown-unknown --release
23+
```
24+
25+
## Guidelines
26+
27+
- Keep `contracts/ledgerlens-score/src/types.rs` changes minimal and deliberate — `RiskScore` and `DataKey` are shared, cross-repo data contracts (see [README.md § Organization Architecture](README.md#organization-architecture)). Any field/shape change is breaking for the `api`, `core`, and `dashboard` repos and must be coordinated.
28+
- Add or update tests in `src/test.rs` for any behavioral change.
29+
- Keep error codes in `errors.rs` stable; append new variants rather than reordering or removing existing ones, since their numeric values are part of the deployed contract's ABI.
30+
- Update `README.md` if you change contract function signatures, events, or the deployment flow in `deploy.sh`.
31+
32+
## Submitting a Pull Request
33+
34+
- Describe what changed and why.
35+
- Note any cross-repo coordination needed (e.g. "requires `api` to update its `RiskScore` schema").
36+
- Ensure all CI checks pass.

0 commit comments

Comments
 (0)