Skip to content

Commit

Permalink
feat(lp_pricer_contract): move
Browse files Browse the repository at this point in the history
  • Loading branch information
akhercha committed Oct 16, 2024
1 parent b9c1954 commit 61878a0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/lp_pricer/lp_pricer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ struct PoolInfo {
total_supply: u256,
}

#[starknet::interface]
trait IERC20<TContractState> {
fn symbol(self: @TContractState) -> felt252;
}

/// Represents a Pool contract.
#[starknet::interface]
trait IPool<TContractState> {
fn name(self: @TContractState) -> felt252;
Expand Down Expand Up @@ -61,10 +57,10 @@ mod LpPricer {
use traits::TryInto;
use pragma::admin::admin::Ownable;
use pragma::oracle::oracle::{IOracleABIDispatcher, IOracleABIDispatcherTrait, DataType};
use super::{
PoolInfo, ILpPricer, IPoolDispatcher, IPoolDispatcherTrait, IERC20Dispatcher,
IERC20DispatcherTrait
use openzeppelin::token::erc20::interface::{
ERC20CamelABIDispatcher, ERC20CamelABIDispatcherTrait
};
use super::{PoolInfo, ILpPricer, IPoolDispatcher, IPoolDispatcherTrait};
use pragma::utils::strings::StringTrait;

const USD_PAIR_SUFFIX: felt252 = '/USD';
Expand Down Expand Up @@ -307,8 +303,8 @@ mod LpPricer {
fn get_tokens_symbols(
token_a_address: ContractAddress, token_b_address: ContractAddress
) -> (felt252, felt252) {
let token_a = IERC20Dispatcher { contract_address: token_a_address };
let token_b = IERC20Dispatcher { contract_address: token_b_address };
let token_a = ERC20CamelABIDispatcher { contract_address: token_a_address };
let token_b = ERC20CamelABIDispatcher { contract_address: token_b_address };
(token_a.symbol(), token_b.symbol())
}

Expand Down

0 comments on commit 61878a0

Please sign in to comment.