Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 13071052 | 1154 days ago | IN | 0 ETH | 0.01781033 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
wOHMOracleV1
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 9000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIXED // File @boringcrypto/boring-solidity/contracts/libraries/[email protected] // License-Identifier: MIT pragma solidity 0.6.12; /// @notice A library for performing overflow-/underflow-safe math, /// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math). library BoringMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { require((c = a + b) >= b, "BoringMath: Add Overflow"); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require((c = a - b) <= a, "BoringMath: Underflow"); } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow"); } function to128(uint256 a) internal pure returns (uint128 c) { require(a <= uint128(-1), "BoringMath: uint128 Overflow"); c = uint128(a); } function to64(uint256 a) internal pure returns (uint64 c) { require(a <= uint64(-1), "BoringMath: uint64 Overflow"); c = uint64(a); } function to32(uint256 a) internal pure returns (uint32 c) { require(a <= uint32(-1), "BoringMath: uint32 Overflow"); c = uint32(a); } } /// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint128. library BoringMath128 { function add(uint128 a, uint128 b) internal pure returns (uint128 c) { require((c = a + b) >= b, "BoringMath: Add Overflow"); } function sub(uint128 a, uint128 b) internal pure returns (uint128 c) { require((c = a - b) <= a, "BoringMath: Underflow"); } } /// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint64. library BoringMath64 { function add(uint64 a, uint64 b) internal pure returns (uint64 c) { require((c = a + b) >= b, "BoringMath: Add Overflow"); } function sub(uint64 a, uint64 b) internal pure returns (uint64 c) { require((c = a - b) <= a, "BoringMath: Underflow"); } } /// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32. library BoringMath32 { function add(uint32 a, uint32 b) internal pure returns (uint32 c) { require((c = a + b) >= b, "BoringMath: Add Overflow"); } function sub(uint32 a, uint32 b) internal pure returns (uint32 c) { require((c = a - b) <= a, "BoringMath: Underflow"); } } // File contracts/interfaces/IOracle.sol // License-Identifier: MIT pragma solidity 0.6.12; interface IOracle { /// @notice Get the latest exchange rate. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return success if no valid (recent) rate is available, return false else true. /// @return rate The rate of the requested asset / pair / pool. function get(bytes calldata data) external returns (bool success, uint256 rate); /// @notice Check the last exchange rate without any state changes. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return success if no valid (recent) rate is available, return false else true. /// @return rate The rate of the requested asset / pair / pool. function peek(bytes calldata data) external view returns (bool success, uint256 rate); /// @notice Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek(). /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return rate The rate of the requested asset / pair / pool. function peekSpot(bytes calldata data) external view returns (uint256 rate); /// @notice Returns a human readable (short) name about this oracle. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return (string) A human readable symbol name about this oracle. function symbol(bytes calldata data) external view returns (string memory); /// @notice Returns a human readable name about this oracle. /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. /// For example: /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256)); /// @return (string) A human readable name about this oracle. function name(bytes calldata data) external view returns (string memory); } // File contracts/oracles/wOHMLinkOracle.sol // License-Identifier: MIT pragma solidity 0.6.12; // Chainlink Aggregator interface IAggregator { function latestAnswer() external view returns (int256 answer); } interface IWOHM { function sOHMTowOHM( uint256 _amount ) external view returns ( uint256 ); } contract wOHMOracleV1 is IOracle { using BoringMath for uint256; // Keep everything in uint256 IAggregator public constant ohmOracle = IAggregator(0x90c2098473852E2F07678Fe1B6d595b1bd9b16Ed); IAggregator public constant ethUSDOracle = IAggregator(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419); IWOHM public constant WOHM = IWOHM(0xCa76543Cf381ebBB277bE79574059e32108e3E65); // Calculates the lastest exchange rate // Uses both divide and multiply only for tokens not supported directly by Chainlink, for example MKR/USD function _get() internal view returns (uint256) { return 1e44 / (uint256(1e18).mul(uint256(ohmOracle.latestAnswer()).mul(uint256(ethUSDOracle.latestAnswer()))) / WOHM.sOHMTowOHM(1e9)); } // Get the latest exchange rate /// @inheritdoc IOracle function get(bytes calldata) public override returns (bool, uint256) { return (true, _get()); } // Check the last exchange rate without any state changes /// @inheritdoc IOracle function peek(bytes calldata ) public view override returns (bool, uint256) { return (true, _get()); } // Check the current spot exchange rate without any state changes /// @inheritdoc IOracle function peekSpot(bytes calldata data) external view override returns (uint256 rate) { (, rate) = peek(data); } /// @inheritdoc IOracle function name(bytes calldata) public view override returns (string memory) { return "wOHM Chainlink"; } /// @inheritdoc IOracle function symbol(bytes calldata) public view override returns (string memory) { return "LINK/wOHM"; } }
{ "optimizer": { "enabled": true, "runs": 9000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"WOHM","outputs":[{"internalType":"contract IWOHM","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethUSDOracle","outputs":[{"internalType":"contract IAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"get","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ohmOracle","outputs":[{"internalType":"contract IAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"peek","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"peekSpot","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506106d1806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063d39bbef01161005b578063d39bbef0146101b3578063d568866c14610235578063d6d7d525146102a5578063eeb8a8d3146102a557610088565b8063393a9a521461008d5780636791d66a146100be578063706eb3ab146100c6578063c699c4d6146100ce575b600080fd5b610095610330565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610095610348565b610095610360565b61013e600480360360208110156100e457600080fd5b8101906020810181356401000000008111156100ff57600080fd5b82018360208201111561011157600080fd5b8035906020019184600183028401116401000000008311171561013357600080fd5b509092509050610378565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610223600480360360208110156101c957600080fd5b8101906020810181356401000000008111156101e457600080fd5b8201836020820111156101f657600080fd5b8035906020019184600183028401116401000000008311171561021857600080fd5b5090925090506103b3565b60408051918252519081900360200190f35b61013e6004803603602081101561024b57600080fd5b81019060208101813564010000000081111561026657600080fd5b82018360208201111561027857600080fd5b8035906020019184600183028401116401000000008311171561029a57600080fd5b5090925090506103c7565b610315600480360360208110156102bb57600080fd5b8101906020810181356401000000008111156102d657600080fd5b8201836020820111156102e857600080fd5b8035906020019184600183028401116401000000008311171561030a57600080fd5b509092509050610400565b60408051921515835260208301919091528051918290030190f35b73ca76543cf381ebbb277be79574059e32108e3e6581565b7390c2098473852e2f07678fe1b6d595b1bd9b16ed81565b735f4ec3df9cbd43714fe2740f5e3616155c5b841981565b60408051808201909152600981527f4c494e4b2f774f484d000000000000000000000000000000000000000000000060208201525b92915050565b60006103bf8383610400565b949350505050565b505060408051808201909152600e81527f774f484d20436861696e6c696e6b000000000000000000000000000000000000602082015290565b600080600161040d610418565b915091509250929050565b600073ca76543cf381ebbb277be79574059e32108e3e6573ffffffffffffffffffffffffffffffffffffffff166373f79c04633b9aca006040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561048357600080fd5b505afa158015610497573d6000803e3d6000fd5b505050506040513d60208110156104ad57600080fd5b5051604080517f50d25bcd00000000000000000000000000000000000000000000000000000000815290516105ec916105dd91735f4ec3df9cbd43714fe2740f5e3616155c5b8419916350d25bcd916004808301926020929190829003018186803b15801561051b57600080fd5b505afa15801561052f573d6000803e3d6000fd5b505050506040513d602081101561054557600080fd5b5051604080517f50d25bcd00000000000000000000000000000000000000000000000000000000815290517390c2098473852e2f07678fe1b6d595b1bd9b16ed916350d25bcd916004808301926020929190829003018186803b1580156105ab57600080fd5b505afa1580156105bf573d6000803e3d6000fd5b505050506040513d60208110156105d557600080fd5b505190610615565b670de0b6b3a764000090610615565b816105f357fe5b0472047bf19673df52e37f2410011d1000000000008161060f57fe5b04905090565b60008115806106305750508082028282828161062d57fe5b04145b6103ad57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604482015290519081900360640190fdfea264697066735822122051583341198819dfad649316418b8610356add1f31dd102b84584a62c9eec75f64736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063d39bbef01161005b578063d39bbef0146101b3578063d568866c14610235578063d6d7d525146102a5578063eeb8a8d3146102a557610088565b8063393a9a521461008d5780636791d66a146100be578063706eb3ab146100c6578063c699c4d6146100ce575b600080fd5b610095610330565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610095610348565b610095610360565b61013e600480360360208110156100e457600080fd5b8101906020810181356401000000008111156100ff57600080fd5b82018360208201111561011157600080fd5b8035906020019184600183028401116401000000008311171561013357600080fd5b509092509050610378565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610223600480360360208110156101c957600080fd5b8101906020810181356401000000008111156101e457600080fd5b8201836020820111156101f657600080fd5b8035906020019184600183028401116401000000008311171561021857600080fd5b5090925090506103b3565b60408051918252519081900360200190f35b61013e6004803603602081101561024b57600080fd5b81019060208101813564010000000081111561026657600080fd5b82018360208201111561027857600080fd5b8035906020019184600183028401116401000000008311171561029a57600080fd5b5090925090506103c7565b610315600480360360208110156102bb57600080fd5b8101906020810181356401000000008111156102d657600080fd5b8201836020820111156102e857600080fd5b8035906020019184600183028401116401000000008311171561030a57600080fd5b509092509050610400565b60408051921515835260208301919091528051918290030190f35b73ca76543cf381ebbb277be79574059e32108e3e6581565b7390c2098473852e2f07678fe1b6d595b1bd9b16ed81565b735f4ec3df9cbd43714fe2740f5e3616155c5b841981565b60408051808201909152600981527f4c494e4b2f774f484d000000000000000000000000000000000000000000000060208201525b92915050565b60006103bf8383610400565b949350505050565b505060408051808201909152600e81527f774f484d20436861696e6c696e6b000000000000000000000000000000000000602082015290565b600080600161040d610418565b915091509250929050565b600073ca76543cf381ebbb277be79574059e32108e3e6573ffffffffffffffffffffffffffffffffffffffff166373f79c04633b9aca006040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561048357600080fd5b505afa158015610497573d6000803e3d6000fd5b505050506040513d60208110156104ad57600080fd5b5051604080517f50d25bcd00000000000000000000000000000000000000000000000000000000815290516105ec916105dd91735f4ec3df9cbd43714fe2740f5e3616155c5b8419916350d25bcd916004808301926020929190829003018186803b15801561051b57600080fd5b505afa15801561052f573d6000803e3d6000fd5b505050506040513d602081101561054557600080fd5b5051604080517f50d25bcd00000000000000000000000000000000000000000000000000000000815290517390c2098473852e2f07678fe1b6d595b1bd9b16ed916350d25bcd916004808301926020929190829003018186803b1580156105ab57600080fd5b505afa1580156105bf573d6000803e3d6000fd5b505050506040513d60208110156105d557600080fd5b505190610615565b670de0b6b3a764000090610615565b816105f357fe5b0472047bf19673df52e37f2410011d1000000000008161060f57fe5b04905090565b60008115806106305750508082028282828161062d57fe5b04145b6103ad57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604482015290519081900360640190fdfea264697066735822122051583341198819dfad649316418b8610356add1f31dd102b84584a62c9eec75f64736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
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.