Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,277 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Update Rate | 7771395 | 2053 days ago | IN | 0 ETH | 0.00059547 | ||||
Update Rate | 7771031 | 2054 days ago | IN | 0 ETH | 0.00037206 | ||||
Update Rate | 7770916 | 2054 days ago | IN | 0 ETH | 0.00066618 | ||||
Update Rate | 7770739 | 2054 days ago | IN | 0 ETH | 0.00066598 | ||||
Update Rate | 7770717 | 2054 days ago | IN | 0 ETH | 0.00066618 | ||||
Update Rate | 7770676 | 2054 days ago | IN | 0 ETH | 0.00066598 | ||||
Update Rate | 7770657 | 2054 days ago | IN | 0 ETH | 0.0004466 | ||||
Update Rate | 7770138 | 2054 days ago | IN | 0 ETH | 0.00070712 | ||||
Update Rate | 7769970 | 2054 days ago | IN | 0 ETH | 0.00067369 | ||||
Update Rate | 7769856 | 2054 days ago | IN | 0 ETH | 0.0006697 | ||||
Update Rate | 7769791 | 2054 days ago | IN | 0 ETH | 0.00037217 | ||||
Update Rate | 7769753 | 2054 days ago | IN | 0 ETH | 0.00052088 | ||||
Update Rate | 7769407 | 2054 days ago | IN | 0 ETH | 0.00059529 | ||||
Update Rate | 7769280 | 2054 days ago | IN | 0 ETH | 0.00055809 | ||||
Update Rate | 7769228 | 2054 days ago | IN | 0 ETH | 0.00055809 | ||||
Update Rate | 7769147 | 2054 days ago | IN | 0 ETH | 0.00055825 | ||||
Update Rate | 7768948 | 2054 days ago | IN | 0 ETH | 0.00048009 | ||||
Update Rate | 7768821 | 2054 days ago | IN | 0 ETH | 0.00052103 | ||||
Update Rate | 7768809 | 2054 days ago | IN | 0 ETH | 0.00048367 | ||||
Update Rate | 7768620 | 2054 days ago | IN | 0 ETH | 0.00048367 | ||||
Update Rate | 7768257 | 2054 days ago | IN | 0 ETH | 0.00048367 | ||||
Update Rate | 7768202 | 2054 days ago | IN | 0 ETH | 0.00036472 | ||||
Update Rate | 7768133 | 2054 days ago | IN | 0 ETH | 0.00029773 | ||||
Update Rate | 7767924 | 2054 days ago | IN | 0 ETH | 0.00011161 | ||||
Update Rate | 7767787 | 2054 days ago | IN | 0 ETH | 0.00037206 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MakerDAOPriceFeed
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-07-09 */ pragma solidity 0.4.24; // File: contracts/interfaces/EthPriceFeedI.sol interface EthPriceFeedI { function getUnit() external view returns(string); function getRate() external view returns(uint256); function getLastTimeUpdated() external view returns(uint256); } // File: contracts/interfaces/ReadableI.sol // https://github.com/makerdao/feeds/blob/master/src/abi/readable.json pragma solidity 0.4.24; interface ReadableI { // We only care about these functions function peek() external view returns(bytes32, bool); function read() external view returns(bytes32); // function owner() external view returns(address); // function zzz() external view returns(uint256); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: contracts/MakerDAOPriceFeed.sol contract MakerDAOPriceFeed is Ownable, EthPriceFeedI { using SafeMath for uint256; uint256 public constant RATE_THRESHOLD_PERCENTAGE = 10; uint256 public constant MAKERDAO_FEED_MULTIPLIER = 10**36; ReadableI public makerDAOMedianizer; uint256 private weiPerUnitRate; uint256 private lastTimeUpdated; event RateUpdated(uint256 _newRate, uint256 _timeUpdated); modifier isValidRate(uint256 _weiPerUnitRate) { require(validRate(_weiPerUnitRate)); _; } constructor(ReadableI _makerDAOMedianizer) public { require(_makerDAOMedianizer != address(0)); makerDAOMedianizer = _makerDAOMedianizer; weiPerUnitRate = convertToRate(_makerDAOMedianizer.read()); lastTimeUpdated = now; } /// @dev Receives rate from outside oracle /// @param _weiPerUnitRate calculated off chain and received in the contract function updateRate(uint256 _weiPerUnitRate) external onlyOwner isValidRate(_weiPerUnitRate) { weiPerUnitRate = _weiPerUnitRate; lastTimeUpdated = now; emit RateUpdated(_weiPerUnitRate, now); } function getUnit() external view returns(string) { return "USD"; } /// @dev View function to see the rate stored in the contract. function getRate() public view returns(uint256) { return weiPerUnitRate; } /// @dev View function to see that last time that the rate was updated. function getLastTimeUpdated() public view returns(uint256) { return lastTimeUpdated; } /// @dev Checks that a rate is valid. /// @param _weiPerUnitRate The rate to check /// @return True iff the rate is valid function validRate(uint256 _weiPerUnitRate) public view returns(bool) { if (_weiPerUnitRate == 0) return false; (bytes32 value, bool valid) = makerDAOMedianizer.peek(); // If the value from the medianizer is not valid, use the current rate as reference uint256 currentRate = valid ? convertToRate(value) : weiPerUnitRate; // Get the difference uint256 diff = _weiPerUnitRate < currentRate ? currentRate.sub(_weiPerUnitRate) : _weiPerUnitRate.sub(currentRate); return diff <= currentRate.mul(RATE_THRESHOLD_PERCENTAGE).div(100); } /// @dev Transforms a bytes32 value taken from MakerDAO's Medianizer contract into wei per usd rate /// @param _fromMedianizer Value taken from MakerDAO's Medianizer contract /// @return The wei per usd rate function convertToRate(bytes32 _fromMedianizer) internal pure returns(uint256) { uint256 value = uint256(_fromMedianizer); return MAKERDAO_FEED_MULTIPLIER.div(value); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"makerDAOMedianizer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"RATE_THRESHOLD_PERCENTAGE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_weiPerUnitRate","type":"uint256"}],"name":"validRate","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAKERDAO_FEED_MULTIPLIER","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_weiPerUnitRate","type":"uint256"}],"name":"updateRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getLastTimeUpdated","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getUnit","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_makerDAOMedianizer","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_newRate","type":"uint256"},{"indexed":false,"name":"_timeUpdated","type":"uint256"}],"name":"RateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051602080610783833981016040525160008054600160a060020a03191633179055600160a060020a038116151561004957600080fd5b60018054600160a060020a031916600160a060020a038316908117909155604080517f57de26a400000000000000000000000000000000000000000000000000000000815290516100f692916357de26a49160048083019260209291908290030181600087803b1580156100bc57600080fd5b505af11580156100d0573d6000803e3d6000fd5b505050506040513d60208110156100e657600080fd5b5051640100000000610103810204565b6002555042600355610148565b60008161012c6ec097ce7bc90715b34b9f10000000008264010000000061056e61013382021704565b9392505050565b6000818381151561014057fe5b049392505050565b61062c806101576000396000f3006080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633bd137e081146100b35780633fdbb6c7146100e457806349a742eb1461010b5780634a6213a114610137578063679aefce1461014c57806369ea177114610161578063715018a61461017b5780638da5cb5b14610190578063d390021d146101a5578063e55186a1146101ba578063f2fde38b14610244575b600080fd5b3480156100bf57600080fd5b506100c8610265565b60408051600160a060020a039092168252519081900360200190f35b3480156100f057600080fd5b506100f9610274565b60408051918252519081900360200190f35b34801561011757600080fd5b50610123600435610279565b604080519115158252519081900360200190f35b34801561014357600080fd5b506100f961039b565b34801561015857600080fd5b506100f96103ae565b34801561016d57600080fd5b506101796004356103b4565b005b34801561018757600080fd5b5061017961042a565b34801561019c57600080fd5b506100c8610496565b3480156101b157600080fd5b506100f96104a5565b3480156101c657600080fd5b506101cf6104ab565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102095781810151838201526020016101f1565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b50610179600160a060020a03600435166104e2565b600154600160a060020a031681565b600a81565b60008080808085151561028f5760009450610392565b600154604080517f59e02dd70000000000000000000000000000000000000000000000000000000081528151600160a060020a03909316926359e02dd7926004808401939192918290030181600087803b1580156102ec57600080fd5b505af1158015610300573d6000803e3d6000fd5b505050506040513d604081101561031657600080fd5b5080516020909101519094509250826103315760025461033a565b61033a84610505565b915081861061035857610353868363ffffffff61052e16565b610368565b610368828763ffffffff61052e16565b905061038c606461038084600a63ffffffff61054516565b9063ffffffff61056e16565b81111594505b50505050919050565b6ec097ce7bc90715b34b9f100000000081565b60025490565b600054600160a060020a031633146103cb57600080fd5b806103d581610279565b15156103e057600080fd5b600282905542600381905560408051848152602081019290925280517fb38780ddde1f073d91c150de2696f3f7085883648ba21cc5ef01029cb21d19169281900390910190a15050565b600054600160a060020a0316331461044157600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b60035490565b60408051808201909152600381527f5553440000000000000000000000000000000000000000000000000000000000602082015290565b600054600160a060020a031633146104f957600080fd5b61050281610583565b50565b6000816105276ec097ce7bc90715b34b9f10000000008263ffffffff61056e16565b9392505050565b60008282111561053a57fe5b508082035b92915050565b60008215156105565750600061053f565b5081810281838281151561056657fe5b041461053f57fe5b6000818381151561057b57fe5b049392505050565b600160a060020a038116151561059857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820d59f57543405512b9503a47a684e8feb68229700dd7fc26b98b55b02978ff7da0029000000000000000000000000729d19f657bd0614b4985cf1d82531c67569197b
Deployed Bytecode
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633bd137e081146100b35780633fdbb6c7146100e457806349a742eb1461010b5780634a6213a114610137578063679aefce1461014c57806369ea177114610161578063715018a61461017b5780638da5cb5b14610190578063d390021d146101a5578063e55186a1146101ba578063f2fde38b14610244575b600080fd5b3480156100bf57600080fd5b506100c8610265565b60408051600160a060020a039092168252519081900360200190f35b3480156100f057600080fd5b506100f9610274565b60408051918252519081900360200190f35b34801561011757600080fd5b50610123600435610279565b604080519115158252519081900360200190f35b34801561014357600080fd5b506100f961039b565b34801561015857600080fd5b506100f96103ae565b34801561016d57600080fd5b506101796004356103b4565b005b34801561018757600080fd5b5061017961042a565b34801561019c57600080fd5b506100c8610496565b3480156101b157600080fd5b506100f96104a5565b3480156101c657600080fd5b506101cf6104ab565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102095781810151838201526020016101f1565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b50610179600160a060020a03600435166104e2565b600154600160a060020a031681565b600a81565b60008080808085151561028f5760009450610392565b600154604080517f59e02dd70000000000000000000000000000000000000000000000000000000081528151600160a060020a03909316926359e02dd7926004808401939192918290030181600087803b1580156102ec57600080fd5b505af1158015610300573d6000803e3d6000fd5b505050506040513d604081101561031657600080fd5b5080516020909101519094509250826103315760025461033a565b61033a84610505565b915081861061035857610353868363ffffffff61052e16565b610368565b610368828763ffffffff61052e16565b905061038c606461038084600a63ffffffff61054516565b9063ffffffff61056e16565b81111594505b50505050919050565b6ec097ce7bc90715b34b9f100000000081565b60025490565b600054600160a060020a031633146103cb57600080fd5b806103d581610279565b15156103e057600080fd5b600282905542600381905560408051848152602081019290925280517fb38780ddde1f073d91c150de2696f3f7085883648ba21cc5ef01029cb21d19169281900390910190a15050565b600054600160a060020a0316331461044157600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b60035490565b60408051808201909152600381527f5553440000000000000000000000000000000000000000000000000000000000602082015290565b600054600160a060020a031633146104f957600080fd5b61050281610583565b50565b6000816105276ec097ce7bc90715b34b9f10000000008263ffffffff61056e16565b9392505050565b60008282111561053a57fe5b508082035b92915050565b60008215156105565750600061053f565b5081810281838281151561056657fe5b041461053f57fe5b6000818381151561057b57fe5b049392505050565b600160a060020a038116151561059857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820d59f57543405512b9503a47a684e8feb68229700dd7fc26b98b55b02978ff7da0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000729d19f657bd0614b4985cf1d82531c67569197b
-----Decoded View---------------
Arg [0] : _makerDAOMedianizer (address): 0x729D19f657BD0614b4985Cf1D82531c67569197B
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000729d19f657bd0614b4985cf1d82531c67569197b
Swarm Source
bzzr://d59f57543405512b9503a47a684e8feb68229700dd7fc26b98b55b02978ff7da
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.