Contract Source Code:
File 1 of 2 : PriceLensAggregator.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import {Aggregator} from "../interfaces/IPriceFeedOracle.sol"; interface PriceLens { function getTokenPriceNative(address _token) external view returns (uint256 price); } contract PriceLensNativeAggregator is Aggregator { address public immutable token; address public immutable priceLens; constructor(address _token, address _priceLens) { token = _token; priceLens = _priceLens; } function latestAnswer() public view returns (int) { uint price = PriceLens(priceLens).getTokenPriceNative(token); return int(price); } function decimals() public pure returns (uint8) { return 18; } }
File 2 of 2 : IPriceFeedOracle.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface Aggregator { function decimals() external view returns (uint8); function latestAnswer() external view returns (int); } interface IPriceFeedOracle { struct OracleAsset { Aggregator aggregator; uint8 decimals; } function ETH() external view returns (address); function assets(address) external view returns (Aggregator, uint8); function getAssetToEthRate(address asset) external view returns (uint); function getAssetForEth(address asset, uint ethIn) external view returns (uint); function getEthForAsset(address asset, uint amount) external view returns (uint); }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.