ETH Price: $2,659.67 (+1.19%)

Contract

0x729eE70bfdF65bEc7A530Fd49F644d07D0b2c087
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
JBChainlinkV3PriceFeed

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 4 : JBChainlinkV3PriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import './interfaces/AggregatorV3Interface.sol';
import './interfaces/IJBPriceFeed.sol';
import './libraries/JBFixedPointNumber.sol';

/** 
  @notice 
  A generalized price feed for the Chainlink AggregatorV3Interface.

  @dev
  Adheres to -
  IJBPriceFeed: General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules.
*/
contract JBChainlinkV3PriceFeed is IJBPriceFeed {
  // A library that provides utility for fixed point numbers.
  using JBFixedPointNumber for uint256;

  //*********************************************************************//
  // --------------------- public stored properties -------------------- //
  //*********************************************************************//

  /** 
    @notice 
    The feed that prices are reported from.
  */
  AggregatorV3Interface public feed;

  //*********************************************************************//
  // ------------------------- external views -------------------------- //
  //*********************************************************************//

  /** 
    @notice 
    Gets the current price from the feed, normalized to the specified number of decimals.

    @param _decimals The number of decimals the returned fixed point price should include.

    @return The current price of the feed, as a fixed point number with the specified number of decimals.
  */
  function currentPrice(uint256 _decimals) external view override returns (uint256) {
    // Get the latest round information. Only need the price is needed.
    (, int256 _price, , , ) = feed.latestRoundData();

    // Get a reference to the number of decimals the feed uses.
    uint256 _feedDecimals = feed.decimals();

    // Return the price, adjusted to the target decimals.
    return uint256(_price).adjustDecimals(_feedDecimals, _decimals);
  }

  //*********************************************************************//
  // -------------------------- constructor ---------------------------- //
  //*********************************************************************//

  /** 
    @param _feed The feed to report prices from.
  */
  constructor(AggregatorV3Interface _feed) {
    feed = _feed;
  }
}

File 2 of 4 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;

interface AggregatorV3Interface {

  function decimals() external view returns (uint8);
  function description() external view returns (string memory);
  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  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
    );

}

File 3 of 4 : IJBPriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

interface IJBPriceFeed {
  function currentPrice(uint256 _targetDecimals) external view returns (uint256);
}

File 4 of 4 : JBFixedPointNumber.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

