Skip to content

Commit

Permalink
update oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyewwww committed Aug 15, 2024
1 parent 9423c1b commit e1b0645
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions contracts/GasSavingPool/adapter/SolvOracleAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ interface IOracle {

interface ISftWrappedToken {
function getValueByShares(uint256 shares) external view returns (uint256 value);
function underlyingAsset() external view returns (address);
}

interface IERC20 {
function decimals() external view returns(uint8);
function getOracleDecimals() external view returns (uint8);
}

contract SolvOracleAdapter is IOracle {
Expand All @@ -31,8 +27,7 @@ contract SolvOracleAdapter is IOracle {
}

function getDecimalCorrect(address base) public view returns (uint256 decimalCorrect, bool multiplyOrNot) {
address underlyingAsset = ISftWrappedToken(base).underlyingAsset();
uint256 decimals = IERC20(underlyingAsset).decimals();
uint256 decimals = uint256(ISftWrappedToken(base).getOracleDecimals());

if(18 > decimals) {
decimalCorrect = 18 - decimals;
Expand All @@ -45,9 +40,4 @@ contract SolvOracleAdapter is IOracle {
multiplyOrNot = false;
}
}

function getUnderlyingAsset(address base) public view returns(address asset, uint256 dec) {
asset = ISftWrappedToken(base).underlyingAsset();
dec = IERC20(asset).decimals();
}
}

0 comments on commit e1b0645

Please sign in to comment.