Skip to content

feat(contracts): add admin-configurable transfer limits - #186

Open
funds0033-cmyk wants to merge 1 commit into
RemitFlow:mainfrom
funds0033-cmyk:feat/authorized-setter-tunable-limits-93
Open

feat(contracts): add admin-configurable transfer limits#186
funds0033-cmyk wants to merge 1 commit into
RemitFlow:mainfrom
funds0033-cmyk:feat/authorized-setter-tunable-limits-93

Conversation

@funds0033-cmyk

@funds0033-cmyk funds0033-cmyk commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Closes #96## Summary
This PR introduces configurable transfer limits that can be managed by an authorized administrator. Limits are persisted on-chain, validated before storage, and enforced throughout the contract while maintaining the existing security model.

Changes

  • Added the set_limits(ConfiguredLimits) admin-only entrypoint protected by admin.require_auth().
  • Implemented cooldown-gated limit updates with validation before persisting to instance storage.
  • Added get_limits to retrieve configured limits, falling back to default values when no custom configuration exists.
  • Updated create_transfer and get_transfers_paged to enforce the stored configurable limits.
  • Introduced the InvalidLimits contract error for invalid configurations.
  • Added the limits_changed event to emit successful limit updates.
  • Added tests covering:
    • Successful admin updates
    • Authorization failures
    • Invalid limit configurations
    • Enforcement of configured limits
    • Uninitialized contract behavior
  • Updated documentation for authorization, contract entrypoints, events, errors, storage, data types, testing, and CLI usage.

Validation

  • Implementation completed on branch feat/authorized-setter-tunable-limits-93.
  • Local cargo test could not be executed due to a local disk-space limitation. After freeing disk space, run:
    cargo test limits
    
    Closes #93

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.

Add an invariant check for supply accounting

1 participant