Repository navigation
fix(contracts): add TTL management to mUSDC token - #1247
Open
ocakciomursel-pixel wants to merge 1 commit into
Open
ocakciomursel-pixel wants to merge 1 commit into
ocakciomursel-pixel wants to merge 1 commit into
Conversation
|
@ocakciomursel-pixel is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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 #1037
Summary
Adds complete Soroban storage TTL management to the
meridian-musdc-tokencontract so neither the token instance nor individual holder share balances silently archive while backing active vault positions.Changes
30dbump /29dthreshold, matchingadapter-common):init_state, shared by__constructorandinitialize) and on every public entry point (mint,total_supply,admin,extend_ttl, and the full SEP-41TokenInterfacesurface:allowance,approve,balance,transfer,transfer_from,burn,burn_from,decimals,name,symbol).120dbump /113dthreshold, matchingMeridianVaultPOSITION_BUMP/POSITION_THRESHOLD):DataKey::Balance(addr)on every write (write_balance) and on existing-key reads (read_balanceviaif let Some(balance)), ensuring share balances share the exact 120-day lifetime window of theEntry/Principalrecords they back.persistent().extend_ttlsobalance()continues returning0for never-funded addresses and first-time mints/transfers never trap insoroban-env-host.DataKey::Allowance(from, spender)forexpiration_ledger - env.ledger().sequence()ledgers when recording positive allowances so multi-day approvals live throughexpiration_ledgerinstead of archiving after the network minimum temporary TTL.extend_ttl(env, holder: Option<Address>)):MeridianVault::extend_position_ttlso off-chain keepers or dormant holders can refresh instance storage and an optionalBalance(holder)entry without authorization, safely skipping persistent extension whenholderhas no balance record.apps/docs/operations/mainnet-deployment.md):mUSDCandMeridianVaultredeploy as an atomic pair (mUSDC exposes noupgradeentry point andMeridianVaultfixesshare_tokenat initialization), and how keepers pairvault.extend_position_ttlwithmusdc.extend_ttl. (packages/shared/deployed-contracts.jsonis intentionally untouched until an on-chain redeploy occurs.)Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p meridian-musdc-token --lib(32 unit tests passing, including 200-day multi-phase ledger archival survival, unbumped persistent entry archival trap verification, missing-key guards, permissionlessextend_ttl, and temporary allowance TTL tests)cargo build --target wasm32v1-none --releaseprettier --check apps/docs/operations/mainnet-deployment.md