library JBFixedPointNumber {
  function adjustDecimals(
    uint256 _value,
    uint256 _decimals,
    uint256 _targetDecimals
  ) internal pure returns (uint256) {
    // If decimals need adjusting, multiply or divide the price by the decimal adjuster to get the normalized result.
    if (_targetDecimals == _decimals) return _value;
    else if (_targetDecimals > _decimals) return _value * 10**(_targetDecimals - _decimals);
    else return _value / 10**(_decimals - _targetDecimals);
  }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "evmVersion": "berlin",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract AggregatorV3Interface","name":"_feed","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"_decimals","type":"uint256"}],"name":"currentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feed","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516105c83803806105c883398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610535806100936000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806337a7b7d81461003b5780637a3c4c1714610085575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009861009336600461028c565b6100a6565b60405190815260200161007c565b60008054604080517ffeaf968c0000000000000000000000000000000000000000000000000000000081529051839273ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048083019260a0929190829003018186803b15801561011157600080fd5b505afa158015610125573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014991906102a5565b50505091505060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156101b857600080fd5b505afa1580156101cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f091906102f5565b60ff169050610200828286610208565b949350505050565b600082821415610219575082610266565b828211156102475761022b83836104b9565b61023690600a6103b4565b610240908561047c565b9050610266565b61025182846104b9565b61025c90600a6103b4565b6102409085610318565b9392505050565b805169ffffffffffffffffffff8116811461028757600080fd5b919050565b60006020828403121561029e57600080fd5b5035919050565b600080600080600060a086880312156102bd57600080fd5b6102c68661026d565b94506020860151935060408601519250606086015191506102e96080870161026d565b90509295509295909350565b60006020828403121561030757600080fd5b815160ff8116811461026657600080fd5b60008261034e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600181815b808511156103ac57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610392576103926104d0565b8085161561039f57918102915b93841c9390800290610358565b509250929050565b600061026683836000826103ca57506001610476565b816103d757506000610476565b81600181146103ed57600281146103f757610413565b6001915050610476565b60ff841115610408576104086104d0565b50506001821b610476565b5060208310610133831016604e8410600b8410161715610436575081810a610476565b6104408383610353565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610472576104726104d0565b0290505b92915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156104b4576104b46104d0565b500290565b6000828210156104cb576104cb6104d0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212209e7cbbfe28d14e951b12fdafbc1afbb63ca11add35d4dfed7d8d8ae0d1790a0164736f6c634300080600330000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c806337a7b7d81461003b5780637a3c4c1714610085575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009861009336600461028c565b6100a6565b60405190815260200161007c565b60008054604080517ffeaf968c0000000000000000000000000000000000000000000000000000000081529051839273ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048083019260a0929190829003018186803b15801561011157600080fd5b505afa158015610125573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014991906102a5565b50505091505060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156101b857600080fd5b505afa1580156101cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f091906102f5565b60ff169050610200828286610208565b949350505050565b600082821415610219575082610266565b828211156102475761022b83836104b9565b61023690600a6103b4565b610240908561047c565b9050610266565b61025182846104b9565b61025c90600a6103b4565b6102409085610318565b9392505050565b805169ffffffffffffffffffff8116811461028757600080fd5b919050565b60006020828403121561029e57600080fd5b5035919050565b600080600080600060a086880312156102bd57600080fd5b6102c68661026d565b94506020860151935060408601519250606086015191506102e96080870161026d565b90509295509295909350565b60006020828403121561030757600080fd5b815160ff8116811461026657600080fd5b60008261034e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600181815b808511156103ac57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610392576103926104d0565b8085161561039f57918102915b93841c9390800290610358565b509250929050565b600061026683836000826103ca57506001610476565b816103d757506000610476565b81600181146103ed57600281146103f757610413565b6001915050610476565b60ff841115610408576104086104d0565b50506001821b610476565b5060208310610133831016604e8410600b8410161715610436575081810a610476565b6104408383610353565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610472576104726104d0565b0290505b92915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156104b4576104b46104d0565b500290565b6000828210156104cb576104cb6104d0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212209e7cbbfe28d14e951b12fdafbc1afbb63ca11add35d4dfed7d8d8ae0d1790a0164736f6c63430008060033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

