Skip to content

Comments

feat: Pause/upgrade, batch operations, and advanced access control#115

Merged
Baskarayelu merged 1 commit intoRemitwise-Org:mainfrom
Jagadeeshftw:pause
Feb 22, 2026
Merged

feat: Pause/upgrade, batch operations, and advanced access control#115
Baskarayelu merged 1 commit intoRemitwise-Org:mainfrom
Jagadeeshftw:pause

Conversation

@Jagadeeshftw
Copy link
Contributor

Summary

Implements Contract Pause & Upgrade (#39), Batch Operations (#40), and Advanced Access Control & Role Management (#41).

#39 – Contract Pause and Upgrade Mechanism

  • Pause: Global and per-function pause (admin-only), time-locked unpause, emergency pause all.
  • Upgrade: Version tracking, upgrade admin, set_version with upgrade events.
  • Contracts: bill_payments, insurance, savings_goals, remittance_split, family_wallet.
  • Migration/rollback support remains in the data_migration crate (version checks, checksum, RollbackMetadata).

#40 – Batch Operations for Efficiency

  • bill_payments: batch_pay_bills(caller, bill_ids) – atomic, validated, max 50.
  • insurance: batch_pay_premiums(caller, policy_ids) – atomic.
  • savings_goals: batch_add_to_goals(caller, contributions) – atomic goal contributions.
  • family_wallet: batch_add_family_members(caller, members), batch_remove_family_members(caller, addresses) – atomic, with size limits.
  • Batch events and input validation; all-or-nothing execution.

#41 – Advanced Access Control and Role Management

  • Roles: Viewer added; hierarchy Owner > Admin > Member > Viewer; function-level checks via require_role_at_least.
  • Time-based access: set_role_expiry / get_role_expiry_public; expired roles rejected.
  • Audit: Access audit log for add/remove member and role change; get_access_audit(limit) (last 100 entries).
  • family_wallet: Pause/unpause, upgrade admin, and version with events; Owner/Admin for pause, Owner for upgrade admin.

Breaking / API changes

  • bill_payments: cancel_bill(env, bill_id)cancel_bill(env, caller, bill_id); archive_paid_bills and bulk_cleanup_bills now return Result<u32, Error>.

Tests & pipeline

  • Existing tests updated (e.g. cancel_bill caller); all workspace tests pass.
  • cargo fmt, cargo clippy -- -D warnings, and cargo test --workspace --all-features pass.
  • Remittance_split clippy warnings (unused vars) fixed.

- Added pause functionality for the contract, allowing an admin to pause and unpause the contract and specific functions.
- Introduced new error types for paused states and unauthorized actions.
- Updated bill cancellation logic to require the owner's address as an argument.
- Modified test cases and snapshots to reflect changes in function signatures and added scenarios for paused states.
@Jagadeeshftw
Copy link
Contributor Author

@Baskarayelu Please review

@Baskarayelu
Copy link
Contributor

Looks good to me!

@Baskarayelu Baskarayelu merged commit 2d8fbc1 into Remitwise-Org:main Feb 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants