ETH Price: $3,108.37 (-0.91%)

Contract

0xc626867660Df1cc6274ce0338E7DfB92474647C5
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update212260232024-11-20 2:40:113 hrs ago1732070411IN
0xc6268676...2474647C5
0 ETH0.0008382913.77893007
Update212259732024-11-20 2:30:113 hrs ago1732069811IN
0xc6268676...2474647C5
0 ETH0.0007452112.24896536
Update212183492024-11-19 1:00:1128 hrs ago1731978011IN
0xc6268676...2474647C5
0 ETH0.0007096411.66423701
Update212182492024-11-19 0:40:1129 hrs ago1731976811IN
0xc6268676...2474647C5
0 ETH0.0007566512.43698661
Update212162062024-11-18 17:50:1135 hrs ago1731952211IN
0xc6268676...2474647C5
0 ETH0.0013620422.38761578
Update212158062024-11-18 16:30:1137 hrs ago1731947411IN
0xc6268676...2474647C5
0 ETH0.0015761725.90726996
Update212157552024-11-18 16:19:5937 hrs ago1731946799IN
0xc6268676...2474647C5
0 ETH0.0016832127.66665092
Update212157062024-11-18 16:10:1137 hrs ago1731946211IN
0xc6268676...2474647C5
0 ETH0.0015320325.18178183
Update212131682024-11-18 7:40:1146 hrs ago1731915611IN
0xc6268676...2474647C5
0 ETH0.0007393112.15206759
Update212109752024-11-18 0:20:112 days ago1731889211IN
0xc6268676...2474647C5
0 ETH0.000596039.79698589
Update212075362024-11-17 12:50:112 days ago1731847811IN
0xc6268676...2474647C5
0 ETH0.000678311.14921464
Update212074862024-11-17 12:40:112 days ago1731847211IN
0xc6268676...2474647C5
0 ETH0.0007314312.02250904
Update212012122024-11-16 15:40:113 days ago1731771611IN
0xc6268676...2474647C5
0 ETH0.001069517.57931756
Update212011622024-11-16 15:30:113 days ago1731771011IN
0xc6268676...2474647C5
0 ETH0.0010615217.4481387
Update211941482024-11-15 16:00:114 days ago1731686411IN
0xc6268676...2474647C5
0 ETH0.00150924.80327829
Update211896702024-11-15 1:00:115 days ago1731632411IN
0xc6268676...2474647C5
0 ETH0.0011384718.71284094
Update211896232024-11-15 0:50:235 days ago1731631823IN
0xc6268676...2474647C5
0 ETH0.0010915817.94225327
Update211892232024-11-14 23:29:595 days ago1731626999IN
0xc6268676...2474647C5
0 ETH0.0017653729.01716942
Update211879302024-11-14 19:10:115 days ago1731611411IN
0xc6268676...2474647C5
0 ETH0.0017709329.10854212
Update211878802024-11-14 19:00:115 days ago1731610811IN
0xc6268676...2474647C5
0 ETH0.001677127.56628463
Update211875322024-11-14 17:50:115 days ago1731606611IN
0xc6268676...2474647C5
0 ETH0.0020135233.09598584
Update211873352024-11-14 17:10:115 days ago1731604211IN
0xc6268676...2474647C5
0 ETH0.001830130.08118143
Update211870862024-11-14 16:20:115 days ago1731601211IN
0xc6268676...2474647C5
0 ETH0.0023504238.63360006
Update211870362024-11-14 16:10:115 days ago1731600611IN
0xc6268676...2474647C5
0 ETH0.002621643.09079171
Update211835552024-11-14 4:30:116 days ago1731558611IN
0xc6268676...2474647C5
0 ETH0.0018635830.63142118
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
212260232024-11-20 2:40:113 hrs ago1732070411
0xc6268676...2474647C5
0 ETH
212260232024-11-20 2:40:113 hrs ago1732070411
0xc6268676...2474647C5
0 ETH
212260232024-11-20 2:40:113 hrs ago1732070411
0xc6268676...2474647C5
0 ETH
212259732024-11-20 2:30:113 hrs ago1732069811
0xc6268676...2474647C5
0 ETH
212259732024-11-20 2:30:113 hrs ago1732069811
0xc6268676...2474647C5
0 ETH
212259732024-11-20 2:30:113 hrs ago1732069811
0xc6268676...2474647C5
0 ETH
212183492024-11-19 1:00:1128 hrs ago1731978011
0xc6268676...2474647C5
0 ETH
212183492024-11-19 1:00:1128 hrs ago1731978011
0xc6268676...2474647C5
0 ETH
212183492024-11-19 1:00:1128 hrs ago1731978011
0xc6268676...2474647C5
0 ETH
212182492024-11-19 0:40:1129 hrs ago1731976811
0xc6268676...2474647C5
0 ETH
212182492024-11-19 0:40:1129 hrs ago1731976811
0xc6268676...2474647C5
0 ETH
212182492024-11-19 0:40:1129 hrs ago1731976811
0xc6268676...2474647C5
0 ETH
212162062024-11-18 17:50:1135 hrs ago1731952211
0xc6268676...2474647C5
0 ETH
212162062024-11-18 17:50:1135 hrs ago1731952211
0xc6268676...2474647C5
0 ETH
212162062024-11-18 17:50:1135 hrs ago1731952211
0xc6268676...2474647C5
0 ETH
212158062024-11-18 16:30:1137 hrs ago1731947411
0xc6268676...2474647C5
0 ETH
212158062024-11-18 16:30:1137 hrs ago1731947411
0xc6268676...2474647C5
0 ETH
212158062024-11-18 16:30:1137 hrs ago1731947411
0xc6268676...2474647C5
0 ETH
212157552024-11-18 16:19:5937 hrs ago1731946799
0xc6268676...2474647C5
0 ETH
212157552024-11-18 16:19:5937 hrs ago1731946799
0xc6268676...2474647C5
0 ETH
212157552024-11-18 16:19:5937 hrs ago1731946799
0xc6268676...2474647C5
0 ETH
212157062024-11-18 16:10:1137 hrs ago1731946211
0xc6268676...2474647C5
0 ETH
212157062024-11-18 16:10:1137 hrs ago1731946211
0xc6268676...2474647C5
0 ETH
212157062024-11-18 16:10:1137 hrs ago1731946211
0xc6268676...2474647C5
0 ETH
212131682024-11-18 7:40:1146 hrs ago1731915611
0xc6268676...2474647C5
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UniswapPairOracle

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Multiple files format)

