Issue #1022 requested adding version/metadata view functionality to the yield-tier contract. After thorough analysis, this functionality is already fully implemented in the escrow contract, which contains all yield tier functionality.
- Location:
escrow/src/lib.rs:2806 - Signature:
pub fn get_version(env: Env) -> u32 - Implementation:
pub fn get_version(env: Env) -> u32 { env.storage().instance().get(&DataKey::Version).unwrap_or(0) }
✅ Read-only version function: get_version() exists and is read-only (no mutations)
✅ Returns sane default before init: Returns 0 via unwrap_or(0)
✅ Schema version constant: SCHEMA_VERSION: u32 = 6
✅ Returns actual version after init: Version is set during init and stored in DataKey::Version
The functionality has comprehensive test coverage in escrow/src/tests/init.rs:
// Version written at init
assert_eq!(client.get_version(), crate::SCHEMA_VERSION);Additional tests in:
escrow/src/tests/coverage.rs:1110escrow/src/tests/coverage.rs:1225escrow/src/tests/pause.rs:320
The yield tier functionality is fully integrated within the escrow contract via:
YieldTierstruct for tier definitionsyield_tiersparameter ininit()functioneffective_yield_for_commitment()for tier selectionfund_with_commitment()for tiered depositsget_yield_tiers()for reading tier configurationpreview_yield_tier()for tier preview
Issue #1022 is resolved - the requested version/metadata view functionality already exists and is properly tested. The yield tier contract (implemented within the escrow contract) has full version management capabilities as requested.
No code changes are required as the implementation already meets all specified requirements.