Skip to content

Commit c9db926

Browse files
authored
docs: correct confirmed factual errors in integration guides
docs: correct confirmed factual errors in integration guides
2 parents b7595b0 + faf01e2 commit c9db926

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ LP shares are yield-bearing collateral. The `flashstack-pool-oracle` exposes `ge
126126
git clone https://github.com/mattglory/Flashstack.git
127127
cd flashstack
128128
npm install
129-
npm test # 86 tests passing
129+
npm test # 82 tests passing
130130
npm run check # Clarinet contract verification
131131
```
132132

@@ -171,7 +171,7 @@ EXECUTE=true LOAN_STX=100 \
171171
### STX Receiver
172172

173173
```clarity
174-
(impl-trait 'SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-stx-core.stx-flash-receiver-trait)
174+
(impl-trait 'SP3TGRVG7DKGFVRTTVGGS60S59R916FWB4DAB9STZ.stx-flash-receiver-trait.stx-flash-receiver-trait)
175175
176176
(define-public (execute-stx-flash (amount uint) (core principal))
177177
(let (
@@ -279,7 +279,7 @@ flashstack/
279279
velar-sbtc-arb-receiver.clar # Velar sBTC arb receiver
280280
zest-liquidation-receiver.clar # Zest zero-capital liquidator (4 modes)
281281
alex-arb-receiver.clar # ALEX STX/ALEX arb receiver
282-
tests/ # 86 Vitest + Clarinet simnet tests
282+
tests/ # 82 Vitest + Clarinet simnet tests
283283
scripts/ # Deploy + monitor scripts
284284
docs/ # Guides and integration specs
285285
TESTING_GUIDE_STX.md
@@ -302,7 +302,7 @@ flashstack/
302302

303303
- [x] Security hardening — all audit findings resolved
304304
- [x] Mainnet deployment — STX + canonical sBTC flash loan engines
305-
- [x] 86-test suite (Vitest + Clarinet simnet)
305+
- [x] 82-test suite (Vitest + Clarinet simnet)
306306
- [x] Production frontend — STX + sBTC flash loans, wallet connect, live stats
307307
- [x] LP pool — external liquidity providers earn STX yield
308308
- [x] Bitflow arb receiver — live DEX integration proven on mainnet

docs/INTEGRATION_GUIDE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ Only approved receivers can borrow from FlashStack. Open a GitHub issue at https
142142
curl -s -X POST \
143143
"https://api.hiro.so/v2/contracts/call-read/SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5/flashstack-stx-core/is-approved-receiver" \
144144
-H "Content-Type: application/json" \
145-
-d "{\"sender\":\"YOUR-ADDRESS\",\"arguments\":[\"0x$(printf 'YOUR-ADDRESS.my-receiver' | xxd -p)\"]}"
145+
-d "{\"sender\":\"YOUR-ADDRESS\",\"arguments\":[\"<serialized-contract-principal>\"]}"
146+
# NOTE: the argument must be a Clarity-serialized contract-principal (hex starting 0x06...),
147+
# NOT the ascii-hex of the string. Generate it in JS:
148+
# Cl.serialize(Cl.contractPrincipal("YOUR-ADDRESS", "my-receiver"))
146149
```
147150
148151
Or check on Hiro Explorer: navigate to your contract address and call `is-approved-receiver` with your receiver principal as argument.
@@ -266,7 +269,8 @@ Borrow the debt amount, call the lending protocol's liquidation function, receiv
266269
(let (
267270
(fee-bp (unwrap! (contract-call? 'SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.flashstack-stx-core
268271
get-fee-basis-points) ERR-REPAY))
269-
(fee (max (/ (* amount fee-bp) u10000) u1))
272+
(raw-fee (/ (* amount fee-bp) u10000))
273+
(fee (if (> raw-fee u0) raw-fee u1))
270274
(total-owed (+ amount fee))
271275
)
272276
;; Repay borrower's debt to the lending protocol

docs/TESTING_GUIDE_STX.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ FlashStack has two generations of implementation in this repo:
1515
| sBTC flash loans (`flashstack-core`, `sbtc-token`) | Legacy — SP3TGRVG7... wallet | No — reference only |
1616
| STX flash loans (`flashstack-stx-core`, `flashstack-stx-pool`) | Active — SP20XD46... wallet | Yes — this is the focus |
1717

18-
The Clarinet local tests and `docs/archive/` cover the sBTC path. Ignore them for active testing — they are kept for historical reference only.
18+
The Clarinet local tests and `docs/archive/` cover the **legacy** sBTC path (`flashstack-core`, SP3TGRVG7...) — kept for historical reference only. Note: the canonical sBTC engine `flashstack-sbtc-core` (SP20XD46...) is **live and active** (reserve ~15,010 sats, fee 5 bps; see `docs/TESTING_GUIDE_SBTC.md`). Only the old `flashstack-core` path is legacy.
1919

2020
---
2121

@@ -74,9 +74,9 @@ receiver: SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5.stx-test-receiver
7474
**What success looks like:**
7575
- Transaction confirmed (green checkmark in Explorer)
7676
- No error code in the result
77-
- `get-stats` on `flashstack-stx-core` shows `total-flash-mints` incremented by 1
77+
- `get-stats` on `flashstack-stx-core` shows `total-loans` incremented by 1
7878
- `get-stats` shows `total-volume` increased by 10000000
79-
- `get-stats` shows `total-fees-collected` increased by 5000 (0.05% of 10 STX)
79+
- `get-stats` shows `total-fees` increased by 5000 (0.05% of 10 STX)
8080

8181
**What failure looks like:**
8282
- `(err u302)``ERR-REPAY-FAILED` — receiver didn't repay (shouldn't happen with stx-test-receiver)
@@ -101,8 +101,8 @@ Call `get-reserve-balance` on `flashstack-stx-core`. The result must be ≥ your
101101
| `get-fee-basis-points` | `(ok u5)` — 0.05% fee |
102102
| `get-max-single-loan` | `(ok u500000000000)` — 500,000 STX limit |
103103
| `get-admin` | `(ok SP20XD46NGAX05ZQZDKFYCCX49A3852BQABNP0VG5)` |
104-
| `is-approved-receiver` with `SP20XD46...stx-test-receiver` | `(ok true)` |
105-
| `is-approved-receiver` with `SP20XD46...bitflow-arb-receiver-v4` | `(ok true)` |
104+
| `is-approved-receiver` with `SP20XD46...stx-test-receiver` | `true` (STX core returns a bare bool, not `(ok ...)`) |
105+
| `is-approved-receiver` with `SP20XD46...bitflow-arb-receiver-v4` | `true` |
106106
| `calculate-fee u10000000` | `(ok u5000)` — fee on 10 STX |
107107

108108
---
@@ -168,7 +168,7 @@ These should all fail cleanly with no fund loss:
168168
| Test | How to trigger | Expected error |
169169
|------|---------------|----------------|
170170
| Loan exceeds reserve | `flash-loan` with amount > `get-reserve-balance` | `(err u303)` |
171-
| Loan exceeds max | `flash-loan` with amount > 5000000000 | `(err u304)` |
171+
| Loan exceeds max | `flash-loan` with amount > 500000000000 | `(err u304)` |
172172
| Unapproved receiver | `flash-loan` with your own unwhitelisted contract | `(err u306)` |
173173
| Zero amount | `flash-loan` with `u0` | `(err u301)` |
174174

0 commit comments

Comments
 (0)