ETH Price: $2,710.60 (-2.60%)

Contract

0x490B30c06CFF70378Eb8B2125A1d641d211502D9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update212197472024-11-19 5:40:4795 days ago1731994847IN
0x490B30c0...d211502D9
0 ETH0.000352898.91631763
Update111129072020-10-23 13:52:161582 days ago1603461136IN
0x490B30c0...d211502D9
0 ETH0.0031742951.00000145
Update110676542020-10-16 15:06:141589 days ago1602860774IN
0x490B30c0...d211502D9
0 ETH0.0050732555

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DecentralizedOracle

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-10-16
*/

// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol

pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol

pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

// File: @uniswap/lib/contracts/libraries/Babylonian.sol

pragma solidity >=0.4.0;

// computes square roots using the babylonian method
// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
library Babylonian {
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
        // else z = 0
    }
}

// File: @uniswap/lib/contracts/libraries/FixedPoint.sol

pragma solidity >=0.4.0;


// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
    // range: [0, 2**112 - 1]
    // resolution: 1 / 2**112
    struct uq112x112 {
        uint224 _x;
    }

    // range: [0, 2**144 - 1]
    // resolution: 1 / 2**112
    struct uq144x112 {
        uint _x;
    }

    uint8 private constant RESOLUTION = 112;
    uint private constant Q112 = uint(1) << RESOLUTION;
    uint private constant Q224 = Q112 << RESOLUTION;

    // encode a uint112 as a UQ112x112
    function encode(uint112 x) internal pure returns (uq112x112 memory) {
        return uq112x112(uint224(x) << RESOLUTION);
    }

    // encodes a uint144 as a UQ144x112
    function encode144(uint144 x) internal pure returns (uq144x112 memory) {
        return uq144x112(uint256(x) << RESOLUTION);
    }

    // divide a UQ112x112 by a uint112, returning a UQ112x112
    function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
        require(x != 0, 'FixedPoint: DIV_BY_ZERO');
        return uq112x112(self._x / uint224(x));
    }

    // multiply a UQ112x112 by a uint, returning a UQ144x112
    // reverts on overflow
    function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
        uint z;
        require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
        return uq144x112(z);
    }

    // returns a UQ112x112 which represents the ratio of the numerator to the denominator
    // equivalent to encode(numerator).div(denominator)
    function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
        require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
        return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
    }

    // decode a UQ112x112 into a uint112 by truncating after the radix point
    function decode(uq112x112 memory self) internal pure returns (uint112) {
        return uint112(self._x >> RESOLUTION);
    }

    // decode a UQ144x112 into a uint144 by truncating after the radix point
    function decode144(uq144x112 memory self) internal pure returns (uint144) {
        return uint144(self._x >> RESOLUTION);
    }

    // take the reciprocal of a UQ112x112
    function reciprocal(uq112x112 memory self) internal pure returns (uq112x112 memory) {
        require(self._x != 0, 'FixedPoint: ZERO_RECIPROCAL');
        return uq112x112(uint224(Q224 / self._x));
    }

    // square root of a UQ112x112
    function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) {
        return uq112x112(uint224(Babylonian.sqrt(uint256(self._x)) << 56));
    }
}

// File: contracts/decentralizedOracle.sol

pragma solidity =0.6.6;




// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

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

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be 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;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// library with helper methods for oracles that are concerned with computing average prices
library UniswapV2OracleLibrary {
    using FixedPoint for *;

    // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
    function currentBlockTimestamp() internal view returns (uint32) {
        return uint32(block.timestamp % 2 ** 32);
    }

    // produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
    function currentCumulativePrices(
        address pair
    ) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
        blockTimestamp = currentBlockTimestamp();
        price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
        price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();

        // if time has elapsed since the last update on the pair, mock the accumulated price values
        (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
        if (blockTimestampLast != blockTimestamp) {
            // subtraction overflow is desired
            uint32 timeElapsed = blockTimestamp - blockTimestampLast;
            // addition overflow is desired
            // counterfactual
            price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
            // counterfactual
            price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
        }
    }
}

