Overview
oracle.rs defines types and storage functions but there is no entrypoint to push or update price data. est_oracle.rs is 784 bytes with a single placeholder test.
Background
The oracle is needed to validate reward amounts against live token prices and to prevent quest creators from setting rewards below a minimum USD value.
Specifications
Features:
- set_price(env, caller, token, price_data) entrypoint gated behind OracleAdmin role
- Price staleness check: reject prices older than configurable TTL
- Circuit-breaker: halt new quest registrations when price feed is stale
Tasks:
- Implement set_price in oracle.rs
n- Add staleness check in �alidation.rsn- Expand est_oracle.rs with staleness and circuit-breaker tests
Impacted Files:
- contracts/earn-quest/src/oracle.rs
n- contracts/earn-quest/src/validation.rsn- contracts/earn-quest/tests/test_oracle.rs`n
Acceptance Criteria:
- Price update accepted from OracleAdmin
- Stale price (>1h) causes quest registration to fail
- All new oracle tests pass
Overview
oracle.rs defines types and storage functions but there is no entrypoint to push or update price data. est_oracle.rs is 784 bytes with a single placeholder test.
Background
The oracle is needed to validate reward amounts against live token prices and to prevent quest creators from setting rewards below a minimum USD value.
Specifications
Features:
Tasks:
n- Add staleness check in �alidation.rsn- Expand est_oracle.rs with staleness and circuit-breaker testsImpacted Files:
n- contracts/earn-quest/src/validation.rsn- contracts/earn-quest/tests/test_oracle.rs`nAcceptance Criteria: