ETH Price: $1,829.39 (-1.16%)
Gas: 0.39 Gwei

Contract

0x656F1F3A4df83a10Afb2BD2eCaD8EF4A96C9e4D0
 

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

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
IbBtcTokenOracle

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 5000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 4 : IbBtcTokenOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "../../interfaces/periphery/IOracle.sol";
import "../../interfaces/periphery/ITokenOracle.sol";
import "../../interfaces/external/badger/IXToken.sol";

/**
 * @title Oracle for ibBTC token
 */
contract IbBtcTokenOracle is ITokenOracle {
    IXToken public constant IBBTC = IXToken(0xc4E15973E6fF2A35cC804c2CF9D2a1b817a8b40F);
    IXToken public constant WIBBTC = IXToken(0x8751D4196027d4e6DA63716fA7786B5174F04C15);

    /// @notice BTC/USD oracle
    ITokenOracle public immutable btcOracle;

    constructor(ITokenOracle btcOracle_) {
        btcOracle = btcOracle_;
    }

    /// @inheritdoc ITokenOracle
    function getPriceInUsd(address token_) external view override returns (uint256 _priceInUsd) {
        if (token_ == address(IBBTC)) {
            return (btcOracle.getPriceInUsd(address(0)) * IBBTC.pricePerShare()) / 1e18;
        }
        if (token_ == address(WIBBTC)) {
            return (btcOracle.getPriceInUsd(address(0)) * IBBTC.pricePerShare()) / WIBBTC.pricePerShare();
        }

        revert("invalid-ibbtc-related-token");
    }
}

File 2 of 4 : IXToken.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface IXToken {
    function pricePerShare() external view returns (uint256);
}

File 3 of 4 : IOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface IOracle {
    /**
     * @notice Get USD (or equivalent) price of an asset
     * @param token_ The address of asset
     * @return _priceInUsd The USD price
     */
    function getPriceInUsd(address token_) external view returns (uint256 _priceInUsd);

    /**
     * @notice Get quote
     * @param tokenIn_ The address of assetIn
     * @param tokenOut_ The address of assetOut
     * @param amountIn_ Amount of input token
     * @return _amountOut Amount out
     */
    function quote(
        address tokenIn_,
        address tokenOut_,
        uint256 amountIn_
    ) external view returns (uint256 _amountOut);

    /**
     * @notice Get quote in USD (or equivalent) amount
     * @param token_ The address of assetIn
     * @param amountIn_ Amount of input token.
     * @return amountOut_ Amount in USD
     */
    function quoteTokenToUsd(address token_, uint256 amountIn_) external view returns (uint256 amountOut_);

    /**
     * @notice Get quote from USD (or equivalent) amount to amount of token
     * @param token_ The address of assetOut
     * @param amountIn_ Input amount in USD
     * @return _amountOut Output amount of token
     */
    function quoteUsdToToken(address token_, uint256 amountIn_) external view returns (uint256 _amountOut);
}

File 4 of 4 : ITokenOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface ITokenOracle {
    /**
     * @notice Get USD (or equivalent) price of an asset
     * @param token_ The address of asset
     * @return _priceInUsd The USD price
     */
    function getPriceInUsd(address token_) external view returns (uint256 _priceInUsd);
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 5000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract ITokenOracle","name":"btcOracle_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"IBBTC","outputs":[{"internalType":"contract IXToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WIBBTC","outputs":[{"internalType":"contract IXToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"btcOracle","outputs":[{"internalType":"contract ITokenOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"}],"name":"getPriceInUsd","outputs":[{"internalType":"uint256","name":"_priceInUsd","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b506040516105e03803806105e083398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161054f61009160003960008181607c01526101f7015261054f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806307ee40bf1461005157806322a15848146100775780635c7fdafc146100c3578063ccae9f3d146100de575b600080fd5b61006461005f366004610424565b6100f9565b6040519081526020015b60405180910390f35b61009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161006e565b61009e73c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f81565b61009e738751d4196027d4e6da63716fa7786b5174f04c1581565b600073ffffffffffffffffffffffffffffffffffffffff821673c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f14156102a057670de0b6b3a764000073c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f73ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561019057600080fd5b505afa1580156101a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c89190610461565b6040517f07ee40bf000000000000000000000000000000000000000000000000000000008152600060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906307ee40bf9060240160206040518083038186803b15801561024e57600080fd5b505afa158015610262573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102869190610461565b610290919061047a565b61029a91906104de565b92915050565b73ffffffffffffffffffffffffffffffffffffffff8216738751d4196027d4e6da63716fa7786b5174f04c1514156103be57738751d4196027d4e6da63716fa7786b5174f04c1573ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561032c57600080fd5b505afa158015610340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103649190610461565b73c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f73ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561019057600080fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c69642d69626274632d72656c617465642d746f6b656e0000000000604482015260640160405180910390fd5b60006020828403121561043657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461045a57600080fd5b9392505050565b60006020828403121561047357600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156104d9577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500290565b600082610514577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea264697066735822122026824a70d5e5588aee01b04ce12962783e39db88ce778453a695b129c9fc4f6264736f6c63430008090033000000000000000000000000e2a466df120fb847520763461d99c22ea5ba8cc8

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806307ee40bf1461005157806322a15848146100775780635c7fdafc146100c3578063ccae9f3d146100de575b600080fd5b61006461005f366004610424565b6100f9565b6040519081526020015b60405180910390f35b61009e7f000000000000000000000000e2a466df120fb847520763461d99c22ea5ba8cc881565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161006e565b61009e73c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f81565b61009e738751d4196027d4e6da63716fa7786b5174f04c1581565b600073ffffffffffffffffffffffffffffffffffffffff821673c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f14156102a057670de0b6b3a764000073c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f73ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561019057600080fd5b505afa1580156101a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c89190610461565b6040517f07ee40bf000000000000000000000000000000000000000000000000000000008152600060048201527f000000000000000000000000e2a466df120fb847520763461d99c22ea5ba8cc873ffffffffffffffffffffffffffffffffffffffff16906307ee40bf9060240160206040518083038186803b15801561024e57600080fd5b505afa158015610262573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102869190610461565b610290919061047a565b61029a91906104de565b92915050565b73ffffffffffffffffffffffffffffffffffffffff8216738751d4196027d4e6da63716fa7786b5174f04c1514156103be57738751d4196027d4e6da63716fa7786b5174f04c1573ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561032c57600080fd5b505afa158015610340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103649190610461565b73c4e15973e6ff2a35cc804c2cf9d2a1b817a8b40f73ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561019057600080fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c69642d69626274632d72656c617465642d746f6b656e0000000000604482015260640160405180910390fd5b60006020828403121561043657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461045a57600080fd5b9392505050565b60006020828403121561047357600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156104d9577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500290565b600082610514577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea264697066735822122026824a70d5e5588aee01b04ce12962783e39db88ce778453a695b129c9fc4f6264736f6c63430008090033

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

000000000000000000000000e2a466df120fb847520763461d99c22ea5ba8cc8

-----Decoded View---------------
Arg [0] : btcOracle_ (address): 0xE2A466DF120FB847520763461D99C22EA5Ba8cC8

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e2a466df120fb847520763461d99c22ea5ba8cc8


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
Loading...
Loading
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.