Overview
Issue #60 centralized extend_ttl/require_admin/require_oracle into mergefi_common — confirmed genuinely done (contracts/{escrow,milestones,maintenance-pool}/src/lib.rs all call mergefi_common::extend_ttl/require_admin/require_oracle). But each contract still has its own private, byte-identical extend_instance_ttl helper:
fn extend_instance_ttl(env: &Env) {
env.storage().instance().extend_ttl(100_000, 500_000);
}
(contracts/escrow/src/lib.rs:750-752, contracts/milestones/src/lib.rs:853-855, contracts/maintenance-pool/src/lib.rs:517-519), each with its own copy of the doc comment explaining what instance storage holds. This is exactly the kind of triplication #60/#162/#163 were filed to eliminate, just for a function those issues didn't happen to name.
Requirements
Add a shared extend_instance_ttl(env: &Env) to mergefi_common (parallel to extend_ttl), and have all three contracts call it instead of their own private copies.
Acceptance Criteria
Additional Notes
Verified via grep -n "fn extend_instance_ttl" contracts/*/src/lib.rs — three separate, byte-identical definitions. Cross-reference: #60 (closed, correctly centralized extend_ttl but not this function).
Overview
Issue #60 centralized
extend_ttl/require_admin/require_oracleintomergefi_common— confirmed genuinely done (contracts/{escrow,milestones,maintenance-pool}/src/lib.rsall callmergefi_common::extend_ttl/require_admin/require_oracle). But each contract still has its own private, byte-identicalextend_instance_ttlhelper:(
contracts/escrow/src/lib.rs:750-752,contracts/milestones/src/lib.rs:853-855,contracts/maintenance-pool/src/lib.rs:517-519), each with its own copy of the doc comment explaining what instance storage holds. This is exactly the kind of triplication #60/#162/#163 were filed to eliminate, just for a function those issues didn't happen to name.Requirements
Add a shared
extend_instance_ttl(env: &Env)tomergefi_common(parallel toextend_ttl), and have all three contracts call it instead of their own private copies.Acceptance Criteria
contracts/common/src/lib.rscargo test --workspacepassesAdditional Notes
Verified via
grep -n "fn extend_instance_ttl" contracts/*/src/lib.rs— three separate, byte-identical definitions. Cross-reference: #60 (closed, correctly centralizedextend_ttlbut not this function).