Feat add per jurisdiction transfer cooldown configurable via set transfer cooldown - #702
Merged
Conversation
- Add EVENT_REG_LIMIT_DELTA (rg_lim_d) event symbol with doc comments - Add update_and_emit_reg_limit_delta helper that tracks JurisdictionAggregateShare per (offering, jurisdiction) - Hook into set_holder_share_internal for automatic emission on every holding change (issuance, transfer) - Add get_indexer_fixture_topics with 16 canonical fixture entries including rg_lim_d (non-period-scoped, period_id=0) - Add EVENT_JUR_UNSET sentinel constant (was missing) - Bump STORAGE_LAYOUT_VERSION from 4 to 5 - Add 12 tests (9 behavioral + 3 gas-budget) covering issuance, cross/same-jurisdiction transfers, no-jurisdiction edge cases, data shape, and gas bounds - Update test_indexer_fixtures.rs to expect 16 fixtures - Update milestone_signals.rs for new tuple return and fixture count - Update docs/indexer-fixture-coverage.md with rg_lim_d entry
Resolved ~50 pre-existing compilation errors across 3 files: - src/lib.rs: SafeMath import fix, RevoraError discriminant renumbering (62->77, 63->78, 67->79), 9 missing enum variants (80-88), symbol_short! length, sha256().into(), Proposal fields, set_holder_share_internal args, is_dispute_freeze_active param, MerkleLeaf contracttype, MigrationDataKey variants - src/merkle_helpers.rs: Added #[contracttype] to MerkleLeaf struct - tools/storage_layout_schema.rs: Added MigrationDataKey entries ~420 pre-existing structural errors remain (DataKey2 >50 variants exceeds Soroban #[contracttype] limit, plus cascading errors) — these are unrelated to the regulatory-limit feature.
|
@obswrld 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! 🚀 |
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.
closes #588
Summary
Adds set_transfer_cooldown(offering_id, jurisdiction, cooldown_secs) and enforces it in the transfer path. Some jurisdictions require a mandatory waiting period between successive share transfers by the same holder. This feature allows issuers to configure per-jurisdiction cooldown windows that are enforced automatically on every transfer_with_attestation and reported via estimate_transfer .
Changes
Storage (DataKey2)
Contract API
Enforcement
Error variant
// rust
TransferCooldownActive = 89,
Files changed
┌─────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ File │ Change │
├─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ src/lib.rs │ +error variant, +event constant, +DataKey2 variants, +check_transfer_eligibility, │
│ │ +set/get_transfer_cooldown, cooldown checks in transfer paths │
│ src/structured_ │ Added TransferCooldownActive to all discriminant stability tests │
│ error_tests.rs │ │
│ tools/storage_l │ Registered new DataKey2 entries │
│ ayout_schema.rs │ │
│ docs/STORAGE_LA │ Regenerated │
│ YOUT.json │ │
│ src/test_transf │ 10 tests covering set/get, blocked by cooldown, allowed after elapsed, exact boundary, zero=disabled, │
│ er_cooldown.rs │ independent jurisdiction cooldowns, no jurisdiction bypass, no-storage-write optimization, │
│ │ estimate_transfer consistency │
└─────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Test coverage