Skip to content

feat(opsce): add transfer validation rules with min/max limits and blocked address checks#839

Merged
yusuftomilola merged 6 commits into
DistinctCodes:mainfrom
phertyameen:main
Jun 1, 2026
Merged

feat(opsce): add transfer validation rules with min/max limits and blocked address checks#839
yusuftomilola merged 6 commits into
DistinctCodes:mainfrom
phertyameen:main

Conversation

@phertyameen
Copy link
Copy Markdown
Contributor

Summary

Implements contracts/opsce/src/transfer_rules.rs - a validate_transfer guard and supporting admin functions called at the start of every transfer execution path.

Changes

  • validate_transfer(env, from, to, asset_id, amount) - rejects self-transfers, blocked recipients, and out-of-range amounts
  • set_transfer_limits(env, caller, asset_id, min, max) - admin-only; configures per-asset min/max thresholds
  • block_address(env, caller, address) - admin-only; adds an address to the persistent blocked list
  • Transfers with no limits configured skip amount checks entirely
  • Module exported from opsce/src/lib.rs and consumed in multisig_transfer/src/rules.rs

Testing

All 8 unit tests pass via:

cargo test -p opsce

Covers: happy path, self-transfer, below minimum, above maximum, blocked recipient, no limits set, invalid limit config, boundary values (exact min/max).

Closes #827

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@phertyameen is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@phertyameen 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

@yusuftomilola yusuftomilola merged commit 17831dd into DistinctCodes:main Jun 1, 2026
1 of 8 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.

[CT-17] Add input validation and transfer rules in multisig_transfer/rules.rs in opsce crate

2 participants