[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 22 Internal Transactions

ParentTxHash Block Age From To Value
0x41248c9944ec507f998b610caa0049100fb60c1090c49419d6621ad05956b32a377429623 days 17 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x41248c9944ec507f998b610caa0049100fb60c1090c49419d6621ad05956b32a377429623 days 17 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x816299acb5656276ef1da4e8984807cf0a9af5b594f776c342ff9476301a1b91377061924 days 8 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x816299acb5656276ef1da4e8984807cf0a9af5b594f776c342ff9476301a1b91377061924 days 8 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x962ee28bd6fb7f3e78300db7fe2037c86696fd6a9c2e70f23b466c2d49d4e267377061224 days 8 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x962ee28bd6fb7f3e78300db7fe2037c86696fd6a9c2e70f23b466c2d49d4e267377061224 days 8 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x9cbe2679786483ca629755126d6f5f510555472e93992789f9e471f91aa47e16374097129 days 12 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x9cbe2679786483ca629755126d6f5f510555472e93992789f9e471f91aa47e16374097129 days 12 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x8bd0928553fa3844136c45fdea42db52ff1b72fec62b6216ef1dcba8129f40e0374096529 days 12 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x8bd0928553fa3844136c45fdea42db52ff1b72fec62b6216ef1dcba8129f40e0374096529 days 12 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0xc51be04acee8ca178f0e4fac1a7548f0de6692776903262090ae38b85581ae11370613035 days 13 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0xc51be04acee8ca178f0e4fac1a7548f0de6692776903262090ae38b85581ae11370613035 days 13 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x72174b5ef163e5698bcb9b69d801efeb98543a1613e46f65219caa243b84bff4370612235 days 13 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x72174b5ef163e5698bcb9b69d801efeb98543a1613e46f65219caa243b84bff4370612235 days 13 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x44b61006a7707ee53b530fe8d4bbe348b8413ec94a4b077e999a1892d45d04c6370210536 days 6 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x44b61006a7707ee53b530fe8d4bbe348b8413ec94a4b077e999a1892d45d04c6370210536 days 6 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x44b61006a7707ee53b530fe8d4bbe348b8413ec94a4b077e999a1892d45d04c6370210536 days 6 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x44b61006a7707ee53b530fe8d4bbe348b8413ec94a4b077e999a1892d45d04c6370210536 days 6 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x4ea4f416121884220ce3a004f721e13ba2e9608357bc9cc1a02e929444932917370209636 days 6 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x4ea4f416121884220ce3a004f721e13ba2e9608357bc9cc1a02e929444932917370209636 days 6 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
0x4ea4f416121884220ce3a004f721e13ba2e9608357bc9cc1a02e929444932917370209636 days 6 hrs ago0x25b0d44506db86212180ac16a63f30e129520b220xbfff80b73f081cc159534d922712551c5ed8b3d30 Ether
0x4ea4f416121884220ce3a004f721e13ba2e9608357bc9cc1a02e929444932917370209636 days 6 hrs ago0xad6aea9b383409ebfd4191a60dfbd68c5fa89e710x25b0d44506db86212180ac16a63f30e129520b220 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact Match)
Contract Name: PriceOracleInterface
Compiler Version: v0.5.2+commit.1df8f40c
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.5.2;



