Discover more of SonicScan Block Explorer's tools and services in one place.
Contract Source Code:
File 1 of 1 : s_pricefeed.sol
pragma solidity ^0.8.20; interface AggregatorV3Interface { function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } contract SPriceOracle { AggregatorV3Interface public priceFeed; constructor() { priceFeed = AggregatorV3Interface(0x726D2E87d73567ecA1b75C063Bd09c1493655918); } /// @notice Returns the USD price of S in 1e18 based on API3 function getLatestPrice() external view returns (uint256) { (, int256 price,,,) = priceFeed.latestRoundData(); require(price > 0, "Invalid price from Chainlink"); return uint256(price); } }
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.