ETH Price: $2,989.12 (+5.70%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

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
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Contract Source Code Verified (Exact Match)

Contract Name:
ChainlinkUsdWrapper

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license
/**
 *Submitted for verification at Etherscan.io on 2022-03-16
*/

// SPDX-License-Identifier: GPL-3.0-or-later
// Sources flattened with hardhat v2.6.1 https://hardhat.org

// File libraries/DecimalScale.sol

pragma solidity ^0.8.4;

library DecimalScale {
    uint8 internal constant DECIMALS = 18; // 18 decimal places

    function scaleFrom(uint256 value, uint8 decimals) internal pure returns (uint256) {
        if (decimals == DECIMALS) {
            return value;
        } else if (decimals > DECIMALS) {
            return value / 10**(decimals - DECIMALS);
        } else {
            return value * 10**(DECIMALS - decimals);
        }
    }
}


// File contracts/oracles/ChainlinkUsdWrapper.sol

pragma solidity 0.8.9;

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

    function decimals() external view returns (uint8);
}

/**
 * Wrapper used for converting a Chainlink ETH Oracle to a USD Oracle.
 */
contract ChainlinkUsdWrapper is IChainlinkOracle {
    using DecimalScale for uint256;

    IChainlinkOracle private immutable _ethOracle =
        IChainlinkOracle(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419);
    IChainlinkOracle private immutable _oracle;
    uint8 private immutable _decimals;

    constructor(address oracle_) {
        _oracle = IChainlinkOracle(oracle_);
        _decimals = IChainlinkOracle(oracle_).decimals();
    }

    function latestRoundData()
        external
        view
        override
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        )
    {
        (
            uint80 roundId_,
            int256 answer_,
            uint256 startedAt_,
            uint256 updatedAt_,
            uint80 answeredInRound_
        ) = _oracle.latestRoundData();
        return (roundId_, (answer_ * _ethPrice()) / 1e8, startedAt_, updatedAt_, answeredInRound_);
    }

    function decimals() external view override returns (uint8) {
        return _decimals;
    }

    function _ethPrice() private view returns (int256) {
        (, int256 answer, , , ) = _ethOracle.latestRoundData();
        return answer;
    }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"oracle_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"}]

60e0604052735f4ec3df9cbd43714fe2740f5e3616155c5b841960805234801561002857600080fd5b506040516104fa3803806104fa833981016040819052610047916100d0565b6001600160a01b03811660a08190526040805163313ce56760e01b8152905163313ce56791600480820192602092909190829003018186803b15801561008c57600080fd5b505afa1580156100a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c49190610100565b60ff1660c05250610123565b6000602082840312156100e257600080fd5b81516001600160a01b03811681146100f957600080fd5b9392505050565b60006020828403121561011257600080fd5b815160ff811681146100f957600080fd5b60805160a05160c0516103aa610150600039600060420152600060c10152600061019401526103aa6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063313ce5671461003b578063feaf968c14610071575b600080fd5b60405160ff7f00000000000000000000000000000000000000000000000000000000000000001681526020015b60405180910390f35b6100796100b0565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a001610068565b6000806000806000806000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561011857600080fd5b505afa15801561012c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610150919061024d565b94509450945094509450846305f5e10061016861018f565b61017290876102b3565b61017c9190610338565b909b909a50929850909650945092505050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156101eb57600080fd5b505afa1580156101ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610223919061024d565b509195945050505050565b805169ffffffffffffffffffff8116811461024857600080fd5b919050565b600080600080600060a0868803121561026557600080fd5b61026e8661022e565b94506020860151935060408601519250606086015191506102916080870161022e565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b03818413828413808216868404861116156102d9576102d961029d565b600160ff1b60008712828116878305891216156102f8576102f861029d565b600087129250878205871284841616156103145761031461029d565b8785058712818416161561032a5761032a61029d565b505050929093029392505050565b60008261035557634e487b7160e01b600052601260045260246000fd5b600160ff1b82146000198414161561036f5761036f61029d565b50059056fea264697066735822122005690b7bd186e323e39d7c64920cc69b1c04df82e8d0a556322cd28053bfde6864736f6c634300080900330000000000000000000000004e844125952d32acdf339be976c98e22f6f318db

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063313ce5671461003b578063feaf968c14610071575b600080fd5b60405160ff7f00000000000000000000000000000000000000000000000000000000000000121681526020015b60405180910390f35b6100796100b0565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a001610068565b6000806000806000806000806000807f0000000000000000000000004e844125952d32acdf339be976c98e22f6f318db6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561011857600080fd5b505afa15801561012c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610150919061024d565b94509450945094509450846305f5e10061016861018f565b61017290876102b3565b61017c9190610338565b909b909a50929850909650945092505050565b6000807f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156101eb57600080fd5b505afa1580156101ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610223919061024d565b509195945050505050565b805169ffffffffffffffffffff8116811461024857600080fd5b919050565b600080600080600060a0868803121561026557600080fd5b61026e8661022e565b94506020860151935060408601519250606086015191506102916080870161022e565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b03818413828413808216868404861116156102d9576102d961029d565b600160ff1b60008712828116878305891216156102f8576102f861029d565b600087129250878205871284841616156103145761031461029d565b8785058712818416161561032a5761032a61029d565b505050929093029392505050565b60008261035557634e487b7160e01b600052601260045260246000fd5b600160ff1b82146000198414161561036f5761036f61029d565b50059056fea264697066735822122005690b7bd186e323e39d7c64920cc69b1c04df82e8d0a556322cd28053bfde6864736f6c63430008090033

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

0000000000000000000000004e844125952d32acdf339be976c98e22f6f318db

-----Decoded View---------------
Arg [0] : oracle_ (address): 0x4e844125952D32AcdF339BE976c98E22F6F318dB

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004e844125952d32acdf339be976c98e22f6f318db


Deployed Bytecode Sourcemap

1121:1312:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2180:94;;;186:4:1;2257:9:0;174:17:1;156:36;;144:2;129:18;2180:94:0;;;;;;;;1581:591;;;:::i;:::-;;;;466:22:1;515:15;;;497:34;;562:2;547:18;;540:34;;;;590:18;;583:34;;;;648:2;633:18;;626:34;697:15;;;691:3;676:19;;669:44;443:3;428:19;1581:591:0;203:516:1;1581:591:0;1690:14;1719:13;1747:17;1779;1811:22;1876:15;1906:14;1935:18;1968;2001:23;2038:7;-1:-1:-1;;;;;2038:23:0;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1861:202;;;;;;;;;;2082:8;2118:3;2103:11;:9;:11::i;:::-;2093:21;;:7;:21;:::i;:::-;2092:29;;;;:::i;:::-;2074:90;;;;-1:-1:-1;2123:10:0;;-1:-1:-1;2135:10:0;;-1:-1:-1;2123:10:0;-1:-1:-1;1581:591:0;-1:-1:-1;;;1581:591:0:o;2282:148::-;2325:6;2347:13;2370:10;-1:-1:-1;;;;;2370:26:0;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2344:54:0;;2282:148;-1:-1:-1;;;;;2282:148:0:o;724:179:1:-;802:13;;855:22;844:34;;834:45;;824:73;;893:1;890;883:12;824:73;724:179;;;:::o;908:473::-;1011:6;1019;1027;1035;1043;1096:3;1084:9;1075:7;1071:23;1067:33;1064:53;;;1113:1;1110;1103:12;1064:53;1136:39;1165:9;1136:39;:::i;:::-;1126:49;;1215:2;1204:9;1200:18;1194:25;1184:35;;1259:2;1248:9;1244:18;1238:25;1228:35;;1303:2;1292:9;1288:18;1282:25;1272:35;;1326:49;1370:3;1359:9;1355:19;1326:49;:::i;:::-;1316:59;;908:473;;;;;;;;:::o;1386:127::-;1447:10;1442:3;1438:20;1435:1;1428:31;1478:4;1475:1;1468:15;1502:4;1499:1;1492:15;1518:553;1557:7;-1:-1:-1;;;;;1627:9:1;;;1655;;;1680:11;;;1699:10;;;1693:17;;1676:35;1673:61;;;1714:18;;:::i;:::-;-1:-1:-1;;;1790:1:1;1783:9;;1808:11;;;1828;;;1821:19;;1804:37;1801:63;;;1844:18;;:::i;:::-;1890:1;1887;1883:9;1873:19;;1937:1;1933:2;1928:11;1925:1;1921:19;1916:2;1912;1908:11;1904:37;1901:63;;;1944:18;;:::i;:::-;2009:1;2005:2;2000:11;1997:1;1993:19;1988:2;1984;1980:11;1976:37;1973:63;;;2016:18;;:::i;:::-;-1:-1:-1;;;2056:9:1;;;;;1518:553;-1:-1:-1;;;1518:553:1:o;2076:290::-;2115:1;2141;2131:132;;2185:10;2180:3;2176:20;2173:1;2166:31;2220:4;2217:1;2210:15;2248:4;2245:1;2238:15;2131:132;-1:-1:-1;;;2279:18:1;;-1:-1:-1;;2299:13:1;;2275:38;2272:64;;;2316:18;;:::i;:::-;-1:-1:-1;2350:10:1;;2076:290::o

Swarm Source

ipfs://05690b7bd186e323e39d7c64920cc69b1c04df82e8d0a556322cd28053bfde68

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
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.