Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
658457a
feat: add get_invoices_by_merchant pagination to invoice contract (#1)
Freezyyy-arch Aug 27, 2026
93a099c
feat: add optional reference field to invoices (#3)
Freezyyy-arch Aug 27, 2026
188e878
test: add minimum-amount boundary tests to invoice contract (#2)
Freezyyy-arch Aug 27, 2026
42d0436
feat: add simulate_settlement preview to treasury contract and API (#4)
Freezyyy-arch Aug 27, 2026
207a971
fix(compliance): reject past-expiry timestamps in allow_address_until
jhaydeeee-web Aug 27, 2026
616e912
test(compliance): cover clear_address interaction with allow_address_…
jhaydeeee-web Aug 27, 2026
6eaaf92
feat(compliance): add batch_allow_addresses for bulk merchant onboarding
jhaydeeee-web Aug 27, 2026
2be6bfb
feat(compliance): emit batch summary event and document event shapes
jhaydeeee-web Aug 27, 2026
f7b3ae4
fix(invoice): guard mark_paids against terminal/refund-state overrides
rdj-savyy Aug 27, 2026
1a307c7
docs(invoice): add state-transition diagram and fill error-code gaps
rdj-savyy Aug 27, 2026
a5eb738
test(treasury): cover rotate_signer / total_signer_weight interaction
rdj-savyy Aug 27, 2026
fa6dcb6
feat(treasury): add per-token daily withdrawal limit
rdj-savyy Aug 27, 2026
379fc07
fix(treasury): check token allowlist before pause/auth in propose_set…
Valreb001 Aug 27, 2026
be3fbd1
docs(mainnet): document signer loss / compromise recovery procedure
Valreb001 Aug 27, 2026
e8dbe4f
test(settlement): add multisig propose/approve integration coverage
Valreb001 Aug 27, 2026
958e3d5
docs(contracts): add README pointing to the canonical contracts tree
Valreb001 Aug 27, 2026
23acbca
docs: add rate limit reference page
Nikola-Tee Aug 28, 2026
3345325
docs: add feature parity table for contract source trees
Nikola-Tee Aug 28, 2026
459aa72
docs: add ADR explaining the dual contracts/backend/frontend trees
Nikola-Tee Aug 28, 2026
8bd0f17
fix: resolve issues #478 #479 #480 #481
oziginwambada Aug 29, 2026
c3a09c2
Merge pull request #548 from oziginwambada/fix/issues-478-479-480-481
levoski1 Aug 29, 2026
41e1a1c
Merge branch 'main' into feature/issues-1-2-3-4-invoice-treasury
levoski1 Aug 30, 2026
fc4c7bb
Merge pull request #528 from Freezyyy-arch/feature/issues-1-2-3-4-inv…
levoski1 Aug 30, 2026
9a6cae7
Merge pull request #529 from jhaydeeee-web/feature/compliance-batch-a…
levoski1 Aug 30, 2026
f0a482e
Merge branch 'main' into fix/invoice-treasury-hardening
levoski1 Aug 30, 2026
d9a590a
Merge pull request #530 from rdj-savyy/fix/invoice-treasury-hardening
levoski1 Aug 30, 2026
1e813d7
Merge pull request #531 from Valreb001/fix/treasury-allowlist-recover…
levoski1 Aug 30, 2026
b350c28
Merge pull request #532 from Nikola-Tee/docs/rate-limit-reference
levoski1 Aug 30, 2026
0681e58
Merge pull request #533 from Nikola-Tee/docs/contract-tree-feature-pa…
levoski1 Aug 30, 2026
84f9401
Merge branch 'main' into docs/dual-tree-decision-record
levoski1 Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/workflows/ci-abi-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,5 @@ jobs:
with:
python-version: '3.12'

- name: Regenerate ABI metadata
run: bash scripts/generate_abi_metadata.sh abis

- name: Fail if ABI snapshots are stale
run: |
if ! git diff --exit-code abis/; then
echo ""
echo "ERROR: ABI snapshots in abis/ are out of date."
echo "Run 'make update-abi-snapshots' locally and commit the updated files."
exit 1
fi
- name: Verify ABI snapshots are up to date
run: bash scripts/generate_abi_metadata.sh --check
29 changes: 29 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,38 @@ A working clone for end-to-end development looks like this (see `docs/dev-enviro

When working inside this repository alone, the in-tree `COMEBACKHERE-contracts/` checkout acts as the canonical contracts tree; the sibling-clone step is optional for backend/frontend contributors.

## Invoice state machine

The invoice contract (`COMEBACKHERE-contracts/contracts/invoice/src/lib.rs`, mirrored at `contracts/invoice/src/lib.rs`) is the source of truth every other layer reads from: backend status displays, the indexer, and both frontend apps all ultimately derive their view of an invoice from this state machine. The diagram below shows every `InvoiceStatus` value and the function whose call transitions an invoice into it. Any transition not shown here is illegal and the calling function returns an `InvalidStateTransition` / `NotPending` style error (see [docs/error-codes.md](docs/error-codes.md) for the exact variant and code per contract).

```mermaid
stateDiagram-v2
[*] --> Pending: create_invoice

Pending --> Paid: mark_paids / pay_invoice
Pending --> Expired: batch_expire
Pending --> Cancelled: cancel_invoiced / cancel_invoice

Paid --> RefundRequested: request_refund
Paid --> RefundRequested: cancel_invoiced / cancel_invoice

RefundRequested --> Released: release_escrow (after grace window)

Expired --> [*]
Cancelled --> [*]
Released --> [*]
```

Notes on edges that are deliberately absent from this diagram:

- **`Paid` is never re-entered.** Once an invoice leaves `Pending`, no function transitions it back to `Paid`. In particular, `mark_paids` guards against being called on an invoice that is `RefundRequested`, `Released`, `Cancelled`, or `Expired`, so a stale or replayed payment confirmation can never silently override a refund already in progress.
- **`RefundRequested`, `Released`, `Cancelled`, and `Expired` are terminal with respect to payment and cancellation** — `cancel_invoiced`, `request_refund`, and `mark_paids` all reject calls made once an invoice has reached one of these states.
- **`release_escrow` is time-gated**, not just state-gated: it additionally requires `ledger.timestamp() >= invoice.created_at + grace_window`.

## Further reading

- [docs/dev-environment.md](docs/dev-environment.md) — full local setup.
- [docs/abi-snapshot-workflow.md](docs/abi-snapshot-workflow.md) — when and how to regenerate `abis/`.
- [docs/adr-0001-dual-source-trees.md](docs/adr-0001-dual-source-trees.md) — why the dual source trees exist and the plan to remove them.
- [docs/error-codes.md](docs/error-codes.md) — contract error enums and their meanings.
- [SECURITY.md](SECURITY.md) — which paths handle fund-safety-critical code.
Loading