feat(contract): ledger TTL expiration strategy & archival state recovery - #7
Merged
amankoli09 merged 2 commits intoAug 9, 2026
Conversation
Implement automated rent-bumping and on-chain state restoration across all LynxX Soroban contracts (badge, fund, escrow, factory): - Add shared ttl helper crate exposing extend_storage_ttl(), bump(), and bump_instance() with a 30-day extension window (172,800 ledgers) and a 14-day bump threshold (80,640 ledgers). Host only bumps when remaining TTL is below threshold, keeping routine access a free no-op. - badge: bump tier entry + instance/code on every award/query; add public restore_badge(user_id, expected_tier) that recovers an archived badge from verifiable archival proof data, emitting BadgeRestored and rejecting forged proof (ProofMismatch) or unknown donors (NotInitialized). - fund: bump donor contribution entries and contract instance/code on donate/set_badge/withdraw/refund and contribution reads. - escrow: persist lifecycle Status in storage and rent-bump on every transition and read, recovering archived state on access. - factory: keep campaign registry instance/code alive on deploy/read. - Tests: TTL-bump-on-award/query, simulated archival eviction followed by restore_badge recovery without data loss, forged-proof rejection, and escrow/fund TTL assertions. Closes LynxXProtocol#4
Contributor
|
@Babigdk , Good Work Please resolve conflict in the Contract ci is failing |
Contributor
Author
|
@amankoli09 ci fixed |
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.
Implement automated rent-bumping and on-chain state restoration across all LynxX Soroban contracts (badge, fund, escrow, factory):
Closes #4