contract DSMath {
    /*
    standard uint256 functions
     */

    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assert((z = x + y) >= x);
    }

    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assert((z = x - y) <= x);
    }

    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assert((z = x * y) >= x);
    }

    function div(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x / y;
    }

    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        return x <= y ? x : y;
    }

    function max(uint256 x, uint256 y) internal pure returns (uint256 z) {
        return x >= y ? x : y;
    }

    /*
    uint128 functions (h is for half)
     */

    function hadd(uint128 x, uint128 y) internal pure returns (uint128 z) {
        assert((z = x + y) >= x);
    }

    function hsub(uint128 x, uint128 y) internal pure returns (uint128 z) {
        assert((z = x - y) <= x);
    }

    function hmul(uint128 x, uint128 y) internal pure returns (uint128 z) {
        assert((z = x * y) >= x);
    }

    function hdiv(uint128 x, uint128 y) internal pure returns (uint128 z) {
        z = x / y;
    }

    function hmin(uint128 x, uint128 y) internal pure returns (uint128 z) {
        return x <= y ? x : y;
    }

    function hmax(uint128 x, uint128 y) internal pure returns (uint128 z) {
        return x >= y ? x : y;
    }

    /*
    int256 functions
     */

    function imin(int256 x, int256 y) internal pure returns (int256 z) {
        return x <= y ? x : y;
    }

    function imax(int256 x, int256 y) internal pure returns (int256 z) {
        return x >= y ? x : y;
    }

    /*
    WAD math
     */

    uint128 constant WAD = 10 ** 18;

    function wadd(uint128 x, uint128 y) internal pure returns (uint128) {
        return hadd(x, y);
    }

    function wsub(uint128 x, uint128 y) internal pure returns (uint128) {
        return hsub(x, y);
    }

    function wmul(uint128 x, uint128 y) internal pure returns (uint128 z) {
        z = cast((uint256(x) * y + WAD / 2) / WAD);
    }

    function wdiv(uint128 x, uint128 y) internal pure returns (uint128 z) {
        z = cast((uint256(x) * WAD + y / 2) / y);
    }

    function wmin(uint128 x, uint128 y) internal pure returns (uint128) {
        return hmin(x, y);
    }

    function wmax(uint128 x, uint128 y) internal pure returns (uint128) {
        return hmax(x, y);
    }

    /*
    RAY math
     */

    uint128 constant RAY = 10 ** 27;

    function radd(uint128 x, uint128 y) internal pure returns (uint128) {
        return hadd(x, y);
    }

    function rsub(uint128 x, uint128 y) internal pure returns (uint128) {
        return hsub(x, y);
    }

    function rmul(uint128 x, uint128 y) internal pure returns (uint128 z) {
        z = cast((uint256(x) * y + RAY / 2) / RAY);
    }

    function rdiv(uint128 x, uint128 y) internal pure returns (uint128 z) {
        z = cast((uint256(x) * RAY + y / 2) / y);
    }

    function rpow(uint128 x, uint64 n) internal pure returns (uint128 z) {
        // This famous algorithm is called "exponentiation by squaring"
        // and calculates x^n with x as fixed-point and n as regular unsigned.
        //
        // It's O(log n), instead of O(n) for naive repeated multiplication.
        //
        // These facts are why it works:
        //
        //  If n is even, then x^n = (x^2)^(n/2).
        //  If n is odd,  then x^n = x * x^(n-1),
        //   and applying the equation for even x gives
        //    x^n = x * (x^2)^((n-1) / 2).
        //
        //  Also, EVM division is flooring and
        //    floor[(n-1) / 2] = floor[n / 2].

        z = n % 2 != 0 ? x : RAY;

        for (n /= 2; n != 0; n /= 2) {
            x = rmul(x, x);

            if (n % 2 != 0) {
                z = rmul(z, x);
            }
        }
    }

    function rmin(uint128 x, uint128 y) internal pure returns (uint128) {
        return hmin(x, y);
    }

    function rmax(uint128 x, uint128 y) internal pure returns (uint128) {
        return hmax(x, y);
    }

    function cast(uint256 x) internal pure returns (uint128 z) {
        assert((z = uint128(x)) == x);
    }

}

// File: /home/velenir/Projects/Gnosis/dx-daostack/node_modules/@gnosis.pm/dx-contracts/contracts/Oracle/DSAuth.sol

contract DSAuthority {
    function canCall(address src, address dst, bytes4 sig) public view returns (bool);
}


contract DSAuthEvents {
    event LogSetAuthority(address indexed authority);
    event LogSetOwner(address indexed owner);
}


contract DSAuth is DSAuthEvents {
    DSAuthority public authority;
    address public owner;

    constructor() public {
        owner = msg.sender;
        emit LogSetOwner(msg.sender);
    }

    function setOwner(address owner_) public auth {
        owner = owner_;
        emit LogSetOwner(owner);
    }

    function setAuthority(DSAuthority authority_) public auth {
        authority = authority_;
        emit LogSetAuthority(address(authority));
    }

    modifier auth {
        require(isAuthorized(msg.sender, msg.sig), "It must be an authorized call");
        _;
    }

    function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
        if (src == address(this)) {
            return true;
        } else if (src == owner) {
            return true;
        } else if (authority == DSAuthority(0)) {
            return false;
        } else {
            return authority.canCall(src, address(this), sig);
        }
    }
}

// File: /home/velenir/Projects/Gnosis/dx-daostack/node_modules/@gnosis.pm/dx-contracts/contracts/Oracle/DSNote.sol

contract DSNote {
    event LogNote(
        bytes4 indexed sig,
        address indexed guy,
        bytes32 indexed foo,
        bytes32 bar,
        uint wad,
        bytes fax
    );

    modifier note {
        bytes32 foo;
        bytes32 bar;
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            foo := calldataload(4)
            bar := calldataload(36)
        }

        emit LogNote(
            msg.sig,
            msg.sender,
            foo,
            bar,
            msg.value,
            msg.data
        );

        _;
    }
}

// File: /home/velenir/Projects/Gnosis/dx-daostack/node_modules/@gnosis.pm/dx-contracts/contracts/Oracle/DSThing.sol

contract DSThing is DSAuth, DSNote, DSMath {}

