Skip to content

[INFO] reserve_contract is the only contract with correct TTL handling, access control, and bounds checking — and it's unused #428

Description

@phertyameen

Location: contracts/reserve_contract/src/lib.rs (entire contract) vs the cross-contract TTL/disconnection issues above

Root cause / scenario:
reserve_contract calls storage::extend_instance_ttl(&env) at the top of every single function, correctly gates set_base_reserve behind a stored admin's require_auth(), validates amount bounds (0 < amount <= MAX_RESERVE_STROOPS), and has 20 passing tests — the strongest-built contract in the workspace by a clear margin.

Impact:
None of this care currently has any effect on the deployed system's behavior, since (per the cross-contract 'orphaned reserve_contract' issue above) nothing else in the codebase ever calls it.

Suggested fix:
Not asking for a code change here — flagging this as the clearest evidence that wiring reserve_contract into ephemeral_account's initialize() (the fix recommended in the disconnection issue) is low-risk: the contract being integrated is already the most defensively written one in the repo.


Found by reading the contract source directly and cross-checking docs/security.md and docs/reentrancy-analysis.md (item 28/32).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions