📌 Description
extend_instance_ttl(env, caller) in src/lib.rs is callable by admin or operator and extends the contract instance/code TTL "so it survives long inactivity" per the README. There's an authorization test opportunity (non-admin/non-operator rejection) and a functional-correctness opportunity (TTL actually extends, verified by advancing simulated ledger time in the test environment) that should both be explicit, named tests rather than incidental coverage.
🧩 Requirements and context
- Add a test asserting a caller who is neither admin nor operator is rejected by
extend_instance_ttl.
- Add a test that advances the test environment's ledger sequence/timestamp past what the instance would survive without extension, and confirms the contract remains callable after
extend_instance_ttl was invoked.
- Use Soroban's test-environment ledger manipulation utilities already available via the
soroban_sdk test harness.
🛠️ Suggested execution
- Add both tests to
src/test.rs, using env.ledger().set(...) (or the SDK's equivalent) to simulate time passing.
- If the authorization check is missing or the TTL extension doesn't actually take effect, fix
extend_instance_ttl in src/lib.rs.
✅ Acceptance criteria
🔒 Security notes
Confirms the admin/operator-only guard on a lifecycle-critical entrypoint, and that the extension is not a no-op that silently leaves the contract vulnerable to archival.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
extend_instance_ttl(env, caller)insrc/lib.rsis callable by admin or operator and extends the contract instance/code TTL "so it survives long inactivity" per the README. There's an authorization test opportunity (non-admin/non-operator rejection) and a functional-correctness opportunity (TTL actually extends, verified by advancing simulated ledger time in the test environment) that should both be explicit, named tests rather than incidental coverage.🧩 Requirements and context
extend_instance_ttl.extend_instance_ttlwas invoked.soroban_sdktest harness.🛠️ Suggested execution
src/test.rs, usingenv.ledger().set(...)(or the SDK's equivalent) to simulate time passing.extend_instance_ttlinsrc/lib.rs.✅ Acceptance criteria
🔒 Security notes
Confirms the admin/operator-only guard on a lifecycle-critical entrypoint, and that the extension is not a no-op that silently leaves the contract vulnerable to archival.
📋 Guidelines