ETH Price: $2,672.56 (+1.28%)
Gas: 5 Gwei

Contract

0xD3608a527F4AfDf105716C838820aBfC707f5bc7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update Ether Pri...107585722020-08-29 23:07:001443 days ago1598742420IN
0xD3608a52...C707f5bc7
0 ETH0.0062583673
0x60806040107585572020-08-29 23:02:491443 days ago1598742169IN
 Create: EtherPrice
0 ETH0.0324449273

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EtherPrice

Compiler Version
v0.4.26+commit.4563c3fc

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2020-08-29
*/

pragma solidity >=0.4.23 <0.5.0;

library SafeMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }
    
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

interface IMakerPriceFeed {
  function read() external view returns (bytes32);
}

contract EtherPrice {
    
    uint[22] public levelPrice;
    uint public regAmount;
    uint public ethPrice;
    
    function updateEtherPrices() public{
        
        ethPrice=getETHUSDPrice();
        levelPrice[1] = SafeMath.div(uint(5 *  10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[2] = SafeMath.div(uint(10 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[3] = SafeMath.div(uint(20 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[4] = SafeMath.div(uint(30 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[5] = SafeMath.div(uint(40 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[6] = SafeMath.div(uint(50 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[7] = SafeMath.div(uint(75 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[8] = SafeMath.div(uint(100 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[9] = SafeMath.div(uint(125 * 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[10] = SafeMath.div(uint(150* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[11] = SafeMath.div(uint(200* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[12] = SafeMath.div(uint(250* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[13] = SafeMath.div(uint(300* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[14] = SafeMath.div(uint(400* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[15] = SafeMath.div(uint(500* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[16] = SafeMath.div(uint(750* 10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[17] = SafeMath.div(uint(1000*10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[18] = SafeMath.div(uint(1250*10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[19] = SafeMath.div(uint(1500*10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[20] = SafeMath.div(uint(2000*10000000000000000000000),ethPrice)/10000 ether;
        levelPrice[21] = SafeMath.div(uint(3000*10000000000000000000000),ethPrice)/10000 ether;
        regAmount=2*levelPrice[1];
    }
    
  function getETHUSDPrice() public view returns (uint) {
    address ethUsdPriceFeed = 0x729D19f657BD0614b4985Cf1D82531c67569197B;
    return uint(
      IMakerPriceFeed(ethUsdPriceFeed).read()
    );
  }
  
  
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[],"name":"updateEtherPrices","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"regAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"levelPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getETHUSDPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ethPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061071d806100206000396000f30060806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630156a55481146100715780635128e61814610088578063aad049b3146100af578063bf4b1990146100c7578063ff186b2e146100dc575b600080fd5b34801561007d57600080fd5b506100866100f1565b005b34801561009457600080fd5b5061009d610519565b60408051918252519081900360200190f35b3480156100bb57600080fd5b5061009d60043561051f565b3480156100d357600080fd5b5061009d610533565b3480156100e857600080fd5b5061009d6105e3565b6100f9610533565b60178190555069021e19e0c9bab2400000610120690a968163f0a57b4000006017546105e9565b81151561012957fe5b0460015560175469021e19e0c9bab2400000906101519069152d02c7e14af6800000906105e9565b81151561015a57fe5b0460025560175469021e19e0c9bab24000009061018290692a5a058fc295ed000000906105e9565b81151561018b57fe5b0460035560175469021e19e0c9bab2400000906101b390693f870857a3e0e3800000906105e9565b8115156101bc57fe5b0460045560175469021e19e0c9bab2400000906101e4906954b40b1f852bda000000906105e9565b8115156101ed57fe5b0460055560175469021e19e0c9bab240000090610215906969e10de76676d0800000906105e9565b81151561021e57fe5b0460065560175469021e19e0c9bab24000009061024690699ed194db19b238c00000906105e9565b81151561024f57fe5b0460075560175469021e19e0c9bab2400000906102779069d3c21bcecceda1000000906105e9565b81151561028057fe5b0460085560175469021e19e0c9bab2400000906102a9906a0108b2a2c2802909400000906105e9565b8115156102b257fe5b0460095560175469021e19e0c9bab2400000906102db906a013da329b6336471800000906105e9565b8115156102e457fe5b04600a5560175469021e19e0c9bab24000009061030d906a01a784379d99db42000000906105e9565b81151561031657fe5b04600b5560175469021e19e0c9bab24000009061033f906a0211654585005212800000906105e9565b81151561034857fe5b04600c5560175469021e19e0c9bab240000090610371906a027b46536c66c8e3000000906105e9565b81151561037a57fe5b04600d5560175469021e19e0c9bab2400000906103a3906a034f086f3b33b684000000906105e9565b8115156103ac57fe5b04600e5560175469021e19e0c9bab2400000906103d5906a0422ca8b0a00a425000000906105e9565b8115156103de57fe5b04600f5560175469021e19e0c9bab240000090610407906a06342fd08f00f637800000906105e9565b81151561041057fe5b0460105560175469021e19e0c9bab240000090610439906a084595161401484a000000906105e9565b81151561044257fe5b0460115560175469021e19e0c9bab24000009061046b906a0a56fa5b99019a5c800000906105e9565b81151561047457fe5b0460125560175469021e19e0c9bab24000009061049d906a0c685fa11e01ec6f000000906105e9565b8115156104a657fe5b0460135560175469021e19e0c9bab2400000906104cf906a108b2a2c28029094000000906105e9565b8115156104d857fe5b0460145560175469021e19e0c9bab240000090610501906a18d0bf423c03d8de000000906105e9565b81151561050a57fe5b04601555600154600202601655565b60165481565b6000816016811061052c57fe5b0154905081565b60008073729d19f657bd0614b4985cf1d82531c67569197b90508073ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b505050506040513d60208110156105db57600080fd5b505191505090565b60175481565b600061062b83836040805190810160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610632565b9392505050565b600080828185116106db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106a0578181015183820152602001610688565b50505050905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5083858115156106e757fe5b04959450505050505600a165627a7a72305820db599e5ae2e19dee5bc26f169ea5cc0d0b8b49775bdbf5e0cab8dceb41758c570029

Deployed Bytecode

0x60806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630156a55481146100715780635128e61814610088578063aad049b3146100af578063bf4b1990146100c7578063ff186b2e146100dc575b600080fd5b34801561007d57600080fd5b506100866100f1565b005b34801561009457600080fd5b5061009d610519565b60408051918252519081900360200190f35b3480156100bb57600080fd5b5061009d60043561051f565b3480156100d357600080fd5b5061009d610533565b3480156100e857600080fd5b5061009d6105e3565b6100f9610533565b60178190555069021e19e0c9bab2400000610120690a968163f0a57b4000006017546105e9565b81151561012957fe5b0460015560175469021e19e0c9bab2400000906101519069152d02c7e14af6800000906105e9565b81151561015a57fe5b0460025560175469021e19e0c9bab24000009061018290692a5a058fc295ed000000906105e9565b81151561018b57fe5b0460035560175469021e19e0c9bab2400000906101b390693f870857a3e0e3800000906105e9565b8115156101bc57fe5b0460045560175469021e19e0c9bab2400000906101e4906954b40b1f852bda000000906105e9565b8115156101ed57fe5b0460055560175469021e19e0c9bab240000090610215906969e10de76676d0800000906105e9565b81151561021e57fe5b0460065560175469021e19e0c9bab24000009061024690699ed194db19b238c00000906105e9565b81151561024f57fe5b0460075560175469021e19e0c9bab2400000906102779069d3c21bcecceda1000000906105e9565b81151561028057fe5b0460085560175469021e19e0c9bab2400000906102a9906a0108b2a2c2802909400000906105e9565b8115156102b257fe5b0460095560175469021e19e0c9bab2400000906102db906a013da329b6336471800000906105e9565b8115156102e457fe5b04600a5560175469021e19e0c9bab24000009061030d906a01a784379d99db42000000906105e9565b81151561031657fe5b04600b5560175469021e19e0c9bab24000009061033f906a0211654585005212800000906105e9565b81151561034857fe5b04600c5560175469021e19e0c9bab240000090610371906a027b46536c66c8e3000000906105e9565b81151561037a57fe5b04600d5560175469021e19e0c9bab2400000906103a3906a034f086f3b33b684000000906105e9565b8115156103ac57fe5b04600e5560175469021e19e0c9bab2400000906103d5906a0422ca8b0a00a425000000906105e9565b8115156103de57fe5b04600f5560175469021e19e0c9bab240000090610407906a06342fd08f00f637800000906105e9565b81151561041057fe5b0460105560175469021e19e0c9bab240000090610439906a084595161401484a000000906105e9565b81151561044257fe5b0460115560175469021e19e0c9bab24000009061046b906a0a56fa5b99019a5c800000906105e9565b81151561047457fe5b0460125560175469021e19e0c9bab24000009061049d906a0c685fa11e01ec6f000000906105e9565b8115156104a657fe5b0460135560175469021e19e0c9bab2400000906104cf906a108b2a2c28029094000000906105e9565b8115156104d857fe5b0460145560175469021e19e0c9bab240000090610501906a18d0bf423c03d8de000000906105e9565b81151561050a57fe5b04601555600154600202601655565b60165481565b6000816016811061052c57fe5b0154905081565b60008073729d19f657bd0614b4985cf1d82531c67569197b90508073ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b505050506040513d60208110156105db57600080fd5b505191505090565b60175481565b600061062b83836040805190810160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610632565b9392505050565b600080828185116106db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106a0578181015183820152602001610688565b50505050905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5083858115156106e757fe5b04959450505050505600a165627a7a72305820db599e5ae2e19dee5bc26f169ea5cc0d0b8b49775bdbf5e0cab8dceb41758c570029

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
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.