File 1 of 11: UniswapPairOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import "./IUniswapV2Factory.sol";
import "./IUniswapV2Pair.sol";
import "./FixedPoint.sol";

import "./UniswapV2OracleLibrary.sol";
import "./UniswapV2Library.sol";

// 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 UniswapPairOracle {
    using FixedPoint for *;
    
    address owner_address;
    address timelock_address;

    uint public PERIOD = 300; // 300s TWAP (time-weighted average price)

    IUniswapV2Pair public immutable pair;
    address public immutable token0;
    address public immutable token1;

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

    modifier onlyByOwnerOrGovernance() {
        require(msg.sender == owner_address || msg.sender == timelock_address, "You are not an owner or the governance timelock");
        _;
    }

    constructor(address factory, address tokenA, address tokenB, address _owner_address, address _timelock_address) public {
        IUniswapV2Pair _pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB));
        pair = _pair;
        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, "UniswapPairOracle: NO_RESERVES"); // Ensure that there's liquidity in the pair

        owner_address = _owner_address;
        timelock_address = _timelock_address;
    }

    function setOwner(address _owner_address) external onlyByOwnerOrGovernance {
        owner_address = _owner_address;
    }

    function setTimelock(address _timelock_address) external onlyByOwnerOrGovernance {
        timelock_address = _timelock_address;
    }

    function setPeriod(uint _period) external onlyByOwnerOrGovernance {
        PERIOD = _period;
    }

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

        // Ensure that at least one full period has passed since the last update
        require(timeElapsed >= PERIOD, "UniswapPairOracle: PERIOD_NOT_ELAPSED");

        // Overflow is desired, casting never truncates
        // Cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
        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 getAssetPrice(address token) external view returns (uint amountOut) {
        uint amountIn = 1e18;
        if (token == token0) {
            amountOut = price0Average.mul(amountIn).decode144();
        } else {
            require(token == token1, "UniswapPairOracle: INVALID_TOKEN");
            amountOut = price1Average.mul(amountIn).decode144();
        }
    }
}

