From 29dee37eda674b70e673b6d7d1ce4f1cfdbb94be Mon Sep 17 00:00:00 2001 From: Jordy Romuald <87231934+JordyRo1@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:41:31 +0100 Subject: [PATCH] audit: zero check pair (#66) --- src/oracle/oracle.cairo | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/oracle/oracle.cairo b/src/oracle/oracle.cairo index bd555546..95319f27 100644 --- a/src/oracle/oracle.cairo +++ b/src/oracle/oracle.cairo @@ -383,6 +383,12 @@ mod Oracle { break (); } let key_pair = *key_pairs.get(idx).unwrap().unbox(); + let base_currency = self.oracle_currencies_storage.read(key_pair.base_currency_id); + assert(base_currency.id != 0, 'No base currency registered'); + let quote_currency = self + .oracle_currencies_storage + .read(key_pair.quote_currency_id); + assert(quote_currency.id != 0, 'No quote currency registered'); self.oracle_pairs_storage.write(key_pair.id, key_pair); self .oracle_pair_id_storage