Skip to content

feat: early-lease event, jurisdiction rules, keeper TTL bump - #1686

Merged
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
limxiy:fix/1492-1495-lease-jurisdiction-ttl
Oct 17, 2026
Merged

yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
limxiy:fix/1492-1495-lease-jurisdiction-ttl

Conversation

@limxiy

@limxiy limxiy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements limxiy's assigned issues for the assetsup contract.

Closes #1492 — Event on early lease termination

return_leased_asset now emits a distinct lease_terminated_early event when
the asset is returned before the lease's end_timestamp, instead of the generic
lease_returned. Consumers can now tell a break from a scheduled return.
Covered by two event tests (early return vs return at the end date).

Closes #1493 — Jurisdiction-based transfer restrictions

Adds dynamic jurisdiction rules. set_address_jurisdiction records an address's
ISO country code (self-authenticated), set_geographic_restriction sets an
asset's allow-list, and get_address_jurisdiction reads a record.
validate_transfer now rejects a recipient whose jurisdiction is absent from a
non-empty allow-list (or not recorded) with GeographicRestriction. The static
restriction path is unchanged when no allow-list is configured.

Closes #1495 — Automated TTL bump before expiry

Adds bump_asset_ttl, a permissionless and idempotent keeper entrypoint that
extends the TTL of a tokenized asset's persistent entries (asset record, holders
list, metadata, and each holder's ownership record) plus the contract instance.
An off-chain job can call it ahead of expiry so inactive-but-still-valid assets
are not archived. It is exempt from the pause, since blocking it during an
incident is exactly when entries are at risk. Covered by survival and
rejection tests.

Closes #1494 — No change required

Already handled on main: math.rs documents and tests its overflow-checked
arithmetic, so no code change is made.

Notes

Closes DistinctCodes#1492
Closes DistinctCodes#1493
Closes DistinctCodes#1495

- assetsup/lease: emit a distinct `lease_terminated_early` event when
  `return_leased_asset` runs before the lease's end date, so an early break is
  observable apart from a scheduled return (DistinctCodes#1492).
- assetsup/transfer_restrictions: add jurisdiction rules. Addresses carry a
  recorded ISO country code and an asset can configure a `geographic_allowed`
  allow-list; `validate_transfer` rejects recipients whose jurisdiction is not
  allowed (or unrecorded) with `GeographicRestriction` (DistinctCodes#1493).
- assetsup/tokenization + lib: add a permissionless, idempotent `bump_asset_ttl`
  keeper entrypoint that extends the TTL of a tokenized asset's entries, so an
  inactive-but-valid asset is not archived (DistinctCodes#1495).

DistinctCodes#1494 is already handled on `main`: math.rs documents and tests its
overflow-checked arithmetic, so no change is made.
@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown

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

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@limxiy 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 d56befe into DistinctCodes:main Oct 17, 2026
0 of 9 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

2 participants