ETH Price: $3,199.26 (+2.07%)

Contract

0x252C07E0356d3B1a8cE273E39885b094053137b9

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Update Price281975492022-10-03 16:42:37649 days ago1664815357IN
Dopex: DPX Custom Price Oracle
0 ETH0.000036230.1
Update Price281941752022-10-03 16:13:37649 days ago1664813617IN
Dopex: DPX Custom Price Oracle
0 ETH0.000036130.1
Update Price281901932022-10-03 15:35:37649 days ago1664811337IN
Dopex: DPX Custom Price Oracle
0 ETH0.000034880.1
Update Price281888412022-10-03 15:24:36649 days ago1664810676IN
Dopex: DPX Custom Price Oracle
0 ETH0.000032120.1
Update Price281873252022-10-03 15:12:36649 days ago1664809956IN
Dopex: DPX Custom Price Oracle
0 ETH0.000032220.1
Update Price281842922022-10-03 14:50:36649 days ago1664808636IN
Dopex: DPX Custom Price Oracle
0 ETH0.000028060.1
Update Price281831042022-10-03 14:42:36649 days ago1664808156IN
Dopex: DPX Custom Price Oracle
0 ETH0.000025890.1
Update Price281817382022-10-03 14:34:37649 days ago1664807677IN
Dopex: DPX Custom Price Oracle
0 ETH0.000024130.1
Update Price281810842022-10-03 14:30:37649 days ago1664807437IN
Dopex: DPX Custom Price Oracle
0 ETH0.000024670.1
Update Price281805482022-10-03 14:27:36649 days ago1664807256IN
Dopex: DPX Custom Price Oracle
0 ETH0.000024050.1
Update Price281795462022-10-03 14:21:36649 days ago1664806896IN
Dopex: DPX Custom Price Oracle
0 ETH0.000024050.1
Update Price281786982022-10-03 14:15:36649 days ago1664806536IN
Dopex: DPX Custom Price Oracle
0 ETH0.000021880.1
Update Price281780962022-10-03 14:11:36649 days ago1664806296IN
Dopex: DPX Custom Price Oracle
0 ETH0.000019980.1
Update Price281774892022-10-03 14:07:37649 days ago1664806057IN
Dopex: DPX Custom Price Oracle
0 ETH0.000020550.1
Update Price281763922022-10-03 14:00:36649 days ago1664805636IN
Dopex: DPX Custom Price Oracle
0 ETH0.000018380.1
Update Price281714812022-10-03 13:32:36649 days ago1664803956IN
Dopex: DPX Custom Price Oracle
0 ETH0.000015460.1
Update Price281702852022-10-03 13:25:36649 days ago1664803536IN
Dopex: DPX Custom Price Oracle
0 ETH0.000014540.1
Update Price281692772022-10-03 13:19:36649 days ago1664803176IN
Dopex: DPX Custom Price Oracle
0 ETH0.000012160.1
Update Price281684852022-10-03 13:14:37649 days ago1664802877IN
Dopex: DPX Custom Price Oracle
0 ETH0.00001230.1
Update Price281676382022-10-03 13:09:36649 days ago1664802576IN
Dopex: DPX Custom Price Oracle
0 ETH0.00001220.1
Update Price281603162022-10-03 12:17:37649 days ago1664799457IN
Dopex: DPX Custom Price Oracle
0 ETH0.000010780.1
Update Price281299082022-10-03 8:16:36649 days ago1664784996IN
Dopex: DPX Custom Price Oracle
0 ETH0.000011340.1
Update Price281271682022-10-03 7:59:37649 days ago1664783977IN
Dopex: DPX Custom Price Oracle
0 ETH0.000011540.1
Update Price281156992022-10-03 6:44:37649 days ago1664779477IN
Dopex: DPX Custom Price Oracle
0 ETH0.000010490.1
Update Price281135092022-10-03 6:28:36649 days ago1664778516IN
Dopex: DPX Custom Price Oracle
0 ETH0.000010920.1
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
693399772023-03-13 5:05:04489 days ago1678683904
Dopex: DPX Custom Price Oracle
0 ETH
593638152023-02-09 9:38:25520 days ago1675935505
Dopex: DPX Custom Price Oracle
0 ETH
484709642022-12-24 10:21:50567 days ago1671877310
Dopex: DPX Custom Price Oracle
0 ETH
470428092022-12-18 7:11:54573 days ago1671347514
Dopex: DPX Custom Price Oracle
0 ETH
442120212022-12-06 23:47:39585 days ago1670370459
Dopex: DPX Custom Price Oracle
0 ETH
437551812022-12-05 8:44:46586 days ago1670229886
Dopex: DPX Custom Price Oracle
0 ETH
437528582022-12-05 8:32:18586 days ago1670229138
Dopex: DPX Custom Price Oracle
0 ETH
436329682022-12-04 19:48:50587 days ago1670183330
Dopex: DPX Custom Price Oracle
0 ETH
436264242022-12-04 19:18:37587 days ago1670181517
Dopex: DPX Custom Price Oracle
0 ETH
436198742022-12-04 18:48:23587 days ago1670179703
Dopex: DPX Custom Price Oracle
0 ETH
436133772022-12-04 18:18:11587 days ago1670177891
Dopex: DPX Custom Price Oracle
0 ETH
436067302022-12-04 17:48:02587 days ago1670176082
Dopex: DPX Custom Price Oracle
0 ETH
436000992022-12-04 17:17:50587 days ago1670174270
Dopex: DPX Custom Price Oracle
0 ETH
435934942022-12-04 16:47:43587 days ago1670172463
Dopex: DPX Custom Price Oracle
0 ETH
435865482022-12-04 16:17:27587 days ago1670170647
Dopex: DPX Custom Price Oracle
0 ETH
435794812022-12-04 15:47:14587 days ago1670168834
Dopex: DPX Custom Price Oracle
0 ETH
435724702022-12-04 15:17:06587 days ago1670167026
Dopex: DPX Custom Price Oracle
0 ETH
435654512022-12-04 14:47:01587 days ago1670165221
Dopex: DPX Custom Price Oracle
0 ETH
435583722022-12-04 14:16:46587 days ago1670163406
Dopex: DPX Custom Price Oracle
0 ETH
435512632022-12-04 13:46:36587 days ago1670161596
Dopex: DPX Custom Price Oracle
0 ETH
435440632022-12-04 13:16:23587 days ago1670159783
Dopex: DPX Custom Price Oracle
0 ETH
435370902022-12-04 12:46:19587 days ago1670157979
Dopex: DPX Custom Price Oracle
0 ETH
435302512022-12-04 12:16:03587 days ago1670156163
Dopex: DPX Custom Price Oracle
0 ETH
435233882022-12-04 11:46:00587 days ago1670154360
Dopex: DPX Custom Price Oracle
0 ETH
435164562022-12-04 11:15:47587 days ago1670152547
Dopex: DPX Custom Price Oracle
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DpxCustomPriceOracle

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
File 1 of 3 : DpxCustomPriceOracle.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