File 2 of 11: Babylonian.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

// 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 3 of 11: FixedPoint.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import './Babylonian.sol';

// 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 4 of 11: IAggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

interface IAggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 5 of 11: IUniswapPairOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

interface IUniswapPairOracle {
    function getAssetPrice(address token) external view returns (uint amountOut);
}

File 6 of 11: IUniswapV2Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

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 7 of 11: IUniswapV2Pair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

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 8 of 11: LBRPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;

import "./IUniswapPairOracle.sol";
import "./IAggregatorV3Interface.sol";

contract LBRPriceOFeed {
    IUniswapPairOracle public immutable pairOracle;
    address public immutable LBR;
     IAggregatorV3Interface public priceFeed;
      //priceFeed = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

    constructor(address _pairOracle, address _LBR, address _etherOracle) public {
        pairOracle = IUniswapPairOracle(_pairOracle);
        LBR = _LBR;
        priceFeed = IAggregatorV3Interface(_etherOracle);

    }
 
    function latestRoundData() external view returns(uint80, int, uint, uint, uint80) {
        uint256 price = pairOracle.getAssetPrice(LBR);
        ( ,int256 ethPrice, , , ) = priceFeed.latestRoundData();
        uint256 lbrPrice = price * uint256(ethPrice) / 1e18;
        return (0, int(lbrPrice), 0,0,0);
    }
}

File 9 of 11: SafeMath.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;

