Source Code
Overview
ETH Balance
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Discount Mul... | 8731541 | 517 days ago | IN | 0 ETH | 0.00000137 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
oLOREOracle
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 {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
interface IProxy {
function getPrice() external view returns (uint256 value);
}
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);
}
contract oLOREOracle is Ownable {
int256 public constant MULT_DIVISOR = 10_000;
address public immutable proxy;
address public immutable ethPricefeed;
int256 public discountMultiplier;
constructor(address _proxy, address _ethPricefeed) public {
proxy = _proxy;
ethPricefeed = _ethPricefeed;
discountMultiplier = 500;
}
function latestAnswer() external view returns (int256 value) {
int256 lorePriceInEth = int256(IProxy(proxy).getPrice());
int256 ethPrice = IChainlinkAggregator(ethPricefeed).latestAnswer();
value = (((lorePriceInEth * ethPrice) / 1e18) * discountMultiplier) / MULT_DIVISOR;
}
function latestTimestamp() external view returns (uint256 timestamp) {
timestamp = block.timestamp;
}
function decimals() external view returns (uint8) {
return 8;
}
function getTokenType() external pure returns (uint256) {
return 1;
}
function setDiscountMultiplier(int256 _discountMultiplier) external onlyOwner {
discountMultiplier = _discountMultiplier;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import './Context.sol';
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}{
"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
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_proxy","type":"address"},{"internalType":"address","name":"_ethPricefeed","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MULT_DIVISOR","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discountMultiplier","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethPricefeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"value","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"_discountMultiplier","type":"int256"}],"name":"setDiscountMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60c060405234801561001057600080fd5b506040516106b53803806106b58339818101604052604081101561003357600080fd5b50805160209091015160006100466100b4565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160601b0319606092831b8116608052911b1660a0526101f46001556100b8565b3390565b60805160601c60a05160601c6105ca6100eb6000398061019452806102d252508061022f528061043952506105ca6000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80638da5cb5b116100715780638da5cb5b14610144578063b1d7ee211461014c578063c273e0c114610154578063ec5568891461015c578063f2fde38b14610164578063fcab18191461018a576100b4565b80630d6b4a96146100b95780632d6e8cc3146100dd578063313ce567146100fc57806350d25bcd1461011a578063715018a6146101345780638205bf6a1461013c575b600080fd5b6100c1610192565b604080516001600160a01b039092168252519081900360200190f35b6100fa600480360360208110156100f357600080fd5b50356101b6565b005b610104610225565b6040805160ff9092168252519081900360200190f35b61012261022a565b60408051918252519081900360200190f35b6100fa610364565b610122610418565b6100c161041c565b61012261042b565b610122610431565b6100c1610437565b6100fa6004803603602081101561017a57600080fd5b50356001600160a01b031661045b565b610122610565565b7f000000000000000000000000000000000000000000000000000000000000000081565b6101be61056a565b6000546001600160a01b03908116911614610220576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600155565b600890565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166398d5fdca6040518163ffffffff1660e01b815260040160206040518083038186803b15801561028657600080fd5b505afa15801561029a573d6000803e3d6000fd5b505050506040513d60208110156102b057600080fd5b5051604080516350d25bcd60e01b815290519192506000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916350d25bcd916004808301926020929190829003018186803b15801561031857600080fd5b505afa15801561032c573d6000803e3d6000fd5b505050506040513d602081101561034257600080fd5b505160015490915061271090670de0b6b3a76400008484020502059250505090565b61036c61056a565b6000546001600160a01b039081169116146103ce576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b4290565b6000546001600160a01b031690565b60015481565b61271081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61046361056a565b6000546001600160a01b039081169116146104c5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661050a5760405162461bcd60e51b815260040180806020018281038252602681526020018061056f6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600190565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212205fc93ac3236c52b2e415039fc5d347daaab24f4596ff8cf42692e81a95200b4264736f6c634300060c0033000000000000000000000000eb3df52e0254e22434f044c3b62291919501ee7d0000000000000000000000006bf14cb0a831078629d993fdebcb182b21a8774c
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80638da5cb5b116100715780638da5cb5b14610144578063b1d7ee211461014c578063c273e0c114610154578063ec5568891461015c578063f2fde38b14610164578063fcab18191461018a576100b4565b80630d6b4a96146100b95780632d6e8cc3146100dd578063313ce567146100fc57806350d25bcd1461011a578063715018a6146101345780638205bf6a1461013c575b600080fd5b6100c1610192565b604080516001600160a01b039092168252519081900360200190f35b6100fa600480360360208110156100f357600080fd5b50356101b6565b005b610104610225565b6040805160ff9092168252519081900360200190f35b61012261022a565b60408051918252519081900360200190f35b6100fa610364565b610122610418565b6100c161041c565b61012261042b565b610122610431565b6100c1610437565b6100fa6004803603602081101561017a57600080fd5b50356001600160a01b031661045b565b610122610565565b7f0000000000000000000000006bf14cb0a831078629d993fdebcb182b21a8774c81565b6101be61056a565b6000546001600160a01b03908116911614610220576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600155565b600890565b6000807f000000000000000000000000eb3df52e0254e22434f044c3b62291919501ee7d6001600160a01b03166398d5fdca6040518163ffffffff1660e01b815260040160206040518083038186803b15801561028657600080fd5b505afa15801561029a573d6000803e3d6000fd5b505050506040513d60208110156102b057600080fd5b5051604080516350d25bcd60e01b815290519192506000916001600160a01b037f0000000000000000000000006bf14cb0a831078629d993fdebcb182b21a8774c16916350d25bcd916004808301926020929190829003018186803b15801561031857600080fd5b505afa15801561032c573d6000803e3d6000fd5b505050506040513d602081101561034257600080fd5b505160015490915061271090670de0b6b3a76400008484020502059250505090565b61036c61056a565b6000546001600160a01b039081169116146103ce576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b4290565b6000546001600160a01b031690565b60015481565b61271081565b7f000000000000000000000000eb3df52e0254e22434f044c3b62291919501ee7d81565b61046361056a565b6000546001600160a01b039081169116146104c5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661050a5760405162461bcd60e51b815260040180806020018281038252602681526020018061056f6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600190565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212205fc93ac3236c52b2e415039fc5d347daaab24f4596ff8cf42692e81a95200b4264736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000eb3df52e0254e22434f044c3b62291919501ee7d0000000000000000000000006bf14cb0a831078629d993fdebcb182b21a8774c
-----Decoded View---------------
Arg [0] : _proxy (address): 0xeb3DF52E0254e22434f044C3b62291919501Ee7D
Arg [1] : _ethPricefeed (address): 0x6bF14CB0A831078629D993FDeBcB182b21A8774C
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000eb3df52e0254e22434f044c3b62291919501ee7d
Arg [1] : 0000000000000000000000006bf14cb0a831078629d993fdebcb182b21a8774c
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.