-----Decoded View---------------
Arg [0] : _feed (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419


Deployed Bytecode Sourcemap

460:1892:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;925:33;;;;;;;;;;;;1344:42:4;1332:55;;;1314:74;;1302:2;1287:18;925:33:0;;;;;;;;1520:460;;;;;;:::i;:::-;;:::i;:::-;;;1545:25:4;;;1533:2;1518:18;1520:460:0;1500:76:4;1520:460:0;1593:7;1708:4;;:22;;;;;;;;1593:7;;1708:4;;;:20;;:22;;;;;;;;;;;;;;:4;:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1682:48;;;;;;1804:21;1828:4;;;;;;;;;;;:13;;;:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1804:39;;;-1:-1:-1;1918:56:0;1926:6;1804:39;1964:9;1918:30;:56::i;:::-;1911:63;1520:460;-1:-1:-1;;;;1520:460:0:o;91:470:3:-;218:7;376:9;357:15;:28;353:202;;;-1:-1:-1;394:6:3;387:13;;353:202;434:9;416:15;:27;412:143;;;466:27;484:9;466:15;:27;:::i;:::-;461:33;;:2;:33;:::i;:::-;452:42;;:6;:42;:::i;:::-;445:49;;;;412:143;527:27;539:15;527:9;:27;:::i;:::-;522:33;;:2;:33;:::i;:::-;513:42;;:6;:42;:::i;412:143::-;91:470;;;;;:::o;14:179:4:-;92:13;;145:22;134:34;;124:45;;114:2;;183:1;180;173:12;114:2;73:120;;;:::o;198:180::-;257:6;310:2;298:9;289:7;285:23;281:32;278:2;;;326:1;323;316:12;278:2;-1:-1:-1;349:23:4;;268:110;-1:-1:-1;268:110:4:o;383:473::-;486:6;494;502;510;518;571:3;559:9;550:7;546:23;542:33;539:2;;;588:1;585;578:12;539:2;611:39;640:9;611:39;:::i;:::-;601:49;;690:2;679:9;675:18;669:25;659:35;;734:2;723:9;719:18;713:25;703:35;;778:2;767:9;763:18;757:25;747:35;;801:49;845:3;834:9;830:19;801:49;:::i;:::-;791:59;;529:327;;;;;;;;:::o;861:273::-;929:6;982:2;970:9;961:7;957:23;953:32;950:2;;;998:1;995;988:12;950:2;1030:9;1024:16;1080:4;1073:5;1069:16;1062:5;1059:27;1049:2;;1100:1;1097;1090:12;1581:274;1621:1;1647;1637:2;;1682:77;1679:1;1672:88;1783:4;1780:1;1773:15;1811:4;1808:1;1801:15;1637:2;-1:-1:-1;1840:9:4;;1627:228::o;1860:482::-;1949:1;1992:5;1949:1;2006:330;2027:7;2017:8;2014:21;2006:330;;;2146:4;2078:66;2074:77;2068:4;2065:87;2062:2;;;2155:18;;:::i;:::-;2205:7;2195:8;2191:22;2188:2;;;2225:16;;;;2188:2;2304:22;;;;2264:15;;;;2006:330;;;2010:3;1924:418;;;;;:::o;2347:131::-;2407:5;2436:36;2463:8;2457:4;2532:5;2562:8;2552:2;;-1:-1:-1;2603:1:4;2617:5;;2552:2;2651:4;2641:2;;-1:-1:-1;2688:1:4;2702:5;;2641:2;2733:4;2751:1;2746:59;;;;2819:1;2814:130;;;;2726:218;;2746:59;2776:1;2767:10;;2790:5;;;2814:130;2851:3;2841:8;2838:17;2835:2;;;2858:18;;:::i;:::-;-1:-1:-1;;2914:1:4;2900:16;;2929:5;;2726:218;;3028:2;3018:8;3015:16;3009:3;3003:4;3000:13;2996:36;2990:2;2980:8;2977:16;2972:2;2966:4;2963:12;2959:35;2956:77;2953:2;;;-1:-1:-1;3065:19:4;;;3097:5;;2953:2;3144:34;3169:8;3163:4;3144:34;:::i;:::-;3274:6;3206:66;3202:79;3193:7;3190:92;3187:2;;;3285:18;;:::i;:::-;3323:20;;-1:-1:-1;2542:807:4;;;;;:::o;3354:228::-;3394:7;3520:1;3452:66;3448:74;3445:1;3442:81;3437:1;3430:9;3423:17;3419:105;3416:2;;;3527:18;;:::i;:::-;-1:-1:-1;3567:9:4;;3406:176::o;3587:125::-;3627:4;3655:1;3652;3649:8;3646:2;;;3660:18;;:::i;:::-;-1:-1:-1;3697:9:4;;3636:76::o;3717:184::-;3769:77;3766:1;3759:88;3866:4;3863:1;3856:15;3890:4;3887:1;3880:15

Swarm Source

ipfs://9e7cbbfe28d14e951b12fdafbc1afbb63ca11add35d4dfed7d8d8ae0d1790a01

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.