Skip to content

feat: implement issues #211–#214 (batch withdrawal, archival, two-step admin, CI) - #303

Merged
king-aj-the-first merged 2 commits into
OpenLedger-Foundation:mainfrom
softnationz:feature/issues-211-214
Sep 26, 2026
Merged

king-aj-the-first merged 2 commits into
OpenLedger-Foundation:mainfrom
softnationz:feature/issues-211-214

Conversation

@softnationz

Copy link
Copy Markdown
Contributor

Summary

Implements four protocol improvements in a single atomic PR.

Closes #211 — Atomic batch withdrawal for treasury

  • withdraw_batch(admin, Vec<(token, recipient, amount)>) validates all entries before any transfer; a single bad entry aborts the entire batch (atomic-abort semantics).
  • Tests: empty batch is a noop, unwhitelisted token aborts batch, non-admin rejected.

Closes #212 — Admin-gated archival for completed invoices

  • archive_invoice(admin, id) on invoice_nft: emits INV_ARC event then removes the invoice from persistent storage; only succeeds for Repaid or Defaulted invoices.
  • archive_pool(admin, id) on financing_pool: removes closed Pool and Positions entries to reclaim storage rent.
  • Tests: non-terminal status rejected, non-admin rejected, terminal statuses succeed.

Closes #213 — Two-step admin transfer across all contracts

  • Replaces single-step transfer_admin with propose_admin + accept_admin + cancel_admin_proposal in access_control, treasury, risk_registry, and invoice_nft.
  • New admin must call accept_admin proving key control before the transfer finalises — typos or wrong addresses can never permanently lock a contract.
  • New errors: NoPendingAdminProposal, NotPendingAdmin. New events: ADM_PRP, ADM_CXL.
  • All unit, edge-case, and integration tests updated.

Closes #214 — GitHub Actions security pipeline

  • .github/workflows/security.yml: cargo fmt --check, cargo clippy -- -D warnings, and cargo audit run on every push/PR to main/master.

…n#214

OpenLedger-Foundation#211 – add atomic multi-token batch withdrawal to treasury
  - withdraw_batch(admin, Vec<(token, recipient, amount)>) checks all
    entries before any transfer (atomic-abort semantics)
  - unit tests: empty batch noop, bad-entry abort, non-admin rejection

OpenLedger-Foundation#212 – implement admin-gated archival for completed invoices
  - archive_invoice(admin, id) on invoice_nft removes Repaid/Defaulted
    invoices from persistent storage after emitting INV_ARC event
  - archive_pool(admin, id) on financing_pool removes closed Pool +
    Positions entries; unit tests cover terminal/non-terminal checks

OpenLedger-Foundation#213 – two-step admin transfer across all contracts
  - replace single-step transfer_admin with propose_admin + accept_admin
    + cancel_admin_proposal in access_control, treasury, risk_registry,
    invoice_nft — new admin must call accept_admin to prove key control
  - add NoPendingAdminProposal/NotPendingAdmin errors to shared
  - add admin_proposed/admin_proposal_cancelled events to shared
  - update all unit, edge-case, and integration tests accordingly

OpenLedger-Foundation#214 – add GitHub Actions security pipeline
  - .github/workflows/security.yml: fmt check, clippy -D warnings,
    cargo audit on every push/PR to main/master

Closes OpenLedger-Foundation#211, Closes OpenLedger-Foundation#212, Closes OpenLedger-Foundation#213, Closes OpenLedger-Foundation#214
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@softnationz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@softnationz

Copy link
Copy Markdown
Contributor Author

hello maintainer, these conflicts has been fixed

@king-aj-the-first
king-aj-the-first merged commit d915027 into OpenLedger-Foundation:main Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants