-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Title: Decentralized Score Feed Aggregation
Description
Create contract to aggregate multiple oracle sources.
Acceptance Criteria:
- Accepts data from 3+ oracle providers
- Uses median value for scores
- Filters outlier data
- Emits
NewRoundevents
Technical Details:
#[starknet::contract]
mod OracleProxy {
#[storage]
struct Storage {
authorized_oracles: LegacyMap<felt252, bool>,
latest_scores: LegacyMap<felt252, u64>
}
#[external(v0)]
fn submit_score(
ref self: ContractState,
player_id: felt252,
score: u64,
timestamp: u64
) {
assert(self.authorized_oracles.read(get_caller_address()), 'Unauthorized');
// Store data and calculate median
let submissions = self.scores.read(player_id);
submissions.push_back((score, timestamp));
if submissions.len() >= 3 {
let median = calculate_median(submissions);
self.latest_scores.write(player_id, median);
}
}
}Notes:
- Implement data freshness checks
- Add oracle reputation system
- Test chainlink + starknet integration
Reactions are currently unavailable