Contract
0x83a5b587ae36f342d405a7e5971941168e0adb5d
9
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
GmxVolatilityOracle
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity)
/** *Submitted for verification at Arbiscan.io on 2022-01-16 */ 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; } } /** * @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); } } // File contracts/interfaces/IVolatilityOracle.sol interface IVolatilityOracle { function getVolatility() external view returns (uint256); } contract GmxVolatilityOracle is Ownable, IVolatilityOracle { /*==== PUBLIC VARS ====*/ uint256 public lastVolatility; /*==== SETTER FUNCTIONS (ONLY OWNER) ====*/ /** * @notice Updates the last volatility for GMX * @param v volatility * @return volatility of GMX */ function updateVolatility(uint256 v) external onlyOwner returns (uint256) { require(v != 0, 'VolatilityOracle: Volatility cannot be 0'); lastVolatility = v; return v; } /*==== VIEWS ====*/ /** * @notice Gets the volatility of GMX * @return volatility */ function getVolatility() external view override returns (uint256) { require(lastVolatility != 0, 'VolatilityOracle: Last volatility == 0'); return lastVolatility; } }
[{"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":"getVolatility","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
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6103b18061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80632834a7c8146100675780633af2888b1461008d578063715018a6146100955780638843be741461009f5780638da5cb5b146100a8578063f2fde38b146100c3575b600080fd5b61007a6100753660046102fd565b6100d6565b6040519081526020015b60405180910390f35b61007a610171565b61009d6101dc565b005b61007a60015481565b6000546040516001600160a01b039091168152602001610084565b61009d6100d1366004610316565b610212565b600080546001600160a01b0316331461010a5760405162461bcd60e51b815260040161010190610346565b60405180910390fd5b816101685760405162461bcd60e51b815260206004820152602860248201527f566f6c6174696c6974794f7261636c653a20566f6c6174696c6974792063616e60448201526706e6f7420626520360c41b6064820152608401610101565b50600181905590565b6000600154600014156101d55760405162461bcd60e51b815260206004820152602660248201527f566f6c6174696c6974794f7261636c653a204c61737420766f6c6174696c6974604482015265079203d3d20360d41b6064820152608401610101565b5060015490565b6000546001600160a01b031633146102065760405162461bcd60e51b815260040161010190610346565b61021060006102ad565b565b6000546001600160a01b0316331461023c5760405162461bcd60e51b815260040161010190610346565b6001600160a01b0381166102a15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610101565b6102aa816102ad565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561030f57600080fd5b5035919050565b60006020828403121561032857600080fd5b81356001600160a01b038116811461033f57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea26469706673582212204f9885304ab8548ebde234ca7f35b66f79036f52b1f83dddd993f60bfd3d8d4a64736f6c63430008090033
Deployed ByteCode Sourcemap
3383:839:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3703:204;;;;;;:::i;:::-;;:::i;:::-;;;345:25:1;;;333:2;318:18;3703:204:0;;;;;;;;4030:189;;;:::i;2376:103::-;;;:::i;:::-;;3482:29;;;;;;1725:87;1771:7;1798:6;1725:87;;-1:-1:-1;;;;;1798:6:0;;;527:51:1;;515:2;500:18;1725:87:0;381:203:1;2634:238:0;;;;;;:::i;:::-;;:::i;3703:204::-;3768:7;1798:6;;-1:-1:-1;;;;;1798:6:0;647:10;1945:23;1937:68;;;;-1:-1:-1;;;1937:68:0;;;;;;;:::i;:::-;;;;;;;;;3796:6;3788:59:::1;;;::::0;-1:-1:-1;;;3788:59:0;;1443:2:1;3788:59:0::1;::::0;::::1;1425:21:1::0;1482:2;1462:18;;;1455:30;1521:34;1501:18;;;1494:62;-1:-1:-1;;;1572:18:1;;;1565:38;1620:19;;3788:59:0::1;1241:404:1::0;3788:59:0::1;-1:-1:-1::0;3860:14:0::1;:18:::0;;;;3703:204::o;4030:189::-;4087:7;4115:14;;4133:1;4115:19;;4107:70;;;;-1:-1:-1;;;4107:70:0;;1852:2:1;4107:70:0;;;1834:21:1;1891:2;1871:18;;;1864:30;1930:34;1910:18;;;1903:62;-1:-1:-1;;;1981:18:1;;;1974:36;2027:19;;4107:70:0;1650:402:1;4107:70:0;-1:-1:-1;4197:14:0;;;4030:189::o;2376:103::-;1771:7;1798:6;-1:-1:-1;;;;;1798:6:0;647:10;1945:23;1937:68;;;;-1:-1:-1;;;1937:68:0;;;;;;;:::i;:::-;2441:30:::1;2468:1;2441:18;:30::i;:::-;2376:103::o:0;2634:238::-;1771:7;1798:6;-1:-1:-1;;;;;1798:6:0;647:10;1945:23;1937:68;;;;-1:-1:-1;;;1937:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;2737:22:0;::::1;2715:110;;;::::0;-1:-1:-1;;;2715:110:0;;2259:2:1;2715:110:0::1;::::0;::::1;2241:21:1::0;2298:2;2278:18;;;2271:30;2337:34;2317:18;;;2310:62;-1:-1:-1;;;2388:18:1;;;2381:36;2434:19;;2715:110:0::1;2057:402:1::0;2715:110:0::1;2836:28;2855:8;2836:18;:28::i;:::-;2634:238:::0;:::o;3032:191::-;3106:16;3125:6;;-1:-1:-1;;;;;3142:17:0;;;-1:-1:-1;;;;;;3142:17:0;;;;;;3175:40;;3125:6;;;;;;;3175:40;;3106:16;3175:40;3095:128;3032:191;:::o;14:180:1:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:1;;14:180;-1:-1:-1;14:180:1:o;589:286::-;648:6;701:2;689:9;680:7;676:23;672:32;669:52;;;717:1;714;707:12;669:52;743:23;;-1:-1:-1;;;;;795:31:1;;785:42;;775:70;;841:1;838;831:12;775:70;864:5;589:286;-1:-1:-1;;;589:286:1:o;880:356::-;1082:2;1064:21;;;1101:18;;;1094:30;1160:34;1155:2;1140:18;;1133:62;1227:2;1212:18;;880:356::o
Metadata Hash
4f9885304ab8548ebde234ca7f35b66f79036f52b1f83dddd993f60bfd3d8d4a
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.