/**
 * @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) {
    // Solidity only automatically asserts when dividing by 0
    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;
  }
}

File 10 of 11: UniswapV2Library.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import './IUniswapV2Pair.sol';
import './IUniswapV2Factory.sol';

import "./SafeMath.sol";

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');
    }

    // Less efficient than the CREATE2 method below
    function pairFor(address factory, address tokenA, address tokenB) internal view returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = IUniswapV2Factory(factory).getPair(token0, token1);
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairForCreate2(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
            )))); // this matches the CREATE2 in UniswapV2Factory.createPair
    }

    // 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);
        }
    }
}

File 11 of 11: UniswapV2OracleLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import './IUniswapV2Pair.sol';
import './FixedPoint.sol';

// 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;
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"address","name":"_owner_address","type":"address"},{"internalType":"address","name":"_timelock_address","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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"}],"name":"getAssetPrice","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"contract IUniswapV2Pair","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_address","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_timelock_address","type":"address"}],"name":"setTimelock","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"}]

60e060405261012c6002553480156200001757600080fd5b50604051620011fa380380620011fa833981810160405260a08110156200003d57600080fd5b508051602080830151604084015160608501516080909501519394919390926000906200007990879087908790620006b8620003c0821b17901c565b9050806001600160a01b03166080816001600160a01b031660601b81525050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015620000d257600080fd5b505afa158015620000e7573d6000803e3d6000fd5b505050506040513d6020811015620000fe57600080fd5b505160601b6001600160601b03191660a0526040805163d21220a760e01b815290516001600160a01b0383169163d21220a7916004808301926020929190829003018186803b1580156200015157600080fd5b505afa15801562000166573d6000803e3d6000fd5b505050506040513d60208110156200017d57600080fd5b505160601b6001600160601b03191660c05260408051635909c0d560e01b815290516001600160a01b03831691635909c0d5916004808301926020929190829003018186803b158015620001d057600080fd5b505afa158015620001e5573d6000803e3d6000fd5b505050506040513d6020811015620001fc57600080fd5b505160035560408051635a3d549360e01b815290516001600160a01b03831691635a3d5493916004808301926020929190829003018186803b1580156200024257600080fd5b505afa15801562000257573d6000803e3d6000fd5b505050506040513d60208110156200026e57600080fd5b5051600490815560408051630240bc6b60e21b8152905160009283926001600160a01b03861692630902f1ac92828101926060929190829003018186803b158015620002b957600080fd5b505afa158015620002ce573d6000803e3d6000fd5b505050506040513d6060811015620002e557600080fd5b50805160208201516040909201516005805463ffffffff191663ffffffff909216919091179055925090506001600160701b038216158015906200033157506001600160701b03811615155b62000383576040805162461bcd60e51b815260206004820152601e60248201527f556e6973776170506169724f7261636c653a204e4f5f52455345525645530000604482015290519081900360640190fd5b5050600080546001600160a01b039485166001600160a01b0319918216179091556001805493909416921691909117909155506200054e92505050565b60008080620003d085856200046b565b91509150856001600160a01b031663e6a4390583836040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b1580156200043357600080fd5b505afa15801562000448573d6000803e3d6000fd5b505050506040513d60208110156200045f57600080fd5b50519695505050505050565b600080826001600160a01b0316846001600160a01b03161415620004c15760405162461bcd60e51b8152600401808060200182810382526025815260200180620011d56025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610620004e3578284620004e6565b83835b90925090506001600160a01b03821662000547576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b60805160601c60a05160601c60c05160601c610c426200059360003980610545528061069652508061023552806104cf52508061035f528061049d5250610c426000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a6bb45391161008c578063b4d1d79511610066578063b4d1d795146101dc578063bdacb303146101e4578063c5700a021461020a578063d21220a71461022b576100ea565b8063a6bb4539146101a6578063a8aa1b31146101ae578063b3596f07146101b6576100ea565b80635909c0d5116100c85780635909c0d5146101585780635a3d5493146101725780635e6aaf2c1461017a578063a2e620451461019e576100ea565b80630dfe1681146100ef5780630f3a9f651461011357806313af403514610132575b600080fd5b6100f7610233565b604080516001600160a01b039092168252519081900360200190f35b6101306004803603602081101561012957600080fd5b5035610257565b005b6101306004803603602081101561014857600080fd5b50356001600160a01b03166102ba565b61016061033a565b60408051918252519081900360200190f35b610160610340565b610182610346565b604080516001600160e01b039092168252519081900360200190f35b610130610355565b61018261048c565b6100f761049b565b610160600480360360208110156101cc57600080fd5b50356001600160a01b03166104bf565b610160610602565b610130600480360360208110156101fa57600080fd5b50356001600160a01b0316610608565b610212610688565b6040805163ffffffff9092168252519081900360200190f35b6100f7610694565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031633148061027a57506001546001600160a01b031633145b6102b55760405162461bcd60e51b815260040180806020018281038252602f815260200180610bde602f913960400191505060405180910390fd5b600255565b6000546001600160a01b03163314806102dd57506001546001600160a01b031633145b6103185760405162461bcd60e51b815260040180806020018281038252602f815260200180610bde602f913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b60045481565b6007546001600160e01b031681565b60008060006103837f000000000000000000000000000000000000000000000000000000000000000061075f565b600554600254939650919450925063ffffffff90811683039190821610156103dc5760405162461bcd60e51b8152600401808060200182810382526025815260200180610b966025913960400191505060405180910390fd5b60405180602001604052808263ffffffff166003548703816103fa57fe5b046001600160e01b039081169091529051600680546001600160e01b031916919092161790556040805160208101909152600454819063ffffffff84169086038161044157fe5b046001600160e01b039081169091529051600780546001600160e01b03191691909216179055506003929092556004556005805463ffffffff191663ffffffff909216919091179055565b6006546001600160e01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080670de0b6b3a764000090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614156105435760408051602081019091526006546001600160e01b031681526105339061052e908361092e565b6109ac565b6001600160901b031691506105fc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146105c9576040805162461bcd60e51b815260206004820181905260248201527f556e6973776170506169724f7261636c653a20494e56414c49445f544f4b454e604482015290519081900360640190fd5b60408051602081019091526007546001600160e01b031681526105f09061052e908361092e565b6001600160901b031691505b50919050565b60025481565b6000546001600160a01b031633148061062b57506001546001600160a01b031633145b6106665760405162461bcd60e51b815260040180806020018281038252602f815260200180610bde602f913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60055463ffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060006106c785856109b3565b91509150856001600160a01b031663e6a4390583836040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561072957600080fd5b505afa15801561073d573d6000803e3d6000fd5b505050506040513d602081101561075357600080fd5b50519695505050505050565b600080600061076c610a91565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a757600080fd5b505afa1580156107bb573d6000803e3d6000fd5b505050506040513d60208110156107d157600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b15801561081757600080fd5b505afa15801561082b573d6000803e3d6000fd5b505050506040513d602081101561084157600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b15801561088d57600080fd5b505afa1580156108a1573d6000803e3d6000fd5b505050506040513d60608110156108b757600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146109245780840363ffffffff81166108f18486610a9b565b516001600160e01b031602969096019563ffffffff81166109128585610a9b565b516001600160e01b0316029590950194505b5050509193909250565b610936610b4b565b600082158061095c57505082516001600160e01b03168281029083828161095957fe5b04145b6109975760405162461bcd60e51b8152600401808060200182810382526023815260200180610bbb6023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b600080826001600160a01b0316846001600160a01b03161415610a075760405162461bcd60e51b8152600401808060200182810382526025815260200180610b716025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610610a27578284610a2a565b83835b90925090506001600160a01b038216610a8a576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b63ffffffff421690565b610aa3610b5e565b6000826001600160701b031611610b01576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b1681610b3657fe5b046001600160e01b0316815250905092915050565b6040518060200160405280600081525090565b6040805160208101909152600081529056fe556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e6973776170506169724f7261636c653a20504552494f445f4e4f545f454c41505345444669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57596f7520617265206e6f7420616e206f776e6572206f722074686520676f7665726e616e63652074696d656c6f636ba26469706673582212201afe10cccc04f14703fa514ace2086a2c74ebafed13ab82dbd8fcb66243b9e1c64736f6c634300060c0033556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345530000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000ed1167b6dc64e8a366db86f2e952a482d0981ebd000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000bb3a32722b4cd85f06f8f57aaa4a579d5de88c60000000000000000000000000bb3a32722b4cd85f06f8f57aaa4a579d5de88c6

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a6bb45391161008c578063b4d1d79511610066578063b4d1d795146101dc578063bdacb303146101e4578063c5700a021461020a578063d21220a71461022b576100ea565b8063a6bb4539146101a6578063a8aa1b31146101ae578063b3596f07146101b6576100ea565b80635909c0d5116100c85780635909c0d5146101585780635a3d5493146101725780635e6aaf2c1461017a578063a2e620451461019e576100ea565b80630dfe1681146100ef5780630f3a9f651461011357806313af403514610132575b600080fd5b6100f7610233565b604080516001600160a01b039092168252519081900360200190f35b6101306004803603602081101561012957600080fd5b5035610257565b005b6101306004803603602081101561014857600080fd5b50356001600160a01b03166102ba565b61016061033a565b60408051918252519081900360200190f35b610160610340565b610182610346565b604080516001600160e01b039092168252519081900360200190f35b610130610355565b61018261048c565b6100f761049b565b610160600480360360208110156101cc57600080fd5b50356001600160a01b03166104bf565b610160610602565b610130600480360360208110156101fa57600080fd5b50356001600160a01b0316610608565b610212610688565b6040805163ffffffff9092168252519081900360200190f35b6100f7610694565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000546001600160a01b031633148061027a57506001546001600160a01b031633145b6102b55760405162461bcd60e51b815260040180806020018281038252602f815260200180610bde602f913960400191505060405180910390fd5b600255565b6000546001600160a01b03163314806102dd57506001546001600160a01b031633145b6103185760405162461bcd60e51b815260040180806020018281038252602f815260200180610bde602f913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b60045481565b6007546001600160e01b031681565b60008060006103837f0000000000000000000000003a0ef60e803aae8e94f741e7f61c7cbe9501e56961075f565b600554600254939650919450925063ffffffff90811683039190821610156103dc5760405162461bcd60e51b8152600401808060200182810382526025815260200180610b966025913960400191505060405180910390fd5b60405180602001604052808263ffffffff166003548703816103fa57fe5b046001600160e01b039081169091529051600680546001600160e01b031916919092161790556040805160208101909152600454819063ffffffff84169086038161044157fe5b046001600160e01b039081169091529051600780546001600160e01b03191691909216179055506003929092556004556005805463ffffffff191663ffffffff909216919091179055565b6006546001600160e01b031681565b7f0000000000000000000000003a0ef60e803aae8e94f741e7f61c7cbe9501e56981565b600080670de0b6b3a764000090507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b031614156105435760408051602081019091526006546001600160e01b031681526105339061052e908361092e565b6109ac565b6001600160901b031691506105fc565b7f000000000000000000000000ed1167b6dc64e8a366db86f2e952a482d0981ebd6001600160a01b0316836001600160a01b0316146105c9576040805162461bcd60e51b815260206004820181905260248201527f556e6973776170506169724f7261636c653a20494e56414c49445f544f4b454e604482015290519081900360640190fd5b60408051602081019091526007546001600160e01b031681526105f09061052e908361092e565b6001600160901b031691505b50919050565b60025481565b6000546001600160a01b031633148061062b57506001546001600160a01b031633145b6106665760405162461bcd60e51b815260040180806020018281038252602f815260200180610bde602f913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60055463ffffffff1681565b7f000000000000000000000000ed1167b6dc64e8a366db86f2e952a482d0981ebd81565b60008060006106c785856109b3565b91509150856001600160a01b031663e6a4390583836040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561072957600080fd5b505afa15801561073d573d6000803e3d6000fd5b505050506040513d602081101561075357600080fd5b50519695505050505050565b600080600061076c610a91565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a757600080fd5b505afa1580156107bb573d6000803e3d6000fd5b505050506040513d60208110156107d157600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b15801561081757600080fd5b505afa15801561082b573d6000803e3d6000fd5b505050506040513d602081101561084157600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b15801561088d57600080fd5b505afa1580156108a1573d6000803e3d6000fd5b505050506040513d60608110156108b757600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146109245780840363ffffffff81166108f18486610a9b565b516001600160e01b031602969096019563ffffffff81166109128585610a9b565b516001600160e01b0316029590950194505b5050509193909250565b610936610b4b565b600082158061095c57505082516001600160e01b03168281029083828161095957fe5b04145b6109975760405162461bcd60e51b8152600401808060200182810382526023815260200180610bbb6023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b600080826001600160a01b0316846001600160a01b03161415610a075760405162461bcd60e51b8152600401808060200182810382526025815260200180610b716025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610610a27578284610a2a565b83835b90925090506001600160a01b038216610a8a576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b63ffffffff421690565b610aa3610b5e565b6000826001600160701b031611610b01576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b1681610b3657fe5b046001600160e01b0316815250905092915050565b6040518060200160405280600081525090565b6040805160208101909152600081529056fe556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e6973776170506169724f7261636c653a20504552494f445f4e4f545f454c41505345444669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57596f7520617265206e6f7420616e206f776e6572206f722074686520676f7665726e616e63652074696d656c6f636ba26469706673582212201afe10cccc04f14703fa514ace2086a2c74ebafed13ab82dbd8fcb66243b9e1c64736f6c634300060c0033

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

0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000ed1167b6dc64e8a366db86f2e952a482d0981ebd000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000bb3a32722b4cd85f06f8f57aaa4a579d5de88c60000000000000000000000000bb3a32722b4cd85f06f8f57aaa4a579d5de88c6

-----Decoded View---------------
Arg [0] : factory (address): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Arg [1] : tokenA (address): 0xed1167b6Dc64E8a366DB86F2E952A482D0981ebd
Arg [2] : tokenB (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [3] : _owner_address (address): 0x0bb3a32722b4cD85f06F8f57AAa4A579d5de88c6
Arg [4] : _timelock_address (address): 0x0bb3a32722b4cD85f06F8f57AAa4A579d5de88c6

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [1] : 000000000000000000000000ed1167b6dc64e8a366db86f2e952a482d0981ebd
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [3] : 0000000000000000000000000bb3a32722b4cd85f06f8f57aaa4a579d5de88c6
Arg [4] : 0000000000000000000000000bb3a32722b4cd85f06f8f57aaa4a579d5de88c6


Deployed Bytecode Sourcemap

432:3451:8:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;672:31;;;:::i;:::-;;;;-1:-1:-1;;;;;672:31:8;;;;;;;;;;;;;;2306:99;;;;;;;;;;;;;;;;-1:-1:-1;2306:99:8;;:::i;:::-;;2038:122;;;;;;;;;;;;;;;;-1:-1:-1;2038:122:8;-1:-1:-1;;;;;2038:122:8;;:::i;747:35::-;;;:::i;:::-;;;;;;;;;;;;;;;;788;;;:::i;915:41::-;;;:::i;:::-;;;;-1:-1:-1;;;;;915:41:8;;;;;;;;;;;;;;2411:986;;;:::i;868:41::-;;;:::i;630:36::-;;;:::i;3505:376::-;;;;;;;;;;;;;;;;-1:-1:-1;3505:376:8;-1:-1:-1;;;;;3505:376:8;;:::i;556:24::-;;;:::i;2166:134::-;;;;;;;;;;;;;;;;-1:-1:-1;2166:134:8;-1:-1:-1;;;;;2166:134:8;;:::i;829:33::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;709:31;;;:::i;672:::-;;;:::o;2306:99::-;1030:13;;-1:-1:-1;;;;;1030:13:8;1016:10;:27;;:61;;-1:-1:-1;1061:16:8;;-1:-1:-1;;;;;1061:16:8;1047:10;:30;1016:61;1008:121;;;;-1:-1:-1;;;1008:121:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2382:6:::1;:16:::0;2306:99::o;2038:122::-;1030:13;;-1:-1:-1;;;;;1030:13:8;1016:10;:27;;:61;;-1:-1:-1;1061:16:8;;-1:-1:-1;;;;;1061:16:8;1047:10;:30;1016:61;1008:121;;;;-1:-1:-1;;;1008:121:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2123:13:::1;:30:::0;;-1:-1:-1;;;;;;2123:30:8::1;-1:-1:-1::0;;;;;2123:30:8;;;::::1;::::0;;;::::1;::::0;;2038:122::o;747:35::-;;;;:::o;788:::-;;;;:::o;915:41::-;;;-1:-1:-1;;;;;915:41:8;;:::o;2411:986::-;2449:21;2472;2495;2532:61;2587:4;2532:46;:61::i;:::-;2641:18;;2797:6;;2448:145;;-1:-1:-1;2448:145:8;;-1:-1:-1;2448:145:8;-1:-1:-1;2641:18:8;;;;2624:35;;;2782:21;;;;;2774:71;;;;-1:-1:-1;;;2774:71:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3048:86;;;;;;;;3121:11;3077:55;;3097:20;;3078:16;:39;3077:55;;;;;;-1:-1:-1;;;;;3048:86:8;;;;;;3032:102;;:13;:102;;-1:-1:-1;;;;;;3032:102:8;;;;;;;;3160:86;;;;;;;;;3209:20;;3160:86;;3189:55;;;;3190:39;;3189:55;;;;;;-1:-1:-1;;;;;3160:86:8;;;;;;3144:102;;:13;:102;;-1:-1:-1;;;;;;3144:102:8;;;;;;;;-1:-1:-1;3257:20:8;:39;;;;-1:-1:-1;3306:39:8;3355:18;:35;;-1:-1:-1;;3355:35:8;;;;;;;;;;;2411:986::o;868:41::-;;;-1:-1:-1;;;;;868:41:8;;:::o;630:36::-;;;:::o;3505:376::-;3566:14;3592:13;3608:4;3592:20;;3635:6;-1:-1:-1;;;;;3626:15:8;:5;-1:-1:-1;;;;;3626:15:8;;3622:253;;;3669:17;;;;;;;;;:13;:17;-1:-1:-1;;;;;3669:17:8;;;:39;;:27;;3687:8;3669:17;:27::i;:::-;:37;:39::i;:::-;-1:-1:-1;;;;;3657:51:8;;;3622:253;;;3756:6;-1:-1:-1;;;;;3747:15:8;:5;-1:-1:-1;;;;;3747:15:8;;3739:60;;;;;-1:-1:-1;;;3739:60:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3825:17;;;;;;;;;:13;:17;-1:-1:-1;;;;;3825:17:8;;;:39;;:27;;3843:8;3825:17;:27::i;:39::-;-1:-1:-1;;;;;3813:51:8;;;3622:253;3505:376;;;;:::o;556:24::-;;;;:::o;2166:134::-;1030:13;;-1:-1:-1;;;;;1030:13:8;1016:10;:27;;:61;;-1:-1:-1;1061:16:8;;-1:-1:-1;;;;;1061:16:8;1047:10;:30;1016:61;1008:121;;;;-1:-1:-1;;;1008:121:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2257:16:::1;:36:::0;;-1:-1:-1;;;;;;2257:36:8::1;-1:-1:-1::0;;;;;2257:36:8;;;::::1;::::0;;;::::1;::::0;;2166:134::o;829:33::-;;;;;;:::o;709:31::-;;;:::o;713:248:9:-;802:12;827:14;843;861:26;872:6;880;861:10;:26::i;:::-;826:61;;;;922:7;-1:-1:-1;;;;;904:34:9;;939:6;947;904:50;;;;;;;;;;;;;-1:-1:-1;;;;;904:50:9;;;;;;-1:-1:-1;;;;;904:50:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;904:50:9;;713:248;-1:-1:-1;;;;;;713:248:9:o;610:1040:10:-;694:21;717;740;790:23;:21;:23::i;:::-;773:40;;857:4;-1:-1:-1;;;;;842:41:10;;:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;842:43:10;914;;;-1:-1:-1;;;914:43:10;;;;842;;-1:-1:-1;;;;;;914:41:10;;;;;:43;;;;;842;;914;;;;;;;;:41;:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;914:43:10;1134:34;;;-1:-1:-1;;;1134:34:10;;;;914:43;;-1:-1:-1;1069:16:10;;;;;;-1:-1:-1;;;;;1134:32:10;;;;;:34;;;;;;;;;;;;;;:32;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1134:34:10;;;;;;;;;;;;;-1:-1:-1;1134:34:10;;-1:-1:-1;1134:34:10;-1:-1:-1;1182:36:10;;;;;;;;1178:466;;1302:35;;;1445:62;;;1450:39;1470:8;1480;1450:19;:39::i;:::-;:42;-1:-1:-1;;;;;1445:48:10;:62;1425:82;;;;;1571:62;;;1576:39;1596:8;1606;1576:19;:39::i;:::-;:42;-1:-1:-1;;;;;1571:48:10;:62;1551:82;;;;;-1:-1:-1;1178:466:10;610:1040;;;;;;;;:::o;1284:249:1:-;1351:16;;:::i;:::-;1379:6;1403;;;:54;;-1:-1:-1;;1449:7:1;;-1:-1:-1;;;;;1444:13:1;1418:17;;;;1439:1;1418:17;1439:1;1413:27;;;;;:44;1403:54;1395:102;;;;-1:-1:-1;;;1395:102:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1514:12;;;;;;;;;;;;;1284:249;-1:-1:-1;;;1284:249:1:o;2219:128::-;2318:7;466:3;2318:21;;2219:128::o;310:345:9:-;385:14;401;445:6;-1:-1:-1;;;;;435:16:9;:6;-1:-1:-1;;;;;435:16:9;;;427:66;;;;-1:-1:-1;;;427:66:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;531:6;-1:-1:-1;;;;;522:15:9;:6;-1:-1:-1;;;;;522:15:9;;:53;;560:6;568;522:53;;;541:6;549;522:53;503:72;;-1:-1:-1;503:72:9;-1:-1:-1;;;;;;593:20:9;;585:63;;;;;-1:-1:-1;;;585:63:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;310:345;;;;;:::o;386:121:10:-;474:25;:15;:25;;386:121::o;1685:243:1:-;1766:16;;:::i;:::-;1816:1;1802:11;-1:-1:-1;;;;;1802:15:1;;1794:51;;;;;-1:-1:-1;;;1794:51:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;1862:59;;;;;;;;;;-1:-1:-1;;;;;1872:48:1;;-1:-1:-1;;;466:3:1;1873:32;;;;1872:48;;;;;;-1:-1:-1;;;;;1862:59:1;;;;1855:66;;1685:243;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;:::o

Swarm Source

ipfs://1afe10cccc04f14703fa514ace2086a2c74ebafed13ab82dbd8fcb66243b9e1c

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.