Severity: Elevated (downgraded from Critical β see below) Β· Area: Contract (contracts/token-factory/src/lib.rs), Docs
Description
What has been fixed since this was filed. The critical half of this issue is gone. The argument-ignoring extend_token_ttl(env, _token_address, _index) no longer exists anywhere in the tree. Token bookkeeping moved from a single shared instance entry to persistent storage, and every persistent read and write goes through helpers that extend that specific key's TTL on access β set_persistent (lib.rs:454-455), migrate_addr_keyed (lib.rs:474-475), and the count-key path (lib.rs:496-500). One archival event can therefore no longer take down all token bookkeeping at once; each entry's rent is tracked independently. docs/contract-abi.md:36 documents this, and :38-41 documents the two mechanisms that migrate pre-v3 data out of legacy instance storage.
What remains. The archival risk is now bounded rather than catastrophic, but three pieces of the original scope were never delivered, and they are the pieces that matter for a token nobody has touched in a month:
- There is no permissionless keep-alive path. A token's entries are extended only when someone calls a factory entrypoint that touches that token. A token created once and never minted, never re-metadata'd, and never transferred gets no extension at all after creation. Its owner has no contract function to call to keep it alive β every extension helper is internal, and no
extend_ttls(keys)-style maintenance entrypoint exists (grep for extend_token_ttl, extend_ttls, RestoreFootprint across contracts/, scripts/, docs/, and frontend/src returns nothing).
- There is no restore procedure. Nothing in
docs/ β not incident-response.md, not mainnet-deployment-checklist.md β describes what an operator does once an entry has been archived. docs/contract-abi.md is the only file mentioning TTL at all, and it describes prevention, not recovery.
- There is no TTL monitoring and no ledger-advancing test. No check surfaces how close any entry is to expiry, and
test.rs has no test that advances the ledger past a TTL boundary to prove either that touched entries survive or that archived entries can be recovered. The per-key extension is asserted by construction, not by test.
Severity drops from Critical to Elevated because the blast radius is now one idle token rather than the whole factory, and the state/admin/fee configuration in instance storage is extended by any factory activity at all.
Tasks
Acceptance Criteria
Re-verified and narrowed on 2026-08-19 during the 30-issue codebase audit tracked in ISSUES.md.
Severity: Elevated (downgraded from Critical β see below) Β· Area: Contract (
contracts/token-factory/src/lib.rs), DocsDescription
What has been fixed since this was filed. The critical half of this issue is gone. The argument-ignoring
extend_token_ttl(env, _token_address, _index)no longer exists anywhere in the tree. Token bookkeeping moved from a single sharedinstanceentry topersistentstorage, and every persistent read and write goes through helpers that extend that specific key's TTL on access βset_persistent(lib.rs:454-455),migrate_addr_keyed(lib.rs:474-475), and the count-key path (lib.rs:496-500). One archival event can therefore no longer take down all token bookkeeping at once; each entry's rent is tracked independently.docs/contract-abi.md:36documents this, and:38-41documents the two mechanisms that migrate pre-v3 data out of legacyinstancestorage.What remains. The archival risk is now bounded rather than catastrophic, but three pieces of the original scope were never delivered, and they are the pieces that matter for a token nobody has touched in a month:
extend_ttls(keys)-style maintenance entrypoint exists (grepforextend_token_ttl,extend_ttls,RestoreFootprintacrosscontracts/,scripts/,docs/, andfrontend/srcreturns nothing).docs/β notincident-response.md, notmainnet-deployment-checklist.mdβ describes what an operator does once an entry has been archived.docs/contract-abi.mdis the only file mentioning TTL at all, and it describes prevention, not recovery.test.rshas no test that advances the ledger past a TTL boundary to prove either that touched entries survive or that archived entries can be recovered. The per-key extension is asserted by construction, not by test.Severity drops from Critical to Elevated because the blast radius is now one idle token rather than the whole factory, and the state/admin/fee configuration in
instancestorage is extended by any factory activity at all.Tasks
extend_token_ttl(token_address)β reusing the name honestly this time, orextend_ttls(keys)) that any address can call to extend a specific token'sTokenInfo/TokenIndex/Metadata/ owner / supply keys, so an idle token's owner is not dependent on transacting to stay alive.ExtendFootprintTTLoperation as the supported keep-alive route, with a worked example against a real token.docs/β detecting archival, constructing theRestoreFootprintoperation, expected rent cost, and who is expected to pay it.api/health/indexer.tsor a sibling health endpoint so proximity to expiry is observable rather than discovered by a user report.Acceptance Criteria
docs/, names its rent cost, and is exercised by a test.docs/contract-abi.md:36currently asserts by construction.Re-verified and narrowed on 2026-08-19 during the 30-issue codebase audit tracked in
ISSUES.md.