@@ -98,11 +98,6 @@ pub trait IOracle<TContractState> {
9898
9999 // Returns the set oracle token
100100 fn get_oracle_token (self : @ TContractState ) -> ContractAddress ;
101-
102- // Sets the oracle token. If set to a non-zero address, the oracle only allows Oracle pools with
103- // the specified token, and uses that token as the intermediary oracle for all queries If set to
104- // zero, any oracle pool may be created.
105- fn set_oracle_token (ref self : TContractState , oracle_token : ContractAddress );
106101}
107102
108103#[starknet:: contract]
@@ -321,7 +316,7 @@ pub mod Oracle {
321316
322317 let oracle_token = self . oracle_token. read ();
323318
324- if oracle_token . is_zero () || base_token == oracle_token || quote_token == oracle_token {
319+ if base_token == oracle_token || quote_token == oracle_token {
325320 let (token0 , token1 , flipped ) = if base_token < quote_token {
326321 (base_token , quote_token , false )
327322 } else {
@@ -498,10 +493,6 @@ pub mod Oracle {
498493 fn get_oracle_token (self : @ ContractState ) -> ContractAddress {
499494 self . oracle_token. read ()
500495 }
501-
502- fn set_oracle_token (ref self : ContractState , oracle_token : ContractAddress ) {
503- self . oracle_token. write (oracle_token );
504- }
505496 }
506497
507498 pub (crate ) const MAX_TICK_SPACING : u128 = 354892 ;
@@ -514,12 +505,10 @@ pub mod Oracle {
514505 self . check_caller_is_core ();
515506
516507 let oracle_token = self . oracle_token. read ();
517- if oracle_token . is_non_zero () {
518- assert (
519- pool_key . token0 == oracle_token || pool_key . token1 == oracle_token ,
520- ' Must use oracle token'
521- );
522- }
508+ assert (
509+ pool_key . token0 == oracle_token || pool_key . token1 == oracle_token ,
510+ ' Must use oracle token'
511+ );
523512
524513 let key = pool_key . to_pair_key ();
525514
@@ -609,16 +598,14 @@ pub mod Oracle {
609598
610599 let oracle_token = self . oracle_token. read ();
611600
612- if oracle_token . is_non_zero () {
613- // must be using the oracle token in the pool, or withdrawing liquidity
614- assert (
615- pool_key . token0 == oracle_token
616- || pool_key . token1 == oracle_token
617- || params . liquidity_delta. is_zero ()
618- || params . liquidity_delta. sign,
619- ' Must use oracle token'
620- );
621- }
601+ // must be using the oracle token in the pool, or withdrawing liquidity
602+ assert (
603+ pool_key . token0 == oracle_token
604+ || pool_key . token1 == oracle_token
605+ || params . liquidity_delta. is_zero ()
606+ || params . liquidity_delta. sign,
607+ ' Must use oracle token'
608+ );
622609 }
623610
624611 fn after_update_position (
0 commit comments