// File: /home/velenir/Projects/Gnosis/dx-daostack/node_modules/@gnosis.pm/dx-contracts/contracts/Oracle/PriceFeed.sol

/// price-feed.sol

// Copyright (C) 2017  DappHub, LLC

// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND (express or implied).



contract PriceFeed is DSThing {
    uint128 val;
    uint32 public zzz;

    function peek() public view returns (bytes32, bool) {
        return (bytes32(uint256(val)), block.timestamp < zzz);
    }

    function read() public view returns (bytes32) {
        assert(block.timestamp < zzz);
        return bytes32(uint256(val));
    }

    function post(uint128 val_, uint32 zzz_, address med_) public payable note auth {
        val = val_;
        zzz = zzz_;
        (bool success, ) = med_.call(abi.encodeWithSignature("poke()"));
        require(success, "The poke must succeed");
    }

    function void() public payable note auth {
        zzz = 0;
    }

}

// File: /home/velenir/Projects/Gnosis/dx-daostack/node_modules/@gnosis.pm/dx-contracts/contracts/Oracle/DSValue.sol

contract DSValue is DSThing {
    bool has;
    bytes32 val;
    function peek() public view returns (bytes32, bool) {
        return (val, has);
    }

    function read() public view returns (bytes32) {
        (bytes32 wut, bool _has) = peek();
        assert(_has);
        return wut;
    }

    function poke(bytes32 wut) public payable note auth {
        val = wut;
        has = true;
    }

    function void() public payable note auth {
        // unset the value
        has = false;
    }
}

// File: /home/velenir/Projects/Gnosis/dx-daostack/node_modules/@gnosis.pm/dx-contracts/contracts/Oracle/Medianizer.sol

contract Medianizer is DSValue {
    mapping(bytes12 => address) public values;
    mapping(address => bytes12) public indexes;
    bytes12 public next = bytes12(uint96(1));
    uint96 public minimun = 0x1;

    function set(address wat) public auth {
        bytes12 nextId = bytes12(uint96(next) + 1);
        assert(nextId != 0x0);
        set(next, wat);
        next = nextId;
    }

    function set(bytes12 pos, address wat) public payable note auth {
        require(pos != 0x0, "pos cannot be 0x0");
        require(wat == address(0) || indexes[wat] == 0, "wat is not defined or it has an index");

        indexes[values[pos]] = bytes12(0); // Making sure to remove a possible existing address in that position

        if (wat != address(0)) {
            indexes[wat] = pos;
        }

        values[pos] = wat;
    }

    function setMin(uint96 min_) public payable note auth {
        require(min_ != 0x0, "min cannot be 0x0");
        minimun = min_;
    }

    function setNext(bytes12 next_) public payable note auth {
        require(next_ != 0x0, "next cannot be 0x0");
        next = next_;
    }

    function unset(bytes12 pos) public {
        set(pos, address(0));
    }

    function unset(address wat) public {
        set(indexes[wat], address(0));
    }

    function poke() public {
        poke(0);
    }

    function poke(bytes32) public payable note {
        (val, has) = compute();
    }

    function compute() public view returns (bytes32, bool) {
        bytes32[] memory wuts = new bytes32[](uint96(next) - 1);
        uint96 ctr = 0;
        for (uint96 i = 1; i < uint96(next); i++) {
            if (values[bytes12(i)] != address(0)) {
                (bytes32 wut, bool wuz) = DSValue(values[bytes12(i)]).peek();
                if (wuz) {
                    if (ctr == 0 || wut >= wuts[ctr - 1]) {
                        wuts[ctr] = wut;
                    } else {
                        uint96 j = 0;
                        while (wut >= wuts[j]) {
                            j++;
                        }
                        for (uint96 k = ctr; k > j; k--) {
                            wuts[k] = wuts[k - 1];
                        }
                        wuts[j] = wut;
                    }
                    ctr++;
                }
            }
        }

        if (ctr < minimun)
            return (val, false);

        bytes32 value;
        if (ctr % 2 == 0) {
            uint128 val1 = uint128(uint(wuts[(ctr / 2) - 1]));
            uint128 val2 = uint128(uint(wuts[ctr / 2]));
            value = bytes32(uint256(wdiv(hadd(val1, val2), 2 ether)));
        } else {
            value = wuts[(ctr - 1) / 2];
        }

        return (value, true);
    }
}

// File: contracts/Oracle/PriceOracleInterface.sol

/*
This contract is the interface between the MakerDAO priceFeed and our DX platform.
*/




