CurveAdapter

Description:

Smart contract deployed on Ethereum with Oracle features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.0 ^0.8.19;

// interfaces/AggregatorV3Interface.sol

// solhint-disable-next-line interface-starts-with-i
interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(
    uint80 _roundId
  ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

  function latestRoundData()
    external
    view
    returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}

// src/chainlink_curve_adapter.sol

contract CurveAdapter {
    AggregatorV3Interface public immutable oracle;
    uint256 public immutable factor;

    constructor(AggregatorV3Interface _oracle) {
        oracle = _oracle;
        factor = 10 ** (18 - _oracle.decimals());
    }

    function lastPrice() external view returns (uint256) {
        (, int256 price, , , ) = oracle.latestRoundData();
        return uint256(price) * factor;
    }
}

Tags:
Oracle|addr:0x97dbce7f4c76f867e624d0ccb95776d2364c234b|verified:true|block:23669448|tx:0x7f553da22f1493211170d8627daddefa9209d10c9426c32e59b5573fbe4eba7e|first_check:1761579784

Submitted on: 2025-10-27 16:43:04

Comments

Log in to comment.

No comments yet.