// Contracts
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';

contract DpxCustomPriceOracle is Ownable {
    /*==== PUBLIC VARS ====*/

    uint256 public lastPrice;

    /*==== SETTER FUNCTIONS (ONLY OWNER) ====*/

    /**
     * @notice Updates the last price of the token
     * @param price price
     * @return price of the token
     */
    function updatePrice(uint256 price) external onlyOwner returns (uint256) {
        require(price != 0, 'CustomPriceOracle: Token price cannot be 0');

        lastPrice = price;

        return price;
    }

    /*==== VIEWS ====*/

    /**
     * @notice Gets the price of the token
     * @return price
     */
    function getPriceInUSD() external view returns (uint256) {
        require(lastPrice != 0, 'CustomPriceOracle: Last price == 0');

        return lastPrice;
    }
}

File 2 of 3 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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);
    }
}

File 3 of 3 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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;
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"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":"getPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastPrice","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":"price","type":"uint256"}],"name":"updatePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6103af8061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063053f14da14610067578063715018a6146100835780638d6cc56d1461008d5780638da5cb5b146100a0578063e1aa6036146100bb578063f2fde38b146100c3575b600080fd5b61007060015481565b6040519081526020015b60405180910390f35b61008b6100d6565b005b61007061009b3660046102fb565b610115565b6000546040516001600160a01b03909116815260200161007a565b6100706101a9565b61008b6100d1366004610314565b610210565b6000546001600160a01b031633146101095760405162461bcd60e51b815260040161010090610344565b60405180910390fd5b61011360006102ab565b565b600080546001600160a01b031633146101405760405162461bcd60e51b815260040161010090610344565b816101a05760405162461bcd60e51b815260206004820152602a60248201527f437573746f6d50726963654f7261636c653a20546f6b656e20707269636520636044820152690616e6e6f7420626520360b41b6064820152608401610100565b50600181905590565b6000600154600014156102095760405162461bcd60e51b815260206004820152602260248201527f437573746f6d50726963654f7261636c653a204c617374207072696365203d3d604482015261020360f41b6064820152608401610100565b5060015490565b6000546001600160a01b0316331461023a5760405162461bcd60e51b815260040161010090610344565b6001600160a01b03811661029f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610100565b6102a8816102ab565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561030d57600080fd5b5035919050565b60006020828403121561032657600080fd5b81356001600160a01b038116811461033d57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220337ee1e6939380e00e4aaefbc7e13a5a3e7418cf9a7e4185f9032f96c05d950f64736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063053f14da14610067578063715018a6146100835780638d6cc56d1461008d5780638da5cb5b146100a0578063e1aa6036146100bb578063f2fde38b146100c3575b600080fd5b61007060015481565b6040519081526020015b60405180910390f35b61008b6100d6565b005b61007061009b3660046102fb565b610115565b6000546040516001600160a01b03909116815260200161007a565b6100706101a9565b61008b6100d1366004610314565b610210565b6000546001600160a01b031633146101095760405162461bcd60e51b815260040161010090610344565b60405180910390fd5b61011360006102ab565b565b600080546001600160a01b031633146101405760405162461bcd60e51b815260040161010090610344565b816101a05760405162461bcd60e51b815260206004820152602a60248201527f437573746f6d50726963654f7261636c653a20546f6b656e20707269636520636044820152690616e6e6f7420626520360b41b6064820152608401610100565b50600181905590565b6000600154600014156102095760405162461bcd60e51b815260206004820152602260248201527f437573746f6d50726963654f7261636c653a204c617374207072696365203d3d604482015261020360f41b6064820152608401610100565b5060015490565b6000546001600160a01b0316331461023a5760405162461bcd60e51b815260040161010090610344565b6001600160a01b03811661029f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610100565b6102a8816102ab565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561030d57600080fd5b5035919050565b60006020828403121561032657600080fd5b81356001600160a01b038116811461033d57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220337ee1e6939380e00e4aaefbc7e13a5a3e7418cf9a7e4185f9032f96c05d950f64736f6c63430008090033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.