feat: implement issues #211–#214 (batch withdrawal, archival, two-step admin, CI) - #303
Merged
king-aj-the-first merged 2 commits intoSep 26, 2026
Conversation
…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
|
@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! 🚀 |
Contributor
Author
|
hello maintainer, these conflicts has been fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).Closes #212 — Admin-gated archival for completed invoices
archive_invoice(admin, id)oninvoice_nft: emitsINV_ARCevent then removes the invoice from persistent storage; only succeeds forRepaidorDefaultedinvoices.archive_pool(admin, id)onfinancing_pool: removes closedPoolandPositionsentries to reclaim storage rent.Closes #213 — Two-step admin transfer across all contracts
transfer_adminwithpropose_admin+accept_admin+cancel_admin_proposalinaccess_control,treasury,risk_registry, andinvoice_nft.accept_adminproving key control before the transfer finalises — typos or wrong addresses can never permanently lock a contract.NoPendingAdminProposal,NotPendingAdmin. New events:ADM_PRP,ADM_CXL.Closes #214 — GitHub Actions security pipeline
.github/workflows/security.yml:cargo fmt --check,cargo clippy -- -D warnings, andcargo auditrun on every push/PR to main/master.