contract PriceOracleInterface {
    address public priceFeedSource;
    address public owner;
    bool public emergencyMode;

    // Modifiers
    modifier onlyOwner() {
        require(msg.sender == owner, "Only the owner can do the operation");
        _;
    }

    /// @dev constructor of the contract
    /// @param _priceFeedSource address of price Feed Source -> should be maker feeds Medianizer contract
    constructor(address _owner, address _priceFeedSource) public {
        owner = _owner;
        priceFeedSource = _priceFeedSource;
    }
    
    /// @dev gives the owner the possibility to put the Interface into an emergencyMode, which will
    /// output always a price of 600 USD. This gives everyone time to set up a new pricefeed.
    function raiseEmergency(bool _emergencyMode) public onlyOwner {
        emergencyMode = _emergencyMode;
    }

    /// @dev updates the priceFeedSource
    /// @param _owner address of owner
    function updateCurator(address _owner) public onlyOwner {
        owner = _owner;
    }

    /// @dev returns the USDETH price
    function getUsdEthPricePeek() public view returns (bytes32 price, bool valid) {
        return Medianizer(priceFeedSource).peek();
    }

    /// @dev returns the USDETH price, ie gets the USD price from Maker feed with 18 digits, but last 18 digits are cut off
    function getUSDETHPrice() public view returns (uint256) {
        // if the contract is in the emergencyMode, because there is an issue with the oracle, we will simply return a price of 600 USD
        if (emergencyMode) {
            return 600;
        }
        (bytes32 price, ) = Medianizer(priceFeedSource).peek();

        // ensuring that there is no underflow or overflow possible,
        // even if the price is compromised
        uint priceUint = uint256(price)/(1 ether);
        if (priceUint == 0) {
            return 1;
        }
        if (priceUint > 1000000) {
            return 1000000; 
        }
        return priceUint;
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"emergencyMode","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"updateCurator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUsdEthPricePeek","outputs":[{"name":"price","type":"bytes32"},{"name":"valid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_emergencyMode","type":"bool"}],"name":"raiseEmergency","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUSDETHPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"priceFeedSource","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_owner","type":"address"},{"name":"_priceFeedSource","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b5060405160408061052e8339810180604052604081101561003057600080fd5b50805160209091015160018054600160a060020a03938416600160a060020a031991821617909155600080549390921692169190911790556104b7806100776000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100785780638da5cb5b146101045780639e385fa414610128578063a3ca17b214610147578063c5ace443146101615761009a565b80630905f5601461009f5780630c6a62dd146100bb5780630c8fe9db146100e3575b600080fd5b6100a7610169565b604080519115158252519081900360200190f35b6100e1600480360360208110156100d157600080fd5b5035600160a060020a031661018a565b005b6100eb61021c565b6040805192835290151560208301528051918290030190f35b61010c6102b2565b60408051600160a060020a039092168252519081900360200190f35b6100e16004803603602081101561013e57600080fd5b503515156102c1565b61014f610364565b60408051918252519081900360200190f35b61010c610459565b60015474010000000000000000000000000000000000000000900460ff1681565b600154600160a060020a031633146101ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806104696023913960400191505060405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008054604080517f59e02dd700000000000000000000000000000000000000000000000000000000815281518493600160a060020a0316926359e02dd79260048082019391829003018186803b15801561027657600080fd5b505afa15801561028a573d6000803e3d6000fd5b505050506040513d60408110156102a057600080fd5b50805160209091015190925090509091565b600154600160a060020a031681565b600154600160a060020a03163314610324576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806104696023913960400191505060405180910390fd5b60018054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60015460009074010000000000000000000000000000000000000000900460ff16156103935750610258610456565b60008054604080517f59e02dd70000000000000000000000000000000000000000000000000000000081528151600160a060020a03909316926359e02dd792600480840193919291829003018186803b1580156103ef57600080fd5b505afa158015610403573d6000803e3d6000fd5b505050506040513d604081101561041957600080fd5b50519050670de0b6b3a7640000810480151561043a57600192505050610456565b620f424081111561045257620f424092505050610456565b9150505b90565b600054600160a060020a03168156fe4f6e6c7920746865206f776e65722063616e20646f20746865206f7065726174696f6ea165627a7a7230582051db69e24ea4038f1851c1ffa11b05ed298160919acaddf9522175b4091082690029000000000000000000000000f85d1a0e1b71e72013db51139f285c6d5356b712000000000000000000000000bfff80b73f081cc159534d922712551c5ed8b3d3

    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f85d1a0e1b71e72013db51139f285c6d5356b712000000000000000000000000bfff80b73f081cc159534d922712551c5ed8b3d3

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f85d1a0e1b71e72013db51139f285c6d5356b712
Arg [1] : 000000000000000000000000bfff80b73f081cc159534d922712551c5ed8b3d3


   Swarm Source:
bzzr://51db69e24ea4038f1851c1ffa11b05ed298160919acaddf9522175b409108269

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward