Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
OracleWrapper
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../interfaces/IChainlinkAggregator.sol"; contract OracleWrapper { uint8 private constant DECIMALS = 8; IChainlinkAggregator public immutable ethOracle; IChainlinkAggregator public immutable underlyingOracle; constructor(address _ethOracle, address _underlyingOracle) public { ethOracle = IChainlinkAggregator(_ethOracle); underlyingOracle = IChainlinkAggregator(_underlyingOracle); } function latestAnswer() external view returns (int256) { int256 ethPricInUSD = ethOracle.latestAnswer(); int256 underlyingPriceInETH = underlyingOracle.latestAnswer(); return underlyingPriceInETH * ethPricInUSD / 10 ** 8; } function latestTimestamp() external view returns (uint256) { return underlyingOracle.latestTimestamp(); } function decimals() external view returns (uint8) { return DECIMALS; } }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; interface IChainlinkAggregator { function decimals() external view returns (uint8); function latestAnswer() external view returns (int256); function latestTimestamp() external view returns (uint256); function latestRound() external view returns (uint256); function getAnswer(uint256 roundId) external view returns (int256); function getTimestamp(uint256 roundId) external view returns (uint256); event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp); event NewRound(uint256 indexed roundId, address indexed startedBy); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_ethOracle","type":"address"},{"internalType":"address","name":"_underlyingOracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethOracle","outputs":[{"internalType":"contract IChainlinkAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"underlyingOracle","outputs":[{"internalType":"contract IChainlinkAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b5060405161038d38038061038d8339818101604052604081101561003357600080fd5b5080516020909101516001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c61030261008b6000398060ca5280610199528061022052508060f652806102aa52506103026000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806312c46e611461005c578063313ce5671461008057806350d25bcd1461009e5780638205bf6a146100b85780639c8762e1146100c0575b600080fd5b6100646100c8565b604080516001600160a01b039092168252519081900360200190f35b6100886100ec565b6040805160ff9092168252519081900360200190f35b6100a66100f1565b60408051918252519081900360200190f35b6100a661021c565b6100646102a8565b7f000000000000000000000000000000000000000000000000000000000000000081565b600890565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561014d57600080fd5b505afa158015610161573d6000803e3d6000fd5b505050506040513d602081101561017757600080fd5b5051604080516350d25bcd60e01b815290519192506000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916350d25bcd916004808301926020929190829003018186803b1580156101df57600080fd5b505afa1580156101f3573d6000803e3d6000fd5b505050506040513d602081101561020957600080fd5b50516305f5e10092029190910592915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561027757600080fd5b505afa15801561028b573d6000803e3d6000fd5b505050506040513d60208110156102a157600080fd5b5051905090565b7f00000000000000000000000000000000000000000000000000000000000000008156fea2646970667358221220b71deadfbf1f6998532d34674d559253465d59c69ca9714791d43aabf25edf9864736f6c634300060c00330000000000000000000000009f86dd49e81a11f49d07edc9033f701f3d80f74200000000000000000000000065d0f14f7809cdc4f90c3978c753c4671b6b815b
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806312c46e611461005c578063313ce5671461008057806350d25bcd1461009e5780638205bf6a146100b85780639c8762e1146100c0575b600080fd5b6100646100c8565b604080516001600160a01b039092168252519081900360200190f35b6100886100ec565b6040805160ff9092168252519081900360200190f35b6100a66100f1565b60408051918252519081900360200190f35b6100a661021c565b6100646102a8565b7f00000000000000000000000065d0f14f7809cdc4f90c3978c753c4671b6b815b81565b600890565b6000807f0000000000000000000000009f86dd49e81a11f49d07edc9033f701f3d80f7426001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561014d57600080fd5b505afa158015610161573d6000803e3d6000fd5b505050506040513d602081101561017757600080fd5b5051604080516350d25bcd60e01b815290519192506000916001600160a01b037f00000000000000000000000065d0f14f7809cdc4f90c3978c753c4671b6b815b16916350d25bcd916004808301926020929190829003018186803b1580156101df57600080fd5b505afa1580156101f3573d6000803e3d6000fd5b505050506040513d602081101561020957600080fd5b50516305f5e10092029190910592915050565b60007f00000000000000000000000065d0f14f7809cdc4f90c3978c753c4671b6b815b6001600160a01b0316638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561027757600080fd5b505afa15801561028b573d6000803e3d6000fd5b505050506040513d60208110156102a157600080fd5b5051905090565b7f0000000000000000000000009f86dd49e81a11f49d07edc9033f701f3d80f7428156fea2646970667358221220b71deadfbf1f6998532d34674d559253465d59c69ca9714791d43aabf25edf9864736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009f86dd49e81a11f49d07edc9033f701f3d80f74200000000000000000000000065d0f14f7809cdc4f90c3978c753c4671b6b815b
-----Decoded View---------------
Arg [0] : _ethOracle (address): 0x9F86Dd49E81A11F49D07edC9033F701F3d80F742
Arg [1] : _underlyingOracle (address): 0x65d0F14f7809CdC4f90c3978c753C4671b6B815b
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000009f86dd49e81a11f49d07edc9033f701f3d80f742
Arg [1] : 00000000000000000000000065d0f14f7809cdc4f90c3978c753c4671b6b815b
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.