Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
PusdVolatilityOracle
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/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. */ abstract 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() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual 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 { _transferOwnership(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"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 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) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface IVolatilityOracle { function getVolatility(uint256) external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; // Contracts import { VolatilityOracle } from "./VolatilityOracle.sol"; contract PusdVolatilityOracle is VolatilityOracle {}
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; // Contracts import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; // Interfaces import { IVolatilityOracle } from "./IVolatilityOracle.sol"; contract VolatilityOracle is Ownable, IVolatilityOracle { /*==== PUBLIC VARS ====*/ uint256 public lastVolatility; uint256 public lastUpdatedTimestamp; /*==== EVENTS ====*/ event VolatilityUpdated(uint256 vols); /*==== SETTER FUNCTIONS (ONLY OWNER) ====*/ /** * @notice Updates the last volatility * @param v volatility * @return volatility */ function updateVolatility(uint256 v) external onlyOwner returns (uint256) { require(v != 0, "Volatility cannot be 0"); lastVolatility = v; lastUpdatedTimestamp = block.timestamp; emit VolatilityUpdated(v); return v; } /*==== VIEWS ====*/ /** * @notice Gets the volatility * @return volatility */ function getVolatility(uint256) external view override returns (uint256) { require(lastVolatility != 0, "Last volatility == 0"); return lastVolatility; } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vols","type":"uint256"}],"name":"VolatilityUpdated","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getVolatility","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastVolatility","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"v","type":"uint256"}],"name":"updateVolatility","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6103e88061007e6000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100bb578063c189c19b146100d6578063f2fde38b146100e9578063fbaf894c146100fc57600080fd5b80632834a7c814610082578063715018a6146100a85780638843be74146100b2575b600080fd5b610095610090366004610334565b610105565b6040519081526020015b60405180910390f35b6100b06101bf565b005b61009560015481565b6000546040516001600160a01b03909116815260200161009f565b6100956100e4366004610334565b6101f5565b6100b06100f736600461034d565b610249565b61009560025481565b600080546001600160a01b031633146101395760405162461bcd60e51b81526004016101309061037d565b60405180910390fd5b8161017f5760405162461bcd60e51b81526020600482015260166024820152750566f6c6174696c6974792063616e6e6f7420626520360541b6044820152606401610130565b6001829055426002556040518281527f1276a26a4529e590f6273e7d6e346c19a05777b11bd46ccd46e43832b0a297569060200160405180910390a15090565b6000546001600160a01b031633146101e95760405162461bcd60e51b81526004016101309061037d565b6101f360006102e4565b565b6000600154600014156102415760405162461bcd60e51b815260206004820152601460248201527304c61737420766f6c6174696c697479203d3d20360641b6044820152606401610130565b505060015490565b6000546001600160a01b031633146102735760405162461bcd60e51b81526004016101309061037d565b6001600160a01b0381166102d85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610130565b6102e1816102e4565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561034657600080fd5b5035919050565b60006020828403121561035f57600080fd5b81356001600160a01b038116811461037657600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea26469706673582212208e4f7b1a29a7e833a1dafb26dee1c94057cc0bcea016a9d86daf4b25f17fea6564736f6c63430008090033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100bb578063c189c19b146100d6578063f2fde38b146100e9578063fbaf894c146100fc57600080fd5b80632834a7c814610082578063715018a6146100a85780638843be74146100b2575b600080fd5b610095610090366004610334565b610105565b6040519081526020015b60405180910390f35b6100b06101bf565b005b61009560015481565b6000546040516001600160a01b03909116815260200161009f565b6100956100e4366004610334565b6101f5565b6100b06100f736600461034d565b610249565b61009560025481565b600080546001600160a01b031633146101395760405162461bcd60e51b81526004016101309061037d565b60405180910390fd5b8161017f5760405162461bcd60e51b81526020600482015260166024820152750566f6c6174696c6974792063616e6e6f7420626520360541b6044820152606401610130565b6001829055426002556040518281527f1276a26a4529e590f6273e7d6e346c19a05777b11bd46ccd46e43832b0a297569060200160405180910390a15090565b6000546001600160a01b031633146101e95760405162461bcd60e51b81526004016101309061037d565b6101f360006102e4565b565b6000600154600014156102415760405162461bcd60e51b815260206004820152601460248201527304c61737420766f6c6174696c697479203d3d20360641b6044820152606401610130565b505060015490565b6000546001600160a01b031633146102735760405162461bcd60e51b81526004016101309061037d565b6001600160a01b0381166102d85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610130565b6102e1816102e4565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561034657600080fd5b5035919050565b60006020828403121561035f57600080fd5b81356001600160a01b038116811461037657600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea26469706673582212208e4f7b1a29a7e833a1dafb26dee1c94057cc0bcea016a9d86daf4b25f17fea6564736f6c63430008090033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.