Skip to content

Commit

Permalink
audit: zero check pair (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 authored Nov 10, 2023
1 parent fe83707 commit 29dee37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/oracle/oracle.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 29dee37

Please sign in to comment.