Use casesHow it worksDocsLaunch app

Security

The repay path, reviewed

What the Wedesak program guarantees, how each guarantee is tested, and what review has found so far.

Invariants

Each invariant has kit tests for the success path and every revert path; they ship in the program repository under tests/invariants.

IDInvariant
I-1A transaction containing a borrow and no matching repay cannot succeed.
I-2Repay amount ≥ borrowed principal + fee, measured as tokens received by the vault.
I-3Borrow invoked from another program always fails.
I-4At most one borrow per transaction, regardless of reserve.
I-5Reserve share price is non-decreasing across any successful transaction.
I-6A frozen reserve rejects borrow but always accepts repay.

Repay-path review

Scope: wedesak::borrow, wedesak::repay, reserve accounting and the freeze switch. Findings and their status:

IDSeverityFindingStatus
R-01MediumRepay matched by absolute instruction index could be satisfied by a repay for a different reserve when two loans shared a transaction.Fixed — one loan per transaction; repay matched by reserve, mint and borrower.
R-02MediumToken-2022 mints with transfer fees under-credited the vault on repay.Fixed — vault balance delta is measured, not the instruction amount.
R-03LowBorrow did not reject a repay placed before it in the transaction.Fixed — the sysvar walk starts at the borrow's own index.
R-04InformationalCompute units of the sysvar walk grow with transaction length.Accepted — bounded by the 1,400,000 compute units transaction cap; documented.

Why these checks

Flash-loan attacks fell from 54% of DeFi losses in 2020 to under 1% in 2025 as protocols hardened against borrowed capital. The remaining risk sits on the lender: in September 2025 a disclosed bug in another lender’s flash-loan flow left more than $160M in deposits exposed until it was patched, with no funds lost. R-01 above is the same class of bug.

Bug bounty

Critical findings that would let a loan leave without repayment are paid from the treasury. Report privately through the security contact listed in the repository’s SECURITY.md; please include a kit test that reproduces the issue. See the error codes for expected reverts.