library UniswapV2Library {
    using SafeMath for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = amountA.mul(reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint numerator = reserveIn.mul(amountOut).mul(1000);
        uint denominator = reserveOut.sub(amountOut).mul(997);
        amountIn = (numerator / denominator).add(1);
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}

// fixed window oracle that recomputes the average price for the entire period once every period
// note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period
contract DecentralizedOracle {
    using FixedPoint for *;

    uint public constant DAILY = 1425 minutes; // 23 hours and 45 minutes
    uint public constant HALF_DAY = 705 minutes; // 11 hours and 45 minutes
    uint public constant HOURLY = 60 minutes; // 60 minutes
    uint public PERIOD;

    IUniswapV2Pair pair;
    address public token0;
    address public token1;
    address public owner;

    uint    public price0CumulativeLast;
    uint    public price1CumulativeLast;
    uint32  public blockTimestampLast;
    FixedPoint.uq112x112 public price0Average;
    FixedPoint.uq112x112 public price1Average;

    constructor(address factory, address tokenA, address tokenB) public {
        IUniswapV2Pair _pair = IUniswapV2Pair(IUniswapV2Factory(factory).getPair(tokenA, tokenB));
        pair = _pair;
        owner = msg.sender;

        // default for 2nd contracts
        PERIOD = HALF_DAY;

        token0 = _pair.token0();
        token1 = _pair.token1();
        price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0)
        price1CumulativeLast = _pair.price1CumulativeLast(); // fetch the current accumulated price value (0 / 1)
        uint112 reserve0;
        uint112 reserve1;
        (reserve0, reserve1, blockTimestampLast) = _pair.getReserves();
        require(reserve0 != 0 && reserve1 != 0, 'DecentralizedOracle: NO_RESERVES'); // ensure that there's liquidity in the pair
    }

    function setPeriodDaily()
        external
    {
        require(msg.sender == owner, "Only Owner");
        PERIOD = DAILY;
    }

    function setPeriodHalfDay()
        external
    {
        require(msg.sender == owner, "Only Owner");
        PERIOD = HALF_DAY;
    }

    function setPeriodHourly()
        external
    {
        require(msg.sender == owner, "Only Owner");
        PERIOD = HOURLY;
    }

    // new owner
    function setNewOwner(address owner_)
        external
    {
        require(msg.sender == owner, "Only Owner");
        owner = owner_;
    }

    function update() external {
        (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) =
            UniswapV2OracleLibrary.currentCumulativePrices(address(pair));
        uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired

        // overflow is desired, casting never truncates
        // cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed

        if (timeElapsed >= PERIOD) {
            price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / timeElapsed));
            price1Average = FixedPoint.uq112x112(uint224((price1Cumulative - price1CumulativeLast) / timeElapsed));

            price0CumulativeLast = price0Cumulative;
            price1CumulativeLast = price1Cumulative;
            blockTimestampLast = blockTimestamp;
        }
    }

    // note this will always return 0 before update has been called successfully for the first time.
    function consult(address token, uint amountIn) external view returns (uint amountOut) {
        if (token == token0) {
            amountOut = price0Average.mul(amountIn).decode144();
        } else {
            require(token == token1, 'DecentralizedOracle: INVALID_TOKEN');
            amountOut = price1Average.mul(amountIn).decode144();
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DAILY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HALF_DAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOURLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockTimestampLast","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"consult","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price0Average","outputs":[{"internalType":"uint224","name":"_x","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1Average","outputs":[{"internalType":"uint224","name":"_x","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"setNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPeriodDaily","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPeriodHalfDay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPeriodHourly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051610da5380380610da58339818101604052606081101561003357600080fd5b508051602080830151604093840151845163e6a4390560e01b81526001600160a01b0380841660048301528083166024830152955194959294919360009387169263e6a43905926044808201939291829003018186803b15801561009657600080fd5b505afa1580156100aa573d6000803e3d6000fd5b505050506040513d60208110156100c057600080fd5b5051600180546001600160a01b0383166001600160a01b03199182168117909255600480549091163317815561a53c60005560408051630dfe168160e01b815290519394509192630dfe1681928083019260209291829003018186803b15801561012957600080fd5b505afa15801561013d573d6000803e3d6000fd5b505050506040513d602081101561015357600080fd5b5051600280546001600160a01b0319166001600160a01b039283161790556040805163d21220a760e01b815290519183169163d21220a791600480820192602092909190829003018186803b1580156101ab57600080fd5b505afa1580156101bf573d6000803e3d6000fd5b505050506040513d60208110156101d557600080fd5b5051600380546001600160a01b0319166001600160a01b0392831617905560408051635909c0d560e01b8152905191831691635909c0d591600480820192602092909190829003018186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b505160055560408051635a3d549360e01b815290516001600160a01b03831691635a3d5493916004808301926020929190829003018186803b15801561029c57600080fd5b505afa1580156102b0573d6000803e3d6000fd5b505050506040513d60208110156102c657600080fd5b505160065560408051630240bc6b60e21b8152905160009182916001600160a01b03851691630902f1ac916004808301926060929190829003018186803b15801561031057600080fd5b505afa158015610324573d6000803e3d6000fd5b505050506040513d606081101561033a57600080fd5b50805160208201516040909201516007805463ffffffff191663ffffffff909216919091179055925090506001600160701b0382161580159061038557506001600160701b03811615155b6103d6576040805162461bcd60e51b815260206004820181905260248201527f446563656e7472616c697a65644f7261636c653a204e4f5f5245534552564553604482015290519081900360640190fd5b5050505050506109ba806103eb6000396000f3fe608060405234801561001057600080fd5b50600436106101155760003560e01c80637a68d1b7116100a2578063b4d1d79511610071578063b4d1d795146101f2578063c5700a02146101fa578063d21220a71461021b578063dea15f9f14610223578063f5a1f5b41461022b57610115565b80637a68d1b7146101d25780638da5cb5b146101da578063a2e62045146101e2578063a6bb4539146101ea57610115565b80635909c0d5116100e95780635909c0d51461018e5780635a3d5493146101965780635bb3d17e1461019e5780635e6aaf2c146101a657806365eeb9e4146101ca57610115565b80629585931461011a5780630dfe1681146101345780631940da5f146101585780633ddac95314610162575b600080fd5b610122610251565b60408051918252519081900360200190f35b61013c610257565b604080516001600160a01b039092168252519081900360200190f35b610160610266565b005b6101226004803603604081101561017857600080fd5b506001600160a01b0381351690602001356102ba565b6101226103a0565b6101226103a6565b6101226103ac565b6101ae6103b2565b604080516001600160e01b039092168252519081900360200190f35b6101606103c1565b610122610416565b61013c61041d565b61016061042c565b6101ae61051a565b610122610529565b61020261052f565b6040805163ffffffff9092168252519081900360200190f35b61013c61053b565b61016061054a565b6101606004803603602081101561024157600080fd5b50356001600160a01b031661059e565b61a53c81565b6002546001600160a01b031681565b6004546001600160a01b031633146102b2576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b61a53c600055565b6002546000906001600160a01b03848116911614156103155760408051602081019091526008546001600160e01b0316815261030590610300908463ffffffff61060c16565b61068a565b6001600160901b0316905061039a565b6003546001600160a01b038481169116146103615760405162461bcd60e51b81526004018080602001828103825260228152602001806109406022913960400191505060405180910390fd5b60408051602081019091526009546001600160e01b0316815261038e90610300908463ffffffff61060c16565b6001600160901b031690505b92915050565b60055481565b60065481565b610e1081565b6009546001600160e01b031681565b6004546001600160a01b0316331461040d576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b62014dfc600055565b62014dfc81565b6004546001600160a01b031681565b60015460009081908190610448906001600160a01b0316610691565b600754600054939650919450925063ffffffff908116830391908216106105145760405180602001604052808263ffffffff1660055487038161048757fe5b046001600160e01b039081169091529051600880546001600160e01b031916919092161790556040805160208101909152600654819063ffffffff8416908603816104ce57fe5b046001600160e01b039081169091529051600980546001600160e01b03191691909216179055600584905560068390556007805463ffffffff191663ffffffff84161790555b50505050565b6008546001600160e01b031681565b60005481565b60075463ffffffff1681565b6003546001600160a01b031681565b6004546001600160a01b03163314610596576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b610e10600055565b6004546001600160a01b031633146105ea576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61061461091a565b600082158061063a57505082516001600160e01b03168281029083828161063757fe5b04145b6106755760405162461bcd60e51b81526004018080602001828103825260238152602001806109626023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b600080600061069e610860565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156106d957600080fd5b505afa1580156106ed573d6000803e3d6000fd5b505050506040513d602081101561070357600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b15801561074957600080fd5b505afa15801561075d573d6000803e3d6000fd5b505050506040513d602081101561077357600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b1580156107bf57600080fd5b505afa1580156107d3573d6000803e3d6000fd5b505050506040513d60608110156107e957600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146108565780840363ffffffff8116610823848661086a565b516001600160e01b031602969096019563ffffffff8116610844858561086a565b516001600160e01b0316029590950194505b5050509193909250565b63ffffffff421690565b61087261092d565b6000826001600160701b0316116108d0576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b168161090557fe5b046001600160e01b0316815250905092915050565b6040518060200160405280600081525090565b6040805160208101909152600081529056fe446563656e7472616c697a65644f7261636c653a20494e56414c49445f544f4b454e4669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57a2646970667358221220106d598c9e33edc52a2ee1247c5d5092db7c1cfc79b10691615ef806b8efdf8d64736f6c634300060600330000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002f6081e3552b1c86ce4479b80062a1dda8ef23e3

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101155760003560e01c80637a68d1b7116100a2578063b4d1d79511610071578063b4d1d795146101f2578063c5700a02146101fa578063d21220a71461021b578063dea15f9f14610223578063f5a1f5b41461022b57610115565b80637a68d1b7146101d25780638da5cb5b146101da578063a2e62045146101e2578063a6bb4539146101ea57610115565b80635909c0d5116100e95780635909c0d51461018e5780635a3d5493146101965780635bb3d17e1461019e5780635e6aaf2c146101a657806365eeb9e4146101ca57610115565b80629585931461011a5780630dfe1681146101345780631940da5f146101585780633ddac95314610162575b600080fd5b610122610251565b60408051918252519081900360200190f35b61013c610257565b604080516001600160a01b039092168252519081900360200190f35b610160610266565b005b6101226004803603604081101561017857600080fd5b506001600160a01b0381351690602001356102ba565b6101226103a0565b6101226103a6565b6101226103ac565b6101ae6103b2565b604080516001600160e01b039092168252519081900360200190f35b6101606103c1565b610122610416565b61013c61041d565b61016061042c565b6101ae61051a565b610122610529565b61020261052f565b6040805163ffffffff9092168252519081900360200190f35b61013c61053b565b61016061054a565b6101606004803603602081101561024157600080fd5b50356001600160a01b031661059e565b61a53c81565b6002546001600160a01b031681565b6004546001600160a01b031633146102b2576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b61a53c600055565b6002546000906001600160a01b03848116911614156103155760408051602081019091526008546001600160e01b0316815261030590610300908463ffffffff61060c16565b61068a565b6001600160901b0316905061039a565b6003546001600160a01b038481169116146103615760405162461bcd60e51b81526004018080602001828103825260228152602001806109406022913960400191505060405180910390fd5b60408051602081019091526009546001600160e01b0316815261038e90610300908463ffffffff61060c16565b6001600160901b031690505b92915050565b60055481565b60065481565b610e1081565b6009546001600160e01b031681565b6004546001600160a01b0316331461040d576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b62014dfc600055565b62014dfc81565b6004546001600160a01b031681565b60015460009081908190610448906001600160a01b0316610691565b600754600054939650919450925063ffffffff908116830391908216106105145760405180602001604052808263ffffffff1660055487038161048757fe5b046001600160e01b039081169091529051600880546001600160e01b031916919092161790556040805160208101909152600654819063ffffffff8416908603816104ce57fe5b046001600160e01b039081169091529051600980546001600160e01b03191691909216179055600584905560068390556007805463ffffffff191663ffffffff84161790555b50505050565b6008546001600160e01b031681565b60005481565b60075463ffffffff1681565b6003546001600160a01b031681565b6004546001600160a01b03163314610596576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b610e10600055565b6004546001600160a01b031633146105ea576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9027bbb732b960b11b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61061461091a565b600082158061063a57505082516001600160e01b03168281029083828161063757fe5b04145b6106755760405162461bcd60e51b81526004018080602001828103825260238152602001806109626023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b600080600061069e610860565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156106d957600080fd5b505afa1580156106ed573d6000803e3d6000fd5b505050506040513d602081101561070357600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b15801561074957600080fd5b505afa15801561075d573d6000803e3d6000fd5b505050506040513d602081101561077357600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b1580156107bf57600080fd5b505afa1580156107d3573d6000803e3d6000fd5b505050506040513d60608110156107e957600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146108565780840363ffffffff8116610823848661086a565b516001600160e01b031602969096019563ffffffff8116610844858561086a565b516001600160e01b0316029590950194505b5050509193909250565b63ffffffff421690565b61087261092d565b6000826001600160701b0316116108d0576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b168161090557fe5b046001600160e01b0316815250905092915050565b6040518060200160405280600081525090565b6040805160208101909152600081529056fe446563656e7472616c697a65644f7261636c653a20494e56414c49445f544f4b454e4669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57a2646970667358221220106d598c9e33edc52a2ee1247c5d5092db7c1cfc79b10691615ef806b8efdf8d64736f6c63430006060033

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

0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002f6081e3552b1c86ce4479b80062a1dda8ef23e3

-----Decoded View---------------
Arg [0] : factory (address): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Arg [1] : tokenA (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : tokenB (address): 0x2F6081E3552b1c86cE4479B80062A1ddA8EF23E3

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000002f6081e3552b1c86ce4479b80062a1dda8ef23e3


Deployed Bytecode Sourcemap

18399:3494:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;18399:3494:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;18541:43:0;;;:::i;:::-;;;;;;;;;;;;;;;;18732:21;;;:::i;:::-;;;;-1:-1:-1;;;;;18732:21:0;;;;;;;;;;;;;;20044:140;;;:::i;:::-;;21526:364;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;;;;;;21526:364:0;;;;;;;;:::i;18817:35::-;;;:::i;18859:::-;;;:::i;18618:40::-;;;:::i;18989:41::-;;;:::i;:::-;;;;-1:-1:-1;;;;;18989:41:0;;;;;;;;;;;;;;19901:135;;;:::i;18466:41::-;;;:::i;18788:20::-;;;:::i;20509:907::-;;;:::i;18941:41::-;;;:::i;18679:18::-;;;:::i;18901:33::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18760:21;;;:::i;20192:137::-;;;:::i;20355:146::-;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;20355:146:0;-1:-1:-1;;;;;20355:146:0;;:::i;18541:43::-;18573:11;18541:43;:::o;18732:21::-;;;-1:-1:-1;;;;;18732:21:0;;:::o;20044:140::-;20128:5;;-1:-1:-1;;;;;20128:5:0;20114:10;:19;20106:42;;;;;-1:-1:-1;;;20106:42:0;;;;;;;;;;;;-1:-1:-1;;;20106:42:0;;;;;;;;;;;;;;;18573:11;20159:6;:17;20044:140::o;21526:364::-;21636:6;;21596:14;;-1:-1:-1;;;;;21627:15:0;;;21636:6;;21627:15;21623:260;;;21671:17;;;;;;;;;:13;:17;-1:-1:-1;;;;;21671:17:0;;;:39;;:27;;21689:8;21671:27;:17;:27;:::i;:::-;:37;:39::i;:::-;-1:-1:-1;;;;;21659:51:0;;;21623:260;;;21760:6;;-1:-1:-1;;;;;21751:15:0;;;21760:6;;21751:15;21743:62;;;;-1:-1:-1;;;21743:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21832:17;;;;;;;;;:13;:17;-1:-1:-1;;;;;21832:17:0;;;:39;;:27;;21850:8;21832:27;:17;:27;:::i;:39::-;-1:-1:-1;;;;;21820:51:0;;;21623:260;21526:364;;;;:::o;18817:35::-;;;;:::o;18859:::-;;;;:::o;18618:40::-;18648:10;18618:40;:::o;18989:41::-;;;-1:-1:-1;;;;;18989:41:0;;:::o;19901:135::-;19983:5;;-1:-1:-1;;;;;19983:5:0;19969:10;:19;19961:42;;;;;-1:-1:-1;;;19961:42:0;;;;;;;;;;;;-1:-1:-1;;;19961:42:0;;;;;;;;;;;;;;;18495:12;20014:6;:14;19901:135::o;18466:41::-;18495:12;18466:41;:::o;18788:20::-;;;-1:-1:-1;;;;;18788:20:0;;:::o;20509:907::-;20687:4;;20548:21;;;;;;20632:61;;-1:-1:-1;;;;;20687:4:0;20632:46;:61::i;:::-;20742:18;;20704;20995:6;20547:146;;-1:-1:-1;20547:146:0;;-1:-1:-1;20547:146:0;-1:-1:-1;20742:18:0;;;;20725:35;;;20980:21;;;;20976:433;;21034:86;;;;;;;;21107:11;21063:55;;21083:20;;21064:16;:39;21063:55;;;;;;-1:-1:-1;;;;;21034:86:0;;;;;;21018:102;;:13;:102;;-1:-1:-1;;;;;;21018:102:0;;;;;;;;21151:86;;;;;;;;;21200:20;;21151:86;;21180:55;;;;21181:39;;21180:55;;;;;;-1:-1:-1;;;;;21151:86:0;;;;;;21135:102;;:13;:102;;-1:-1:-1;;;;;;21135:102:0;;;;;;;;21254:20;:39;;;21308:20;:39;;;21362:18;:35;;-1:-1:-1;;21362:35:0;;;;;;;20976:433;20509:907;;;;:::o;18941:41::-;;;-1:-1:-1;;;;;18941:41:0;;:::o;18679:18::-;;;;:::o;18901:33::-;;;;;;:::o;18760:21::-;;;-1:-1:-1;;;;;18760:21:0;;:::o;20192:137::-;20275:5;;-1:-1:-1;;;;;20275:5:0;20261:10;:19;20253:42;;;;;-1:-1:-1;;;20253:42:0;;;;;;;;;;;;-1:-1:-1;;;20253:42:0;;;;;;;;;;;;;;;18648:10;20306:6;:15;20192:137::o;20355:146::-;20448:5;;-1:-1:-1;;;;;20448:5:0;20434:10;:19;20426:42;;;;;-1:-1:-1;;;20426:42:0;;;;;;;;;;;;-1:-1:-1;;;20426:42:0;;;;;;;;;;;;;;;20479:5;:14;;-1:-1:-1;;;;;;20479:14:0;-1:-1:-1;;;;;20479:14:0;;;;;;;;;;20355:146::o;5211:253::-;5278:16;;:::i;:::-;5307:6;5332;;;:54;;-1:-1:-1;;5378:7:0;;-1:-1:-1;;;;;5373:13:0;5347:17;;;;5368:1;5347:17;5368:1;5342:27;;;;;:44;5332:54;5324:102;;;;-1:-1:-1;;;5324:102:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5444:12;;;;;;;;;;;;;5211:253;-1:-1:-1;;;5211:253:0:o;6165:130::-;6265:7;4371:3;6265:21;;6165:130::o;12711:1058::-;12797:21;12820;12843;12894:23;:21;:23::i;:::-;12877:40;;12962:4;-1:-1:-1;;;;;12947:41:0;;:43;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;12947:43:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;12947:43:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;12947:43:0;13020;;;-1:-1:-1;;;13020:43:0;;;;12947;;-1:-1:-1;;;;;;13020:41:0;;;;;:43;;;;;12947;;13020;;;;;;;;:41;:43;;;2:2:-1;;;;27:1;24;17:12;2:2;13020:43:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;13020:43:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;13020:43:0;13243:34;;;-1:-1:-1;;;13243:34:0;;;;13020:43;;-1:-1:-1;13178:16:0;;;;;;-1:-1:-1;;;;;13243:32:0;;;;;:34;;;;;;;;;;;;;;:32;:34;;;2:2:-1;;;;27:1;24;17:12;2:2;13243:34:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;13243:34:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;13243:34:0;;;;;;;;;;;;;-1:-1:-1;13243:34:0;;-1:-1:-1;13243:34:0;-1:-1:-1;13292:36:0;;;;;;;;13288:474;;13414:35;;;13560:62;;;13565:39;13585:8;13595;13565:19;:39::i;:::-;:42;-1:-1:-1;;;;;13560:48:0;:62;13540:82;;;;;13688:62;;;13693:39;13713:8;13723;13693:19;:39::i;:::-;:42;-1:-1:-1;;;;;13688:48:0;:62;13668:82;;;;;-1:-1:-1;13288:474:0;12711:1058;;;;;;;;:::o;12482:123::-;12571:25;:15;:25;;12482:123::o;5620:246::-;5701:16;;:::i;:::-;5752:1;5738:11;-1:-1:-1;;;;;5738:15:0;;5730:51;;;;;-1:-1:-1;;;5730:51:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5799:59;;;;;;;;;;-1:-1:-1;;;;;5809:48:0;;-1:-1:-1;;;4371:3:0;5810:32;;;;5809:48;;;;;;-1:-1:-1;;;;;5799:59:0;;;;5792:66;;5620:246;;;;:::o;18399:3494::-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;-1:-1:-1;18399:3494:0;;;:::o

Swarm Source

ipfs://106d598c9e33edc52a2ee1247c5d5092db7c1cfc79b10691615ef806b8efdf8d

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.