MNT Price: $0.86 (+1.76%)

Contract

0x903Ccd72ece3400a838eF449cb2Bc8A568888afB
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Approve846511482025-09-09 15:43:28139 days ago1757432608IN
0x903Ccd72...568888afB
0 MNT0.003500710.04
Approve765275082025-03-05 14:35:28327 days ago1741185328IN
0x903Ccd72...568888afB
0 MNT0.002808620.02
Approve764183322025-03-03 1:56:16329 days ago1740966976IN
0x903Ccd72...568888afB
0 MNT0.002995920.02
Approve762373512025-02-26 21:23:34333 days ago1740605014IN
0x903Ccd72...568888afB
0 MNT0.003008580.02
Approve741178972025-01-08 19:55:06382 days ago1736366106IN
0x903Ccd72...568888afB
0 MNT0.003100030.02
Approve738249772025-01-02 1:11:06389 days ago1735780266IN
0x903Ccd72...568888afB
0 MNT0.004775890.02
Approve733442902024-12-21 22:08:12400 days ago1734818892IN
0x903Ccd72...568888afB
0 MNT0.004497570.03
Approve729066352024-12-11 18:59:42410 days ago1733943582IN
0x903Ccd72...568888afB
0 MNT0.005353190.02
Approve729046572024-12-11 17:53:46410 days ago1733939626IN
0x903Ccd72...568888afB
0 MNT0.004472490.02
Approve728915082024-12-11 10:35:28411 days ago1733913328IN
0x903Ccd72...568888afB
0 MNT0.003744940.02
Approve728527162024-12-10 13:02:24412 days ago1733835744IN
0x903Ccd72...568888afB
0 MNT0.004717670.02
Approve728154772024-12-09 16:21:06413 days ago1733761266IN
0x903Ccd72...568888afB
0 MNT0.006108110.02
Approve719977822024-11-20 18:04:36431 days ago1732125876IN
0x903Ccd72...568888afB
0 MNT0.006564470.02
Approve710863532024-10-30 15:43:38453 days ago1730303018IN
0x903Ccd72...568888afB
0 MNT0.007044170.02
Approve710694592024-10-30 6:20:30453 days ago1730269230IN
0x903Ccd72...568888afB
0 MNT0.005527130.02
Approve701953482024-10-10 0:43:28473 days ago1728521008IN
0x903Ccd72...568888afB
0 MNT0.004553020.02
Approve701912652024-10-09 22:27:22473 days ago1728512842IN
0x903Ccd72...568888afB
0 MNT0.004897140.02
Approve701807272024-10-09 16:36:06474 days ago1728491766IN
0x903Ccd72...568888afB
0 MNT0.009177020.02
Approve698704342024-10-02 12:13:00481 days ago1727871180IN
0x903Ccd72...568888afB
0 MNT0.004809450.02
Approve695905952024-09-26 0:45:02487 days ago1727311502IN
0x903Ccd72...568888afB
0 MNT0.005065820.02
Approve692873132024-09-19 0:15:38494 days ago1726704938IN
0x903Ccd72...568888afB
0 MNT0.004637890.02
Approve692732672024-09-18 16:27:26495 days ago1726676846IN
0x903Ccd72...568888afB
0 MNT0.005053650.02
Approve692315882024-09-17 17:18:08495 days ago1726593488IN
0x903Ccd72...568888afB
0 MNT0.005850690.02
Approve689825412024-09-11 22:56:34501 days ago1726095394IN
0x903Ccd72...568888afB
0 MNT0.005991040.03
Approve689825312024-09-11 22:56:14501 days ago1726095374IN
0x903Ccd72...568888afB
0 MNT0.00407430.02
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906406212026-01-26 7:12:349 hrs ago1769411554
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
906378682026-01-26 5:40:4811 hrs ago1769406048
0x903Ccd72...568888afB
0 MNT
905755722026-01-24 19:04:1645 hrs ago1769281456
0x903Ccd72...568888afB
0 MNT
905755722026-01-24 19:04:1645 hrs ago1769281456
0x903Ccd72...568888afB
0 MNT
905755722026-01-24 19:04:1645 hrs ago1769281456
0x903Ccd72...568888afB
0 MNT
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xb2Fa7358...C5003D11B
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Pair

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

// import "contracts/libraries/Math.sol";
import "contracts/interfaces/IERC20.sol";
import "contracts/interfaces/IPair.sol";
import "contracts/interfaces/IPairCallee.sol";
import "contracts/factories/PairFactory.sol";
import "contracts/PairFees.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";

// The base pair of pools, either stable or volatile
contract Pair is IPair {
  string public name;
  string public symbol;
  uint8 public constant decimals = 18;

  // Used to denote stable or volatile pair, not immutable since construction happens in the initialize method for CREATE2 deterministic addresses
  bool public immutable stable;

  uint public totalSupply = 0;

  mapping(address => mapping(address => uint)) public allowance;
  mapping(address => uint) public balanceOf;

  bytes32 internal DOMAIN_SEPARATOR;
  // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
  bytes32 internal constant PERMIT_TYPEHASH =
    0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
  mapping(address => uint) public nonces;

  uint internal constant MINIMUM_LIQUIDITY = 10 ** 3;

  address public immutable token0;
  address public immutable token1;
  address public immutable fees;
  address immutable factory;

  // Structure to capture time period obervations every 30 minutes, used for local oracles
  struct Observation {
    uint timestamp;
    uint reserve0Cumulative;
    uint reserve1Cumulative;
  }

  // Capture oracle reading every 30 minutes
  uint constant periodSize = 1800;

  Observation[] public observations;

  uint internal immutable decimals0;
  uint internal immutable decimals1;

  uint public reserve0;
  uint public reserve1;
  uint public blockTimestampLast;

  uint public reserve0CumulativeLast;
  uint public reserve1CumulativeLast;

  // index0 and index1 are used to accumulate fees, this is split out from normal trades to keep the swap "clean"
  // this further allows LP holders to easily claim fees for tokens they have/staked
  uint public index0 = 0;
  uint public index1 = 0;

  // position assigned to each LP to track their current index0 & index1 vs the global position
  mapping(address => uint) public supplyIndex0;
  mapping(address => uint) public supplyIndex1;

  // tracks the amount of unclaimed, but claimable tokens off of fees for token0 and token1
  mapping(address => uint) public claimable0;
  mapping(address => uint) public claimable1;

  event Fees(address indexed sender, uint amount0, uint amount1);
  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(uint reserve0, uint reserve1);
  event Claim(
    address indexed sender,
    address indexed recipient,
    uint amount0,
    uint amount1
  );

  event Transfer(address indexed from, address indexed to, uint amount);
  event Approval(address indexed owner, address indexed spender, uint amount);

  constructor() {
    factory = msg.sender;
    (address _token0, address _token1, bool _stable) = PairFactory(msg.sender)
      .getInitializable();
    (token0, token1, stable) = (_token0, _token1, _stable);
    fees = address(new PairFees(_token0, _token1));
    if (_stable) {
      name = string(
        abi.encodePacked(
          "StableV1 AMM - ",
          IERC20(_token0).symbol(),
          "/",
          IERC20(_token1).symbol()
        )
      );
      symbol = string(
        abi.encodePacked(
          "sAMM-",
          IERC20(_token0).symbol(),
          "/",
          IERC20(_token1).symbol()
        )
      );
    } else {
      name = string(
        abi.encodePacked(
          "VolatileV1 AMM - ",
          IERC20(_token0).symbol(),
          "/",
          IERC20(_token1).symbol()
        )
      );
      symbol = string(
        abi.encodePacked(
          "vAMM-",
          IERC20(_token0).symbol(),
          "/",
          IERC20(_token1).symbol()
        )
      );
    }

    decimals0 = 10 ** IERC20(_token0).decimals();
    decimals1 = 10 ** IERC20(_token1).decimals();

    observations.push(Observation(block.timestamp, 0, 0));
  }

  // simple re-entrancy check
  uint internal _unlocked = 1;
  modifier lock() {
    require(_unlocked == 1);
    _unlocked = 2;
    _;
    _unlocked = 1;
  }

  function observationLength() external view returns (uint) {
    return observations.length;
  }

  function lastObservation() public view returns (Observation memory) {
    return observations[observations.length - 1];
  }

  function metadata()
    external
    view
    returns (
      uint dec0,
      uint dec1,
      uint r0,
      uint r1,
      bool st,
      address t0,
      address t1
    )
  {
    return (decimals0, decimals1, reserve0, reserve1, stable, token0, token1);
  }

  function tokens() external view returns (address, address) {
    return (token0, token1);
  }

  // claim accumulated but unclaimed fees (viewable via claimable0 and claimable1)
  function claimFees() external returns (uint claimed0, uint claimed1) {
    _updateFor(msg.sender);

    claimed0 = claimable0[msg.sender];
    claimed1 = claimable1[msg.sender];

    if (claimed0 > 0 || claimed1 > 0) {
      claimable0[msg.sender] = 0;
      claimable1[msg.sender] = 0;

      PairFees(fees).claimFeesFor(msg.sender, claimed0, claimed1);

      emit Claim(msg.sender, msg.sender, claimed0, claimed1);
    }
  }

  // Accrue fees on token0
  function _update0(uint amount) internal {
    _safeTransfer(token0, fees, amount); // transfer the fees out to PairFees
    uint256 _ratio = (amount * 1e18) / totalSupply; // 1e18 adjustment is removed during claim
    if (_ratio > 0) {
      index0 += _ratio;
    }
    emit Fees(msg.sender, amount, 0);
  }

  // Accrue fees on token1
  function _update1(uint amount) internal {
    _safeTransfer(token1, fees, amount);
    uint256 _ratio = (amount * 1e18) / totalSupply;
    if (_ratio > 0) {
      index1 += _ratio;
    }
    emit Fees(msg.sender, 0, amount);
  }

  // this function MUST be called on any balance changes, otherwise can be used to infinitely claim fees
  // Fees are segregated from core funds, so fees can never put liquidity at risk
  function _updateFor(address recipient) internal {
    uint _supplied = balanceOf[recipient]; // get LP balance of `recipient`
    if (_supplied > 0) {
      uint _supplyIndex0 = supplyIndex0[recipient]; // get last adjusted index0 for recipient
      uint _supplyIndex1 = supplyIndex1[recipient];
      uint _index0 = index0; // get global index0 for accumulated fees
      uint _index1 = index1;
      supplyIndex0[recipient] = _index0; // update user current position to global position
      supplyIndex1[recipient] = _index1;
      uint _delta0 = _index0 - _supplyIndex0; // see if there is any difference that need to be accrued
      uint _delta1 = _index1 - _supplyIndex1;
      if (_delta0 > 0) {
        uint _share = (_supplied * _delta0) / 1e18; // add accrued difference for each supplied token
        claimable0[recipient] += _share;
      }
      if (_delta1 > 0) {
        uint _share = (_supplied * _delta1) / 1e18;
        claimable1[recipient] += _share;
      }
    } else {
      supplyIndex0[recipient] = index0; // new users are set to the default global state
      supplyIndex1[recipient] = index1;
    }
  }

  function getReserves()
    public
    view
    returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast)
  {
    _reserve0 = reserve0;
    _reserve1 = reserve1;
    _blockTimestampLast = blockTimestampLast;
  }

  // update reserves and, on the first call per block, price accumulators
  function _update(
    uint balance0,
    uint balance1,
    uint _reserve0,
    uint _reserve1
  ) internal {
    uint blockTimestamp = block.timestamp;
    uint timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
    if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
      reserve0CumulativeLast += _reserve0 * timeElapsed;
      reserve1CumulativeLast += _reserve1 * timeElapsed;
    }

    Observation memory _point = lastObservation();
    timeElapsed = blockTimestamp - _point.timestamp; // compare the last observation with current timestamp, if greater than 30 minutes, record a new event
    if (timeElapsed > periodSize) {
      observations.push(
        Observation(
          blockTimestamp,
          reserve0CumulativeLast,
          reserve1CumulativeLast
        )
      );
    }
    reserve0 = balance0;
    reserve1 = balance1;
    blockTimestampLast = blockTimestamp;
    emit Sync(reserve0, reserve1);
  }

  // produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
  function currentCumulativePrices()
    public
    view
    returns (
      uint reserve0Cumulative,
      uint reserve1Cumulative,
      uint blockTimestamp
    )
  {
    blockTimestamp = block.timestamp;
    reserve0Cumulative = reserve0CumulativeLast;
    reserve1Cumulative = reserve1CumulativeLast;

    // if time has elapsed since the last update on the pair, mock the accumulated price values
    (uint _reserve0, uint _reserve1, uint _blockTimestampLast) = getReserves();
    if (_blockTimestampLast != blockTimestamp) {
      // subtraction overflow is desired
      uint timeElapsed = blockTimestamp - _blockTimestampLast;
      reserve0Cumulative += _reserve0 * timeElapsed;
      reserve1Cumulative += _reserve1 * timeElapsed;
    }
  }

  // gives the current twap price measured from amountIn * tokenIn gives amountOut
  function current(
    address tokenIn,
    uint amountIn
  ) external view returns (uint amountOut) {
    Observation memory _observation = lastObservation();
    (
      uint reserve0Cumulative,
      uint reserve1Cumulative,

    ) = currentCumulativePrices();
    if (block.timestamp == _observation.timestamp) {
      _observation = observations[observations.length - 2];
    }

    uint timeElapsed = block.timestamp - _observation.timestamp;
    uint _reserve0 = (reserve0Cumulative - _observation.reserve0Cumulative) /
      timeElapsed;
    uint _reserve1 = (reserve1Cumulative - _observation.reserve1Cumulative) /
      timeElapsed;
    amountOut = _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
  }

  // as per `current`, however allows user configured granularity, up to the full window size
  function quote(
    address tokenIn,
    uint amountIn,
    uint granularity
  ) external view returns (uint amountOut) {
    uint[] memory _prices = sample(tokenIn, amountIn, granularity, 1);
    uint priceAverageCumulative;
    for (uint i = 0; i < _prices.length; i++) {
      priceAverageCumulative += _prices[i];
    }
    return priceAverageCumulative / granularity;
  }

  // returns a memory set of twap prices
  function prices(
    address tokenIn,
    uint amountIn,
    uint points
  ) external view returns (uint[] memory) {
    return sample(tokenIn, amountIn, points, 1);
  }

  function sample(
    address tokenIn,
    uint amountIn,
    uint points,
    uint window
  ) public view returns (uint[] memory) {
    uint[] memory _prices = new uint[](points);

    uint length = observations.length - 1;
    uint i = length - (points * window);
    uint nextIndex = 0;
    uint index = 0;

    for (; i < length; i += window) {
      nextIndex = i + window;
      uint timeElapsed = observations[nextIndex].timestamp -
        observations[i].timestamp;
      uint _reserve0 = (observations[nextIndex].reserve0Cumulative -
        observations[i].reserve0Cumulative) / timeElapsed;
      uint _reserve1 = (observations[nextIndex].reserve1Cumulative -
        observations[i].reserve1Cumulative) / timeElapsed;
      _prices[index] = _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
      // index < length; length cannot overflow
      unchecked {
        index = index + 1;
      }
    }
    return _prices;
  }

  // this low-level function should be called by addLiquidity functions in Router.sol, which performs important safety checks
  // standard uniswap v2 implementation
  function mint(address to) external lock returns (uint liquidity) {
    (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
    uint _balance0 = IERC20(token0).balanceOf(address(this));
    uint _balance1 = IERC20(token1).balanceOf(address(this));
    uint _amount0 = _balance0 - _reserve0;
    uint _amount1 = _balance1 - _reserve1;

    uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
    if (_totalSupply == 0) {
      liquidity = Math.sqrt(_amount0 * _amount1) - MINIMUM_LIQUIDITY;
      _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
    } else {
      liquidity = Math.min(
        (_amount0 * _totalSupply) / _reserve0,
        (_amount1 * _totalSupply) / _reserve1
      );
    }
    require(liquidity > 0, "ILM"); // Pair: INSUFFICIENT_LIQUIDITY_MINTED
    _mint(to, liquidity);

    _update(_balance0, _balance1, _reserve0, _reserve1);
    emit Mint(msg.sender, _amount0, _amount1);
  }

  // this low-level function should be called from a contract which performs important safety checks
  // standard uniswap v2 implementation
  function burn(address to) external lock returns (uint amount0, uint amount1) {
    (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
    (address _token0, address _token1) = (token0, token1);
    uint _balance0 = IERC20(_token0).balanceOf(address(this));
    uint _balance1 = IERC20(_token1).balanceOf(address(this));
    uint _liquidity = balanceOf[address(this)];

    uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
    amount0 = (_liquidity * _balance0) / _totalSupply; // using balances ensures pro-rata distribution
    amount1 = (_liquidity * _balance1) / _totalSupply; // using balances ensures pro-rata distribution
    require(amount0 > 0 && amount1 > 0, "ILB"); // Pair: INSUFFICIENT_LIQUIDITY_BURNED
    _burn(address(this), _liquidity);
    _safeTransfer(_token0, to, amount0);
    _safeTransfer(_token1, to, amount1);
    _balance0 = IERC20(_token0).balanceOf(address(this));
    _balance1 = IERC20(_token1).balanceOf(address(this));

    _update(_balance0, _balance1, _reserve0, _reserve1);
    emit Burn(msg.sender, amount0, amount1, to);
  }

  // this low-level function should be called from a contract which performs important safety checks
  function swap(
    uint amount0Out,
    uint amount1Out,
    address to,
    bytes calldata data
  ) external lock {
    require(!PairFactory(factory).isPaused());
    require(amount0Out > 0 || amount1Out > 0, "IOA"); // Pair: INSUFFICIENT_OUTPUT_AMOUNT
    (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
    require(amount0Out < _reserve0 && amount1Out < _reserve1, "IL"); // Pair: INSUFFICIENT_LIQUIDITY

    uint _balance0;
    uint _balance1;
    {
      // scope for _token{0,1}, avoids stack too deep errors
      (address _token0, address _token1) = (token0, token1);
      require(to != _token0 && to != _token1, "IT"); // Pair: INVALID_TO
      if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
      if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
      if (data.length > 0)
        IPairCallee(to).hook(msg.sender, amount0Out, amount1Out, data); // callback, used for flash loans
      _balance0 = IERC20(_token0).balanceOf(address(this));
      _balance1 = IERC20(_token1).balanceOf(address(this));
    }
    uint amount0In = _balance0 > _reserve0 - amount0Out
      ? _balance0 - (_reserve0 - amount0Out)
      : 0;
    uint amount1In = _balance1 > _reserve1 - amount1Out
      ? _balance1 - (_reserve1 - amount1Out)
      : 0;
    require(amount0In > 0 || amount1In > 0, "IIA"); // Pair: INSUFFICIENT_INPUT_AMOUNT
    {
      // scope for reserve{0,1}Adjusted, avoids stack too deep errors
      (address _token0, address _token1) = (token0, token1);
      if (amount0In > 0)
        _update0(
          (amount0In * PairFactory(factory).getFee(address(this), stable)) /
            10000
        ); // accrue fees for token0 and move them out of pool
      if (amount1In > 0)
        _update1(
          (amount1In * PairFactory(factory).getFee(address(this), stable)) /
            10000
        ); // accrue fees for token1 and move them out of pool
      _balance0 = IERC20(_token0).balanceOf(address(this)); // since we removed tokens, we need to reconfirm balances, can also simply use previous balance - amountIn/ 10000, but doing balanceOf again as safety check
      _balance1 = IERC20(_token1).balanceOf(address(this));
      // The curve, either x3y+y3x for stable pools, or x*y for volatile pools
      require(_k(_balance0, _balance1) >= _k(_reserve0, _reserve1), "K"); // Pair: K
    }

    _update(_balance0, _balance1, _reserve0, _reserve1);
    emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
  }

  // force balances to match reserves
  function skim(address to) external lock {
    (address _token0, address _token1) = (token0, token1);
    _safeTransfer(
      _token0,
      to,
      IERC20(_token0).balanceOf(address(this)) - (reserve0)
    );
    _safeTransfer(
      _token1,
      to,
      IERC20(_token1).balanceOf(address(this)) - (reserve1)
    );
  }

  // force reserves to match balances
  function sync() external lock {
    _update(
      IERC20(token0).balanceOf(address(this)),
      IERC20(token1).balanceOf(address(this)),
      reserve0,
      reserve1
    );
  }

  function _f(uint x0, uint y) internal pure returns (uint) {
    return
      (x0 * ((((y * y) / 1e18) * y) / 1e18)) /
      1e18 +
      (((((x0 * x0) / 1e18) * x0) / 1e18) * y) /
      1e18;
  }

  function _d(uint x0, uint y) internal pure returns (uint) {
    return
      (3 * x0 * ((y * y) / 1e18)) / 1e18 + ((((x0 * x0) / 1e18) * x0) / 1e18);
  }

  function _get_y(uint x0, uint xy, uint y) internal pure returns (uint) {
    for (uint i = 0; i < 255; i++) {
      uint y_prev = y;
      uint k = _f(x0, y);
      if (k < xy) {
        uint dy = ((xy - k) * 1e18) / _d(x0, y);
        y = y + dy;
      } else {
        uint dy = ((k - xy) * 1e18) / _d(x0, y);
        y = y - dy;
      }
      if (y > y_prev) {
        if (y - y_prev <= 1) {
          return y;
        }
      } else {
        if (y_prev - y <= 1) {
          return y;
        }
      }
    }
    return y;
  }

  function getAmountOut(
    uint amountIn,
    address tokenIn
  ) external view returns (uint) {
    (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
    amountIn -=
      (amountIn * PairFactory(factory).getFee(address(this), stable)) /
      10000; // remove fee from amount received
    return _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
  }

  function _getAmountOut(
    uint amountIn,
    address tokenIn,
    uint _reserve0,
    uint _reserve1
  ) internal view returns (uint) {
    if (stable) {
      uint xy = _k(_reserve0, _reserve1);
      _reserve0 = (_reserve0 * 1e18) / decimals0;
      _reserve1 = (_reserve1 * 1e18) / decimals1;
      (uint reserveA, uint reserveB) = tokenIn == token0
        ? (_reserve0, _reserve1)
        : (_reserve1, _reserve0);
      amountIn = tokenIn == token0
        ? (amountIn * 1e18) / decimals0
        : (amountIn * 1e18) / decimals1;
      uint y = reserveB - _get_y(amountIn + reserveA, xy, reserveB);
      return (y * (tokenIn == token0 ? decimals1 : decimals0)) / 1e18;
    } else {
      (uint reserveA, uint reserveB) = tokenIn == token0
        ? (_reserve0, _reserve1)
        : (_reserve1, _reserve0);
      return (amountIn * reserveB) / (reserveA + amountIn);
    }
  }

  function _k(uint x, uint y) internal view returns (uint) {
    if (stable) {
      uint _x = (x * 1e18) / decimals0;
      uint _y = (y * 1e18) / decimals1;
      uint _a = (_x * _y) / 1e18;
      uint _b = ((_x * _x) / 1e18 + (_y * _y) / 1e18);
      return (_a * _b) / 1e18; // x3y+y3x >= k
    } else {
      return x * y; // xy >= k
    }
  }

  function _mint(address dst, uint amount) internal {
    _updateFor(dst); // balances must be updated on mint/burn/transfer
    totalSupply += amount;
    balanceOf[dst] += amount;
    emit Transfer(address(0), dst, amount);
  }

  function _burn(address dst, uint amount) internal {
    _updateFor(dst);
    totalSupply -= amount;
    balanceOf[dst] -= amount;
    emit Transfer(dst, address(0), amount);
  }

  function approve(address spender, uint amount) external returns (bool) {
    allowance[msg.sender][spender] = amount;

    emit Approval(msg.sender, spender, amount);
    return true;
  }

  function permit(
    address owner,
    address spender,
    uint value,
    uint deadline,
    // uint8 v,
    // bytes32 r,
    // bytes32 s
    bytes calldata signature
  ) external {
    require(deadline >= block.timestamp, "Pair: EXPIRED");
    DOMAIN_SEPARATOR = keccak256(
      abi.encode(
        keccak256(
          "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        ),
        keccak256(bytes(name)),
        keccak256(bytes("1")),
        block.chainid,
        address(this)
      )
    );
    bytes32 digest = keccak256(
      abi.encodePacked(
        "\x19\x01",
        DOMAIN_SEPARATOR,
        keccak256(
          abi.encode(
            PERMIT_TYPEHASH,
            owner,
            spender,
            value,
            nonces[owner]++,
            deadline
          )
        )
      )
    );
    // address recoveredAddress = ecrecover(digest, v, r, s);
    // require(
    //   recoveredAddress != address(0) && recoveredAddress == owner,
    //   "Pair: INVALID_SIGNATURE"
    // );
    require(
      SignatureChecker.isValidSignatureNow(owner, digest, signature),
      "S"
    );
    allowance[owner][spender] = value;

    emit Approval(owner, spender, value);
  }

  function transfer(address dst, uint amount) external returns (bool) {
    _transferTokens(msg.sender, dst, amount);
    return true;
  }

  function transferFrom(
    address src,
    address dst,
    uint amount
  ) external returns (bool) {
    address spender = msg.sender;
    uint spenderAllowance = allowance[src][spender];

    if (spender != src && spenderAllowance != type(uint).max) {
      uint newAllowance = spenderAllowance - amount;
      allowance[src][spender] = newAllowance;

      emit Approval(src, spender, newAllowance);
    }

    _transferTokens(src, dst, amount);
    return true;
  }

  function _transferTokens(address src, address dst, uint amount) internal {
    _updateFor(src); // update fee position for src
    _updateFor(dst); // update fee position for dst

    balanceOf[src] -= amount;
    balanceOf[dst] += amount;

    emit Transfer(src, dst, amount);
  }

  function _safeTransfer(address token, address to, uint256 value) internal {
    require(token.code.length > 0);
    (bool success, bytes memory data) = token.call(
      abi.encodeWithSelector(IERC20.transfer.selector, to, value)
    );
    require(success && (data.length == 0 || abi.decode(data, (bool))));
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 6 of 13 : SignatureChecker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/SignatureChecker.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";
import "../Address.sol";
import "../../interfaces/IERC1271.sol";

/**
 * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
 * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
 * Argent and Gnosis Safe.
 *
 * _Available since v4.1._
 */
library SignatureChecker {
    /**
     * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
     * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
     *
     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
     * change through time. It could return true at block N and false at block N+1 (or the opposite).
     */
    function isValidSignatureNow(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal view returns (bool) {
        (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);
        if (error == ECDSA.RecoverError.NoError && recovered == signer) {
            return true;
        }

        (bool success, bytes memory result) = signer.staticcall(
            abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
        );
        return (success &&
            result.length == 32 &&
            abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import "contracts/interfaces/IERC20.sol";

// Pair Fees contract is used as a 1:1 pair relationship to split out fees, this ensures that the curve does not need to be modified for LP shares
contract PairFees {
  address internal immutable pair; // The pair it is bonded to
  address internal immutable token0; // token0 of pair, saved localy and statically for gas optimization
  address internal immutable token1; // Token1 of pair, saved localy and statically for gas optimization

  constructor(address _token0, address _token1) {
    pair = msg.sender;
    token0 = _token0;
    token1 = _token1;
  }

  function _safeTransfer(address token, address to, uint256 value) internal {
    require(token.code.length > 0);
    (bool success, bytes memory data) = token.call(
      abi.encodeWithSelector(IERC20.transfer.selector, to, value)
    );
    require(success && (data.length == 0 || abi.decode(data, (bool))));
  }

  // Allow the pair to transfer fees to users
  function claimFeesFor(
    address recipient,
    uint amount0,
    uint amount1
  ) external {
    require(msg.sender == pair);
    if (amount0 > 0) _safeTransfer(token0, recipient, amount0);
    if (amount1 > 0) _safeTransfer(token1, recipient, amount1);
  }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import "contracts/interfaces/IPairFactory.sol";
import "contracts/Pair.sol";

contract PairFactory is IPairFactory {
  bool public isPaused;
  address public pauser;
  address public pendingPauser;

  uint256 public stableFee;
  uint256 public volatileFee;
  uint256 public constant MAX_FEE = 300; // 3%
  // Override to indicate there is custom 0% fee - as a 0 value in the customFee mapping indicates
  // that no custom fee rate has been set
  uint256 public constant ZERO_FEE_INDICATOR = 420;

  address public feeManager;
  address public pendingFeeManager;

  mapping(address => mapping(address => mapping(bool => address)))
    public getPair;
  address[] public allPairs;
  mapping(address => bool) public is3pool;
  mapping(address => bool) public isPair; // simplified check if its a pair, given that `stable` flag might not be available in peripherals
  mapping(address => uint256) public customFee; // override for custom fees

  address internal _temp0;
  address internal _temp1;
  bool internal _temp;

  event PairCreated(
    address indexed token0,
    address indexed token1,
    bool stable,
    address pair,
    uint
  );

  constructor() {
    pauser = msg.sender;
    isPaused = false;
    feeManager = msg.sender;
    stableFee = 4; // 0.04%
    volatileFee = 30;
  }

  function allPairsLength() external view returns (uint) {
    return allPairs.length;
  }

  function getPairByIndex(uint idx) external view returns (address) {
    return allPairs[idx];
  }

  /// normal pools + 3pools

  function setPauser(address _pauser) external {
    require(msg.sender == pauser);
    pendingPauser = _pauser;
  }

  function acceptPauser() external {
    require(msg.sender == pendingPauser);
    pauser = pendingPauser;
  }

  function setPause(bool _state) external {
    require(msg.sender == pauser);
    isPaused = _state;
  }

  function setFeeManager(address _feeManager) external {
    require(msg.sender == feeManager, "not fee manager");
    pendingFeeManager = _feeManager;
  }

  function acceptFeeManager() external {
    require(msg.sender == pendingFeeManager, "not pending fee manager");
    feeManager = pendingFeeManager;
  }

  function setFee(bool _stable, uint256 _fee) external {
    require(msg.sender == feeManager, "not fee manager");
    require(_fee <= MAX_FEE, "fee too high");
    require(_fee != 0, "fee must be nonzero");
    if (_stable) {
      stableFee = _fee;
    } else {
      volatileFee = _fee;
    }
  }

  function setCustomFee(address pool, uint256 fee) external {
    require(msg.sender == feeManager, "not fee manager");
    if (fee > MAX_FEE && fee != ZERO_FEE_INDICATOR) revert();
    require(isPair[pool], "invalid pool");

    customFee[pool] = fee;
  }

  function getFee(address pool, bool _stable) public view returns (uint256) {
    uint fee = customFee[pool];
    return
      fee == ZERO_FEE_INDICATOR ? 0 : fee != 0 ? fee : _stable
        ? stableFee
        : volatileFee;
  }
  
  function getFee(address pool) external view returns (uint256) {
    return getFee(pool, is3pool[pool] || Pair(pool).stable());
  }

  function pairCodeHash() external pure returns (bytes32) {
    return keccak256(type(Pair).creationCode);
  }

  function getInitializable() external view returns (address, address, bool) {
    return (_temp0, _temp1, _temp);
  }

  function create3Pool(address _3pool) external {
    require(msg.sender == pauser);
    allPairs.push(_3pool);
    isPair[_3pool] = true;
    is3pool[_3pool] = true;
  }

  function createPair(
    address tokenA,
    address tokenB,
    bool stable
  ) external returns (address pair) {
    require(tokenA != tokenB, "IA"); // Pair: IDENTICAL_ADDRESSES
    (address token0, address token1) = tokenA < tokenB
      ? (tokenA, tokenB)
      : (tokenB, tokenA);
    require(token0 != address(0), "ZA"); // Pair: ZERO_ADDRESS
    require(getPair[token0][token1][stable] == address(0), "PE"); // Pair: PAIR_EXISTS - single check is sufficient
    bytes32 salt = keccak256(abi.encodePacked(token0, token1, stable)); // notice salt includes stable as well, 3 parameters
    (_temp0, _temp1, _temp) = (token0, token1, stable);
    pair = address(new Pair{ salt: salt }());
    getPair[token0][token1][stable] = pair;
    getPair[token1][token0][stable] = pair; // populate mapping in the reverse direction
    allPairs.push(pair);
    isPair[pair] = true;
    is3pool[pair] = false;
    emit PairCreated(token0, token1, stable, pair, allPairs.length);
  }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IERC20 {
  function totalSupply() external view returns (uint256);

  function transfer(address recipient, uint amount) external returns (bool);

  function decimals() external view returns (uint8);

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

  function balanceOf(address) external view returns (uint);

  function transferFrom(
    address sender,
    address recipient,
    uint amount
  ) external returns (bool);

  function allowance(
    address owner,
    address spender
  ) external view returns (uint);

  function approve(address spender, uint value) external returns (bool);

  event Transfer(address indexed from, address indexed to, uint value);
  event Approval(address indexed owner, address indexed spender, uint value);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPair {
  function metadata()
    external
    view
    returns (
      uint dec0,
      uint dec1,
      uint r0,
      uint r1,
      bool st,
      address t0,
      address t1
    );

  function claimFees() external returns (uint, uint);

  function tokens() external returns (address, address);

  function transferFrom(
    address src,
    address dst,
    uint amount
  ) external returns (bool);

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

  function swap(
    uint amount0Out,
    uint amount1Out,
    address to,
    bytes calldata data
  ) external;

  function burn(address to) external returns (uint amount0, uint amount1);

  function mint(address to) external returns (uint liquidity);

  function getReserves()
    external
    view
    returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast);

  function getAmountOut(uint, address) external view returns (uint);

  function current(
    address tokenIn,
    uint amountIn
  ) external view returns (uint amountOut);
}

File 12 of 13 : IPairCallee.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPairCallee {
  function hook(
    address sender,
    uint amount0,
    uint amount1,
    bytes calldata data
  ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPairFactory {
  function allPairsLength() external view returns (uint);

  function getPairByIndex(uint idx) external view returns (address);

  function isPair(address pair) external view returns (bool);

  function is3pool(address pair) external view returns (bool);

  function pairCodeHash() external pure returns (bytes32);

  function getPair(
    address tokenA,
    address token,
    bool stable
  ) external view returns (address);

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

Settings
{
  "libraries": {},
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Fees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserve0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reserve1","type":"uint256"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockTimestampLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimFees","outputs":[{"internalType":"uint256","name":"claimed0","type":"uint256"},{"internalType":"uint256","name":"claimed1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimable0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimable1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"current","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentCumulativePrices","outputs":[{"internalType":"uint256","name":"reserve0Cumulative","type":"uint256"},{"internalType":"uint256","name":"reserve1Cumulative","type":"uint256"},{"internalType":"uint256","name":"blockTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fees","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint256","name":"_reserve0","type":"uint256"},{"internalType":"uint256","name":"_reserve1","type":"uint256"},{"internalType":"uint256","name":"_blockTimestampLast","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"index0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"index1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastObservation","outputs":[{"components":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"reserve0Cumulative","type":"uint256"},{"internalType":"uint256","name":"reserve1Cumulative","type":"uint256"}],"internalType":"struct Pair.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadata","outputs":[{"internalType":"uint256","name":"dec0","type":"uint256"},{"internalType":"uint256","name":"dec1","type":"uint256"},{"internalType":"uint256","name":"r0","type":"uint256"},{"internalType":"uint256","name":"r1","type":"uint256"},{"internalType":"bool","name":"st","type":"bool"},{"internalType":"address","name":"t0","type":"address"},{"internalType":"address","name":"t1","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"observationLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"observations","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"reserve0Cumulative","type":"uint256"},{"internalType":"uint256","name":"reserve1Cumulative","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"points","type":"uint256"}],"name":"prices","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"granularity","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserve0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserve0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserve1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserve1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"points","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"name":"sample","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supplyIndex0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supplyIndex1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sync","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":"tokens","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

0x61016060405260006002556000600d556000600e5560016013553480156200002657600080fd5b50336001600160a01b0316610100816001600160a01b0316815250506000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b8152600401606060405180830381865afa15801562000086573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ac9190620007c8565b8015156080526001600160a01b0380831660c052831660a052604051929550909350915083908390620000df90620006f7565b6001600160a01b03928316815291166020820152604001604051809103906000f08015801562000113573d6000803e3d6000fd5b506001600160a01b031660e05280156200034557826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000166573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000190919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001f9919081019062000863565b6040516020016200020c9291906200091b565b604051602081830303815290604052600090805190602001906200023292919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000272573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200029c919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620002db573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000305919081019062000863565b6040516020016200031892919062000976565b604051602081830303815290604052600190805190602001906200033e92919062000705565b506200055e565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000384573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003ae919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620003ed573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000417919081019062000863565b6040516020016200042a929190620009c7565b604051602081830303815290604052600090805190602001906200045092919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000490573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004ba919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620004f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000523919081019062000863565b6040516020016200053692919062000a24565b604051602081830303815290604052600190805190602001906200055c92919062000705565b505b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200059d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005c3919062000a46565b620005d090600a62000b87565b6101208181525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000617573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200063d919062000a46565b6200064a90600a62000b87565b6101405250506040805160608101825242815260006020820181815292820181815260078054600181018255925291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68860039092029182015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555062000bd4565b61037080620046da83390190565b828054620007139062000b98565b90600052602060002090601f01602090048101928262000737576000855562000782565b82601f106200075257805160ff191683800117855562000782565b8280016001018555821562000782579182015b828111156200078257825182559160200191906001019062000765565b506200079092915062000794565b5090565b5b8082111562000790576000815560010162000795565b80516001600160a01b0381168114620007c357600080fd5b919050565b600080600060608486031215620007de57600080fd5b620007e984620007ab565b9250620007f960208501620007ab565b9150604084015180151581146200080f57600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200084d57818101518382015260200162000833565b838111156200085d576000848401525b50505050565b6000602082840312156200087657600080fd5b81516001600160401b03808211156200088e57600080fd5b818401915084601f830112620008a357600080fd5b815181811115620008b857620008b86200081a565b604051601f8201601f19908116603f01168101908382118183101715620008e357620008e36200081a565b81604052828152876020848701011115620008fd57600080fd5b6200091083602083016020880162000830565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200094781600f85016020880162000830565b602f60f81b600f9184019182015283516200096a81601084016020880162000830565b01601001949350505050565b6473414d4d2d60d81b8152600083516200099881600585016020880162000830565b602f60f81b6005918401918201528351620009bb81600684016020880162000830565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b815260008351620009f581601185016020880162000830565b602f60f81b601191840191820152835162000a1881601284016020880162000830565b01601201949350505050565b6476414d4d2d60d81b8152600083516200099881600585016020880162000830565b60006020828403121562000a5957600080fd5b815160ff8116811462000a6b57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000ac957816000190482111562000aad5762000aad62000a72565b8085161562000abb57918102915b93841c939080029062000a8d565b509250929050565b60008262000ae25750600162000b81565b8162000af15750600062000b81565b816001811462000b0a576002811462000b155762000b35565b600191505062000b81565b60ff84111562000b295762000b2962000a72565b50506001821b62000b81565b5060208310610133831016604e8410600b841016171562000b5a575081810a62000b81565b62000b66838362000a88565b806000190482111562000b7d5762000b7d62000a72565b0290505b92915050565b600062000a6b60ff84168362000ad1565b600181811c9082168062000bad57607f821691505b60208210810362000bce57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161398562000d5560003960008181610431015281816124e3015281816127cd0152818161288f015261299a01526000818161040e015281816124a20152818161278e015281816128d101526129740152600081816107b801528181610c0d01528181610ce401526120120152600081816105f201528181611f280152818161230901526123d60152600081816104bb0152818161064701528181610727015281816108f301528181610b9b0152818161151b0152818161170601528181611dcf0152818161216f01526123b50152600081816102f90152818161049301528181610622015281816108d201528181610b7a01528181611485015281816116e401528181611dad015281816120e7015281816122e80152818161280f015281816128560152818161293b01526129de0152600081816103970152818161046301528181610bd501528181610cac01528181611fe10152818161247a015261275a01526139856000f3fe608060405234801561001057600080fd5b50600436106102745760003560e01c80637ecebe0011610151578063bc25cf77116100c3578063d21220a711610087578063d21220a714610722578063d294f09314610749578063dd62ed3e14610751578063ebeb31db1461077c578063f140a35a14610784578063fff6cae91461079757600080fd5b8063bc25cf77146106eb578063bda39cad146106fe578063bf944dbc14610707578063c245febc14610710578063c5700a021461071957600080fd5b80639d63848a116101155780639d63848a146106145780639e8cc04b146106725780639f767c88146106855780639fd5a6cf146106a5578063a1ac4d13146106b8578063a9059cbb146106d857600080fd5b80637ecebe001461057357806389afcb44146105935780638a7b8cf2146105bb57806395d89b41146105e55780639af1d35a146105ed57600080fd5b8063252c09d7116101ea5780634d5a9f8a116101ae5780634d5a9f8a146104f1578063517b3f82146105115780635881c475146105245780635a76f25e146105375780636a6278421461054057806370a082311461055357600080fd5b8063252c09d7146103cc578063313ce567146103df57806332c0defd146103f9578063392f37e914610402578063443cb4bc146104e857600080fd5b806313345fe11161023c57806313345fe11461033357806318160ddd146103535780631df8c7171461036a578063205aabf11461037257806322be3de11461039257806323b872dd146103b957600080fd5b8063022c0d9f1461027957806306fdde031461028e5780630902f1ac146102ac578063095ea7b3146102d15780630dfe1681146102f4575b600080fd5b61028c6102873660046133d8565b61079f565b005b610296610ef8565b6040516102a3919061349c565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102a3565b6102e46102df3660046134af565b610f86565b60405190151581526020016102a3565b61031b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102a3565b6103466103413660046134d9565b610ff3565b6040516102a39190613512565b61035c60025481565b6040519081526020016102a3565b6102b66111ef565b61035c610380366004613556565b60106020526000908152604090205481565b6102e47f000000000000000000000000000000000000000000000000000000000000000081565b6102e46103c7366004613571565b61125e565b6102b66103da3660046135ad565b611327565b6103e7601281565b60405160ff90911681526020016102a3565b61035c600d5481565b600854600954604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e0016102a3565b61035c60085481565b61035c6104ff366004613556565b60116020526000908152604090205481565b61035c61051f3660046134af565b61135a565b6103466105323660046135c6565b611442565b61035c60095481565b61035c61054e366004613556565b611451565b61035c610561366004613556565b60046020526000908152604090205481565b61035c610581366004613556565b60066020526000908152604090205481565b6105a66105a1366004613556565b6116b2565b604080519283526020830191909152016102a3565b6105c36119cf565b60408051825181526020808401519082015291810151908201526060016102a3565b610296611a4f565b61031b7f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000166020820152016102a3565b61035c6106803660046135c6565b611a5c565b61035c610693366004613556565b600f6020526000908152604090205481565b61028c6106b33660046135f9565b611ac9565b61035c6106c6366004613556565b60126020526000908152604090205481565b6102e46106e63660046134af565b611d6b565b61028c6106f9366004613556565b611d81565b61035c600e5481565b61035c600b5481565b61035c600c5481565b61035c600a5481565b61031b7f000000000000000000000000000000000000000000000000000000000000000081565b6105a6611e9f565b61035c61075f366004613671565b600360209081526000928352604080842090915290825290205481565b60075461035c565b61035c6107923660046136a4565b611fc6565b61028c6120ba565b6013546001146107ae57600080fd5b60026013819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083891906136c7565b1561084257600080fd5b60008511806108515750600084115b6108885760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600854600954818710801561089c57508086105b6108cd5760405162461bcd60e51b8152602060048201526002602482015261125360f21b604482015260640161087f565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906109405750806001600160a01b0316896001600160a01b031614155b6109715760405162461bcd60e51b8152602060048201526002602482015261125560f21b604482015260640161087f565b8a1561098257610982828a8d6121f4565b891561099357610993818a8c6121f4565b8615610a0057604051639a7bff7960e01b81526001600160a01b038a1690639a7bff79906109cd9033908f908f908e908e906004016136e9565b600060405180830381600087803b1580156109e757600080fd5b505af11580156109fb573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a689190613735565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190613735565b9250505060008985610ae59190613764565b8311610af2576000610b06565b610afc8a86613764565b610b069084613764565b90506000610b148a86613764565b8311610b21576000610b35565b610b2b8a86613764565b610b359084613764565b90506000821180610b465750600081115b610b785760405162461bcd60e51b815260206004820152600360248201526249494160e81b604482015260640161087f565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008315610c915760405163cc56b2c560e01b81523060048201527f000000000000000000000000000000000000000000000000000000000000000015156024820152610c9190612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cc56b2c590604401602060405180830381865afa158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c789190613735565b610c82908761377b565b610c8c91906137b0565b6122e3565b8215610d685760405163cc56b2c560e01b81523060048201527f000000000000000000000000000000000000000000000000000000000000000015156024820152610d6890612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cc56b2c590604401602060405180830381865afa158015610d2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4f9190613735565b610d59908661377b565b610d6391906137b0565b6123b0565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd09190613735565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b9190613735565b9450610e478888612476565b610e518787612476565b1015610e835760405162461bcd60e51b81526020600482015260016024820152604b60f81b604482015260640161087f565b5050610e91848488886125c2565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610f05906137d2565b80601f0160208091040260200160405190810160405280929190818152602001828054610f31906137d2565b8015610f7e5780601f10610f5357610100808354040283529160200191610f7e565b820191906000526020600020905b815481529060010190602001808311610f6157829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610fe19086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff8111156110105761101061380c565b604051908082528060200260200182016040528015611039578160200160208202803683370190505b5060075490915060009061104f90600190613764565b9050600061105d858761377b565b6110679083613764565b90506000805b838310156111df5761107f8784613822565b91506000600784815481106110965761109661383a565b906000526020600020906003020160000154600784815481106110bb576110bb61383a565b9060005260206000209060030201600001546110d79190613764565b9050600081600786815481106110ef576110ef61383a565b906000526020600020906003020160010154600786815481106111145761111461383a565b9060005260206000209060030201600101546111309190613764565b61113a91906137b0565b9050600082600787815481106111525761115261383a565b906000526020600020906003020160020154600787815481106111775761117761383a565b9060005260206000209060030201600201546111939190613764565b61119d91906137b0565b90506111ab8c8e8484612756565b8885815181106111bd576111bd61383a565b60209081029190910101525050506001016111d88784613822565b925061106d565b509293505050505b949350505050565b600b54600c54426000808061120d600854600954600a549192909190565b9250925092508381146112565760006112268286613764565b9050611232818561377b565b61123c9088613822565b9650611248818461377b565b6112529087613822565b9550505b505050909192565b6001600160a01b03831660008181526003602090815260408083203380855292528220549192909190821480159061129857506000198114155b1561130e5760006112a98583613764565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b611319868686612a4b565b6001925050505b9392505050565b6007818154811061133757600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000806113656119cf565b90506000806113726111ef565b508451919350915042036113da576007805461139090600290613764565b815481106113a0576113a061383a565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b82516000906113e99042613764565b90506000818560200151856113fe9190613764565b61140891906137b0565b905060008286604001518561141d9190613764565b61142791906137b0565b9050611435888a8484612756565b9998505050505050505050565b60606111e78484846001610ff3565b600060135460011461146257600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156114d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f89190613735565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611562573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115869190613735565b905060006115948584613764565b905060006115a28584613764565b60025490915060008190036115e4576103e86115c66115c1848661377b565b612b0b565b6115d09190613764565b97506115df60006103e8612bf3565b611619565b611616876115f2838661377b565b6115fc91906137b0565b87611607848661377b565b61161191906137b0565b612c86565b97505b6000881161164f5760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b604482015260640161087f565b6116598989612bf3565b611665858589896125c2565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b6000806013546001146116c457600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561175a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177e9190613735565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ec9190613735565b30600090815260046020526040902054600254919250908061180e858461377b565b61181891906137b0565b995080611825848461377b565b61182f91906137b0565b985060008a1180156118415750600089115b6118735760405162461bcd60e51b815260206004820152600360248201526224a62160e91b604482015260640161087f565b61187d3083612c9c565b611888868c8c6121f4565b611893858c8b6121f4565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190613735565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa158015611942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119669190613735565b925061197484848a8a6125c2565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b6119f360405180606001604052806000815260200160008152602001600081525090565b60078054611a0390600190613764565b81548110611a1357611a1361383a565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610f05906137d2565b600080611a6c8585856001610ff3565b90506000805b8251811015611ab457828181518110611a8d57611a8d61383a565b602002602001015182611aa09190613822565b915080611aac81613850565b915050611a72565b50611abf84826137b0565b9695505050505050565b42831015611b095760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b604482015260640161087f565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611b399190613869565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b0389166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a919087611c0483613850565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120604051602001611c7d92919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050611cd6878285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d2792505050565b611d065760405162461bcd60e51b81526020600482015260016024820152605360f81b604482015260640161087f565b6001600160a01b038781166000818152600360209081526040808320948b168084529482529182902089905590518881527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b6000611d78338484612a4b565b50600192915050565b601354600114611d9057600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611e5d9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611e2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4e9190613735565b611e589190613764565b6121f4565b6009546040516370a0823160e01b8152306004820152611e959183918691906001600160a01b038416906370a0823190602401611e0d565b5050600160135550565b600080611eab33612e69565b50503360009081526011602090815260408083205460129092529091205481151580611ed75750600081115b15611fc2573360008181526011602090815260408083208390556012909152808220919091555163299e7ae760e11b8152600481019190915260248101839052604481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063533cf5ce90606401600060405180830381600087803b158015611f6c57600080fd5b505af1158015611f80573d6000803e3d6000fd5b505060408051858152602081018590523393508392507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b9091565b60085460095460405163cc56b2c560e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000151560248201526000929190612710907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063cc56b2c590604401602060405180830381865afa158015612061573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120859190613735565b61208f908761377b565b61209991906137b0565b6120a39086613764565b94506120b185858484612756565b95945050505050565b6013546001146120c957600080fd5b60026013556040516370a0823160e01b81523060048201526121ed907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612136573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215a9190613735565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156121be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e29190613735565b6008546009546125c2565b6001601355565b6000836001600160a01b03163b1161220b57600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916122679190613904565b6000604051808303816000865af19150503d80600081146122a4576040519150601f19603f3d011682016040523d82523d6000602084013e6122a9565b606091505b50915091508180156122d35750805115806122d35750808060200190518101906122d391906136c7565b6122dc57600080fd5b5050505050565b61232e7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000836121f4565b60025460009061234683670de0b6b3a764000061377b565b61235091906137b0565b905080156123705780600d600082825461236a9190613822565b90915550505b604080518381526000602082015233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291015b60405180910390a25050565b6123fb7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000836121f4565b60025460009061241383670de0b6b3a764000061377b565b61241d91906137b0565b9050801561243d5780600e60008282546124379190613822565b90915550505b60408051600081526020810184905233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291016123a4565b60007f0000000000000000000000000000000000000000000000000000000000000000156125b15760007f00000000000000000000000000000000000000000000000000000000000000006124d385670de0b6b3a764000061377b565b6124dd91906137b0565b905060007f000000000000000000000000000000000000000000000000000000000000000061251485670de0b6b3a764000061377b565b61251e91906137b0565b90506000670de0b6b3a7640000612535838561377b565b61253f91906137b0565b90506000670de0b6b3a7640000612556848061377b565b61256091906137b0565b670de0b6b3a7640000612573868061377b565b61257d91906137b0565b6125879190613822565b9050670de0b6b3a764000061259c828461377b565b6125a691906137b0565b945050505050610fed565b6125bb828461377b565b9050610fed565b600a5442906000906125d49083613764565b90506000811180156125e557508315155b80156125f057508215155b15612637576125ff818561377b565b600b60008282546126109190613822565b909155506126209050818461377b565b600c60008282546126319190613822565b90915550505b60006126416119cf565b80519091506126509084613764565b91506107088211156127055760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000156129d957600061278a8484612476565b90507f00000000000000000000000000000000000000000000000000000000000000006127bf85670de0b6b3a764000061377b565b6127c991906137b0565b93507f00000000000000000000000000000000000000000000000000000000000000006127fe84670de0b6b3a764000061377b565b61280891906137b0565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b03161461284d578486612850565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316146128cf577f00000000000000000000000000000000000000000000000000000000000000006128c089670de0b6b3a764000061377b565b6128ca91906137b0565b61290c565b7f000000000000000000000000000000000000000000000000000000000000000061290289670de0b6b3a764000061377b565b61290c91906137b0565b9750600061292461291d848b613822565b8584612fc9565b61292e9083613764565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b031614612998577f00000000000000000000000000000000000000000000000000000000000000006129ba565b7f00000000000000000000000000000000000000000000000000000000000000005b6129c4908361377b565b6129ce91906137b0565b9450505050506111e7565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614612a1c578385612a1f565b84845b9092509050612a2e8783613822565b612a38828961377b565b612a4291906137b0565b925050506111e7565b612a5483612e69565b612a5d82612e69565b6001600160a01b03831660009081526004602052604081208054839290612a85908490613764565b90915550506001600160a01b03821660009081526004602052604081208054839290612ab2908490613822565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612afe91815260200190565b60405180910390a3505050565b600081600003612b1d57506000919050565b60006001612b2a846130d8565b901c6001901b90506001818481612b4357612b4361379a565b048201901c90506001818481612b5b57612b5b61379a565b048201901c90506001818481612b7357612b7361379a565b048201901c90506001818481612b8b57612b8b61379a565b048201901c90506001818481612ba357612ba361379a565b048201901c90506001818481612bbb57612bbb61379a565b048201901c90506001818481612bd357612bd361379a565b048201901c905061132081828581612bed57612bed61379a565b04612c86565b612bfc82612e69565b8060026000828254612c0e9190613822565b90915550506001600160a01b03821660009081526004602052604081208054839290612c3b908490613822565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612c955781611320565b5090919050565b612ca582612e69565b8060026000828254612cb79190613764565b90915550506001600160a01b03821660009081526004602052604081208054839290612ce4908490613764565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612c7a565b6000806000612d36858561316c565b90925090506000816004811115612d4f57612d4f613920565b148015612d6d5750856001600160a01b0316826001600160a01b0316145b15612d7d57600192505050611320565b600080876001600160a01b0316631626ba7e60e01b8888604051602401612da5929190613936565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612de39190613904565b600060405180830381855afa9150503d8060008114612e1e576040519150601f19603f3d011682016040523d82523d6000602084013e612e23565b606091505b5091509150818015612e36575080516020145b8015612e5d57508051630b135d3f60e11b90612e5b9083016020908101908401613735565b145b98975050505050505050565b6001600160a01b0381166000908152600460205260409020548015612f97576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e54948190559490955282905593612ecb8584613764565b90506000612ed98584613764565b90508115612f34576000670de0b6b3a7640000612ef6848a61377b565b612f0091906137b0565b6001600160a01b038a16600090815260116020526040812080549293508392909190612f2d908490613822565b9091555050505b8015612f8d576000670de0b6b3a7640000612f4f838a61377b565b612f5991906137b0565b6001600160a01b038a16600090815260126020526040812080549293508392909190612f86908490613822565b9091555050505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff8110156130cf57826000612fe387836131b1565b905085811015613033576000612ff9888761324e565b6130038389613764565b61301590670de0b6b3a764000061377b565b61301f91906137b0565b905061302b8187613822565b955050613075565b600061303f888761324e565b6130498884613764565b61305b90670de0b6b3a764000061377b565b61306591906137b0565b90506130718187613764565b9550505b8185111561309e5760016130898387613764565b1161309957849350505050611320565b6130ba565b60016130aa8684613764565b116130ba57849350505050611320565b505080806130c790613850565b915050612fcd565b50909392505050565b600080608083901c156130ed57608092831c92015b604083901c156130ff57604092831c92015b602083901c1561311157602092831c92015b601083901c1561312357601092831c92015b600883901c1561313557600892831c92015b600483901c1561314757600492831c92015b600283901c1561315957600292831c92015b600183901c15610fed5760010192915050565b60008082516041036131a25760208301516040840151606085015160001a613196878285856132b6565b945094505050506131aa565b506000905060025b9250929050565b6000670de0b6b3a7640000828185816131ca828061377b565b6131d491906137b0565b6131de919061377b565b6131e891906137b0565b6131f2919061377b565b6131fc91906137b0565b670de0b6b3a7640000808481613212828061377b565b61321c91906137b0565b613226919061377b565b61323091906137b0565b61323a908661377b565b61324491906137b0565b6113209190613822565b6000670de0b6b3a76400008381613265828061377b565b61326f91906137b0565b613279919061377b565b61328391906137b0565b670de0b6b3a764000080613297858061377b565b6132a191906137b0565b6132ac86600361377b565b61323a919061377b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156132ed5750600090506003613371565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613341573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661336a57600060019250925050613371565b9150600090505b94509492505050565b80356001600160a01b038116811461339157600080fd5b919050565b60008083601f8401126133a857600080fd5b50813567ffffffffffffffff8111156133c057600080fd5b6020830191508360208285010111156131aa57600080fd5b6000806000806000608086880312156133f057600080fd5b85359450602086013593506134076040870161337a565b9250606086013567ffffffffffffffff81111561342357600080fd5b61342f88828901613396565b969995985093965092949392505050565b60005b8381101561345b578181015183820152602001613443565b8381111561346a576000848401525b50505050565b60008151808452613488816020860160208601613440565b601f01601f19169290920160200192915050565b6020815260006113206020830184613470565b600080604083850312156134c257600080fd5b6134cb8361337a565b946020939093013593505050565b600080600080608085870312156134ef57600080fd5b6134f88561337a565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b8181101561354a5783518352928401929184019160010161352e565b50909695505050505050565b60006020828403121561356857600080fd5b6113208261337a565b60008060006060848603121561358657600080fd5b61358f8461337a565b925061359d6020850161337a565b9150604084013590509250925092565b6000602082840312156135bf57600080fd5b5035919050565b6000806000606084860312156135db57600080fd5b6135e48461337a565b95602085013595506040909401359392505050565b60008060008060008060a0878903121561361257600080fd5b61361b8761337a565b95506136296020880161337a565b94506040870135935060608701359250608087013567ffffffffffffffff81111561365357600080fd5b61365f89828a01613396565b979a9699509497509295939492505050565b6000806040838503121561368457600080fd5b61368d8361337a565b915061369b6020840161337a565b90509250929050565b600080604083850312156136b757600080fd5b8235915061369b6020840161337a565b6000602082840312156136d957600080fd5b8151801515811461132057600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561374757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156137765761377661374e565b500390565b60008160001904831182151516156137955761379561374e565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826137cd57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c908216806137e657607f821691505b60208210810361380657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b600082198211156138355761383561374e565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600182016138625761386261374e565b5060010190565b600080835481600182811c91508083168061388557607f831692505b602080841082036138a457634e487b7160e01b86526022600452602486fd5b8180156138b857600181146138c9576138f6565b60ff198616895284890196506138f6565b60008a81526020902060005b868110156138ee5781548b8201529085019083016138d5565b505084890196505b509498975050505050505050565b60008251613916818460208701613440565b9190910192915050565b634e487b7160e01b600052602160045260246000fd5b8281526040602082015260006111e7604083018461347056fea2646970667358221220e1189b59612b72498d3f0fd459780c561e609e42438d71ad791386645891b48f64736f6c634300080d003360e060405234801561001057600080fd5b5060405161037038038061037083398101604081905261002f91610066565b336080526001600160a01b0391821660a0521660c052610099565b80516001600160a01b038116811461006157600080fd5b919050565b6000806040838503121561007957600080fd5b6100828361004a565b91506100906020840161004a565b90509250929050565b60805160a05160c0516102ab6100c5600039600060b601526000608501526000605001526102ab6000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063533cf5ce14610030575b600080fd5b61004361003e3660046101d0565b610045565b005b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461007a57600080fd5b81156100ab576100ab7f000000000000000000000000000000000000000000000000000000000000000084846100e1565b80156100dc576100dc7f000000000000000000000000000000000000000000000000000000000000000084836100e1565b505050565b6000836001600160a01b03163b116100f857600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101549190610211565b6000604051808303816000865af19150503d8060008114610191576040519150601f19603f3d011682016040523d82523d6000602084013e610196565b606091505b50915091508180156101c05750805115806101c05750808060200190518101906101c0919061024c565b6101c957600080fd5b5050505050565b6000806000606084860312156101e557600080fd5b83356001600160a01b03811681146101fc57600080fd5b95602085013595506040909401359392505050565b6000825160005b818110156102325760208186018101518583015201610218565b81811115610241576000828501525b509190910192915050565b60006020828403121561025e57600080fd5b8151801515811461026e57600080fd5b939250505056fea26469706673582212201c3faa20c167dc462c74fe20c875d7f75171f597d502cdf3ef178ecd2315df7564736f6c634300080d0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102745760003560e01c80637ecebe0011610151578063bc25cf77116100c3578063d21220a711610087578063d21220a714610722578063d294f09314610749578063dd62ed3e14610751578063ebeb31db1461077c578063f140a35a14610784578063fff6cae91461079757600080fd5b8063bc25cf77146106eb578063bda39cad146106fe578063bf944dbc14610707578063c245febc14610710578063c5700a021461071957600080fd5b80639d63848a116101155780639d63848a146106145780639e8cc04b146106725780639f767c88146106855780639fd5a6cf146106a5578063a1ac4d13146106b8578063a9059cbb146106d857600080fd5b80637ecebe001461057357806389afcb44146105935780638a7b8cf2146105bb57806395d89b41146105e55780639af1d35a146105ed57600080fd5b8063252c09d7116101ea5780634d5a9f8a116101ae5780634d5a9f8a146104f1578063517b3f82146105115780635881c475146105245780635a76f25e146105375780636a6278421461054057806370a082311461055357600080fd5b8063252c09d7146103cc578063313ce567146103df57806332c0defd146103f9578063392f37e914610402578063443cb4bc146104e857600080fd5b806313345fe11161023c57806313345fe11461033357806318160ddd146103535780631df8c7171461036a578063205aabf11461037257806322be3de11461039257806323b872dd146103b957600080fd5b8063022c0d9f1461027957806306fdde031461028e5780630902f1ac146102ac578063095ea7b3146102d15780630dfe1681146102f4575b600080fd5b61028c6102873660046133d8565b61079f565b005b610296610ef8565b6040516102a3919061349c565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102a3565b6102e46102df3660046134af565b610f86565b60405190151581526020016102a3565b61031b7f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f981565b6040516001600160a01b0390911681526020016102a3565b6103466103413660046134d9565b610ff3565b6040516102a39190613512565b61035c60025481565b6040519081526020016102a3565b6102b66111ef565b61035c610380366004613556565b60106020526000908152604090205481565b6102e47f000000000000000000000000000000000000000000000000000000000000000081565b6102e46103c7366004613571565b61125e565b6102b66103da3660046135ad565b611327565b6103e7601281565b60405160ff90911681526020016102a3565b61035c600d5481565b600854600954604080517f0000000000000000000000000000000000000000000000000de0b6b3a764000081527f0000000000000000000000000000000000000000000000000de0b6b3a764000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f9811660a08301527f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb81660c082015260e0016102a3565b61035c60085481565b61035c6104ff366004613556565b60116020526000908152604090205481565b61035c61051f3660046134af565b61135a565b6103466105323660046135c6565b611442565b61035c60095481565b61035c61054e366004613556565b611451565b61035c610561366004613556565b60046020526000908152604090205481565b61035c610581366004613556565b60066020526000908152604090205481565b6105a66105a1366004613556565b6116b2565b604080519283526020830191909152016102a3565b6105c36119cf565b60408051825181526020808401519082015291810151908201526060016102a3565b610296611a4f565b61031b7f000000000000000000000000f1bccde4a3bf0320a252540f88d508a98d02ea3281565b604080516001600160a01b037f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f9811682527f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb8166020820152016102a3565b61035c6106803660046135c6565b611a5c565b61035c610693366004613556565b600f6020526000908152604090205481565b61028c6106b33660046135f9565b611ac9565b61035c6106c6366004613556565b60126020526000908152604090205481565b6102e46106e63660046134af565b611d6b565b61028c6106f9366004613556565b611d81565b61035c600e5481565b61035c600b5481565b61035c600c5481565b61035c600a5481565b61031b7f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb881565b6105a6611e9f565b61035c61075f366004613671565b600360209081526000928352604080842090915290825290205481565b60075461035c565b61035c6107923660046136a4565b611fc6565b61028c6120ba565b6013546001146107ae57600080fd5b60026013819055507f000000000000000000000000061ffe84b0f9e1669a6bf24548e5390dbf1e03b26001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083891906136c7565b1561084257600080fd5b60008511806108515750600084115b6108885760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600854600954818710801561089c57508086105b6108cd5760405162461bcd60e51b8152602060048201526002602482015261125360f21b604482015260640161087f565b6000807f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f97f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb86001600160a01b03898116908316148015906109405750806001600160a01b0316896001600160a01b031614155b6109715760405162461bcd60e51b8152602060048201526002602482015261125560f21b604482015260640161087f565b8a1561098257610982828a8d6121f4565b891561099357610993818a8c6121f4565b8615610a0057604051639a7bff7960e01b81526001600160a01b038a1690639a7bff79906109cd9033908f908f908e908e906004016136e9565b600060405180830381600087803b1580156109e757600080fd5b505af11580156109fb573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a689190613735565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190613735565b9250505060008985610ae59190613764565b8311610af2576000610b06565b610afc8a86613764565b610b069084613764565b90506000610b148a86613764565b8311610b21576000610b35565b610b2b8a86613764565b610b359084613764565b90506000821180610b465750600081115b610b785760405162461bcd60e51b815260206004820152600360248201526249494160e81b604482015260640161087f565b7f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f97f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb88315610c915760405163cc56b2c560e01b81523060048201527f000000000000000000000000000000000000000000000000000000000000000015156024820152610c9190612710906001600160a01b037f000000000000000000000000061ffe84b0f9e1669a6bf24548e5390dbf1e03b2169063cc56b2c590604401602060405180830381865afa158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c789190613735565b610c82908761377b565b610c8c91906137b0565b6122e3565b8215610d685760405163cc56b2c560e01b81523060048201527f000000000000000000000000000000000000000000000000000000000000000015156024820152610d6890612710906001600160a01b037f000000000000000000000000061ffe84b0f9e1669a6bf24548e5390dbf1e03b2169063cc56b2c590604401602060405180830381865afa158015610d2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4f9190613735565b610d59908661377b565b610d6391906137b0565b6123b0565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd09190613735565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b9190613735565b9450610e478888612476565b610e518787612476565b1015610e835760405162461bcd60e51b81526020600482015260016024820152604b60f81b604482015260640161087f565b5050610e91848488886125c2565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610f05906137d2565b80601f0160208091040260200160405190810160405280929190818152602001828054610f31906137d2565b8015610f7e5780601f10610f5357610100808354040283529160200191610f7e565b820191906000526020600020905b815481529060010190602001808311610f6157829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610fe19086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff8111156110105761101061380c565b604051908082528060200260200182016040528015611039578160200160208202803683370190505b5060075490915060009061104f90600190613764565b9050600061105d858761377b565b6110679083613764565b90506000805b838310156111df5761107f8784613822565b91506000600784815481106110965761109661383a565b906000526020600020906003020160000154600784815481106110bb576110bb61383a565b9060005260206000209060030201600001546110d79190613764565b9050600081600786815481106110ef576110ef61383a565b906000526020600020906003020160010154600786815481106111145761111461383a565b9060005260206000209060030201600101546111309190613764565b61113a91906137b0565b9050600082600787815481106111525761115261383a565b906000526020600020906003020160020154600787815481106111775761117761383a565b9060005260206000209060030201600201546111939190613764565b61119d91906137b0565b90506111ab8c8e8484612756565b8885815181106111bd576111bd61383a565b60209081029190910101525050506001016111d88784613822565b925061106d565b509293505050505b949350505050565b600b54600c54426000808061120d600854600954600a549192909190565b9250925092508381146112565760006112268286613764565b9050611232818561377b565b61123c9088613822565b9650611248818461377b565b6112529087613822565b9550505b505050909192565b6001600160a01b03831660008181526003602090815260408083203380855292528220549192909190821480159061129857506000198114155b1561130e5760006112a98583613764565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b611319868686612a4b565b6001925050505b9392505050565b6007818154811061133757600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000806113656119cf565b90506000806113726111ef565b508451919350915042036113da576007805461139090600290613764565b815481106113a0576113a061383a565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b82516000906113e99042613764565b90506000818560200151856113fe9190613764565b61140891906137b0565b905060008286604001518561141d9190613764565b61142791906137b0565b9050611435888a8484612756565b9998505050505050505050565b60606111e78484846001610ff3565b600060135460011461146257600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f96001600160a01b0316906370a0823190602401602060405180830381865afa1580156114d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f89190613735565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb816906370a0823190602401602060405180830381865afa158015611562573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115869190613735565b905060006115948584613764565b905060006115a28584613764565b60025490915060008190036115e4576103e86115c66115c1848661377b565b612b0b565b6115d09190613764565b97506115df60006103e8612bf3565b611619565b611616876115f2838661377b565b6115fc91906137b0565b87611607848661377b565b61161191906137b0565b612c86565b97505b6000881161164f5760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b604482015260640161087f565b6116598989612bf3565b611665858589896125c2565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b6000806013546001146116c457600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f9907f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb8906000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561175a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177e9190613735565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ec9190613735565b30600090815260046020526040902054600254919250908061180e858461377b565b61181891906137b0565b995080611825848461377b565b61182f91906137b0565b985060008a1180156118415750600089115b6118735760405162461bcd60e51b815260206004820152600360248201526224a62160e91b604482015260640161087f565b61187d3083612c9c565b611888868c8c6121f4565b611893858c8b6121f4565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190613735565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa158015611942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119669190613735565b925061197484848a8a6125c2565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b6119f360405180606001604052806000815260200160008152602001600081525090565b60078054611a0390600190613764565b81548110611a1357611a1361383a565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610f05906137d2565b600080611a6c8585856001610ff3565b90506000805b8251811015611ab457828181518110611a8d57611a8d61383a565b602002602001015182611aa09190613822565b915080611aac81613850565b915050611a72565b50611abf84826137b0565b9695505050505050565b42831015611b095760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b604482015260640161087f565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611b399190613869565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b0389166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a919087611c0483613850565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120604051602001611c7d92919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050611cd6878285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d2792505050565b611d065760405162461bcd60e51b81526020600482015260016024820152605360f81b604482015260640161087f565b6001600160a01b038781166000818152600360209081526040808320948b168084529482529182902089905590518881527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b6000611d78338484612a4b565b50600192915050565b601354600114611d9057600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f9917f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb891611e5d9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611e2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4e9190613735565b611e589190613764565b6121f4565b6009546040516370a0823160e01b8152306004820152611e959183918691906001600160a01b038416906370a0823190602401611e0d565b5050600160135550565b600080611eab33612e69565b50503360009081526011602090815260408083205460129092529091205481151580611ed75750600081115b15611fc2573360008181526011602090815260408083208390556012909152808220919091555163299e7ae760e11b8152600481019190915260248101839052604481018290526001600160a01b037f000000000000000000000000f1bccde4a3bf0320a252540f88d508a98d02ea32169063533cf5ce90606401600060405180830381600087803b158015611f6c57600080fd5b505af1158015611f80573d6000803e3d6000fd5b505060408051858152602081018590523393508392507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b9091565b60085460095460405163cc56b2c560e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000151560248201526000929190612710907f000000000000000000000000061ffe84b0f9e1669a6bf24548e5390dbf1e03b26001600160a01b03169063cc56b2c590604401602060405180830381865afa158015612061573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120859190613735565b61208f908761377b565b61209991906137b0565b6120a39086613764565b94506120b185858484612756565b95945050505050565b6013546001146120c957600080fd5b60026013556040516370a0823160e01b81523060048201526121ed907f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f96001600160a01b0316906370a0823190602401602060405180830381865afa158015612136573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215a9190613735565b6040516370a0823160e01b81523060048201527f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb86001600160a01b0316906370a0823190602401602060405180830381865afa1580156121be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e29190613735565b6008546009546125c2565b6001601355565b6000836001600160a01b03163b1161220b57600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916122679190613904565b6000604051808303816000865af19150503d80600081146122a4576040519150601f19603f3d011682016040523d82523d6000602084013e6122a9565b606091505b50915091508180156122d35750805115806122d35750808060200190518101906122d391906136c7565b6122dc57600080fd5b5050505050565b61232e7f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f97f000000000000000000000000f1bccde4a3bf0320a252540f88d508a98d02ea32836121f4565b60025460009061234683670de0b6b3a764000061377b565b61235091906137b0565b905080156123705780600d600082825461236a9190613822565b90915550505b604080518381526000602082015233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291015b60405180910390a25050565b6123fb7f00000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb87f000000000000000000000000f1bccde4a3bf0320a252540f88d508a98d02ea32836121f4565b60025460009061241383670de0b6b3a764000061377b565b61241d91906137b0565b9050801561243d5780600e60008282546124379190613822565b90915550505b60408051600081526020810184905233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291016123a4565b60007f0000000000000000000000000000000000000000000000000000000000000000156125b15760007f0000000000000000000000000000000000000000000000000de0b6b3a76400006124d385670de0b6b3a764000061377b565b6124dd91906137b0565b905060007f0000000000000000000000000000000000000000000000000de0b6b3a764000061251485670de0b6b3a764000061377b565b61251e91906137b0565b90506000670de0b6b3a7640000612535838561377b565b61253f91906137b0565b90506000670de0b6b3a7640000612556848061377b565b61256091906137b0565b670de0b6b3a7640000612573868061377b565b61257d91906137b0565b6125879190613822565b9050670de0b6b3a764000061259c828461377b565b6125a691906137b0565b945050505050610fed565b6125bb828461377b565b9050610fed565b600a5442906000906125d49083613764565b90506000811180156125e557508315155b80156125f057508215155b15612637576125ff818561377b565b600b60008282546126109190613822565b909155506126209050818461377b565b600c60008282546126319190613822565b90915550505b60006126416119cf565b80519091506126509084613764565b91506107088211156127055760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000156129d957600061278a8484612476565b90507f0000000000000000000000000000000000000000000000000de0b6b3a76400006127bf85670de0b6b3a764000061377b565b6127c991906137b0565b93507f0000000000000000000000000000000000000000000000000de0b6b3a76400006127fe84670de0b6b3a764000061377b565b61280891906137b0565b92506000807f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f96001600160a01b0316876001600160a01b03161461284d578486612850565b85855b915091507f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f96001600160a01b0316876001600160a01b0316146128cf577f0000000000000000000000000000000000000000000000000de0b6b3a76400006128c089670de0b6b3a764000061377b565b6128ca91906137b0565b61290c565b7f0000000000000000000000000000000000000000000000000de0b6b3a764000061290289670de0b6b3a764000061377b565b61290c91906137b0565b9750600061292461291d848b613822565b8584612fc9565b61292e9083613764565b9050670de0b6b3a76400007f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f96001600160a01b0316896001600160a01b031614612998577f0000000000000000000000000000000000000000000000000de0b6b3a76400006129ba565b7f0000000000000000000000000000000000000000000000000de0b6b3a76400005b6129c4908361377b565b6129ce91906137b0565b9450505050506111e7565b6000807f0000000000000000000000005a093a9c4f440c6b105f0af7f7c4f1fbe45567f96001600160a01b0316866001600160a01b031614612a1c578385612a1f565b84845b9092509050612a2e8783613822565b612a38828961377b565b612a4291906137b0565b925050506111e7565b612a5483612e69565b612a5d82612e69565b6001600160a01b03831660009081526004602052604081208054839290612a85908490613764565b90915550506001600160a01b03821660009081526004602052604081208054839290612ab2908490613822565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612afe91815260200190565b60405180910390a3505050565b600081600003612b1d57506000919050565b60006001612b2a846130d8565b901c6001901b90506001818481612b4357612b4361379a565b048201901c90506001818481612b5b57612b5b61379a565b048201901c90506001818481612b7357612b7361379a565b048201901c90506001818481612b8b57612b8b61379a565b048201901c90506001818481612ba357612ba361379a565b048201901c90506001818481612bbb57612bbb61379a565b048201901c90506001818481612bd357612bd361379a565b048201901c905061132081828581612bed57612bed61379a565b04612c86565b612bfc82612e69565b8060026000828254612c0e9190613822565b90915550506001600160a01b03821660009081526004602052604081208054839290612c3b908490613822565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612c955781611320565b5090919050565b612ca582612e69565b8060026000828254612cb79190613764565b90915550506001600160a01b03821660009081526004602052604081208054839290612ce4908490613764565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612c7a565b6000806000612d36858561316c565b90925090506000816004811115612d4f57612d4f613920565b148015612d6d5750856001600160a01b0316826001600160a01b0316145b15612d7d57600192505050611320565b600080876001600160a01b0316631626ba7e60e01b8888604051602401612da5929190613936565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612de39190613904565b600060405180830381855afa9150503d8060008114612e1e576040519150601f19603f3d011682016040523d82523d6000602084013e612e23565b606091505b5091509150818015612e36575080516020145b8015612e5d57508051630b135d3f60e11b90612e5b9083016020908101908401613735565b145b98975050505050505050565b6001600160a01b0381166000908152600460205260409020548015612f97576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e54948190559490955282905593612ecb8584613764565b90506000612ed98584613764565b90508115612f34576000670de0b6b3a7640000612ef6848a61377b565b612f0091906137b0565b6001600160a01b038a16600090815260116020526040812080549293508392909190612f2d908490613822565b9091555050505b8015612f8d576000670de0b6b3a7640000612f4f838a61377b565b612f5991906137b0565b6001600160a01b038a16600090815260126020526040812080549293508392909190612f86908490613822565b9091555050505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff8110156130cf57826000612fe387836131b1565b905085811015613033576000612ff9888761324e565b6130038389613764565b61301590670de0b6b3a764000061377b565b61301f91906137b0565b905061302b8187613822565b955050613075565b600061303f888761324e565b6130498884613764565b61305b90670de0b6b3a764000061377b565b61306591906137b0565b90506130718187613764565b9550505b8185111561309e5760016130898387613764565b1161309957849350505050611320565b6130ba565b60016130aa8684613764565b116130ba57849350505050611320565b505080806130c790613850565b915050612fcd565b50909392505050565b600080608083901c156130ed57608092831c92015b604083901c156130ff57604092831c92015b602083901c1561311157602092831c92015b601083901c1561312357601092831c92015b600883901c1561313557600892831c92015b600483901c1561314757600492831c92015b600283901c1561315957600292831c92015b600183901c15610fed5760010192915050565b60008082516041036131a25760208301516040840151606085015160001a613196878285856132b6565b945094505050506131aa565b506000905060025b9250929050565b6000670de0b6b3a7640000828185816131ca828061377b565b6131d491906137b0565b6131de919061377b565b6131e891906137b0565b6131f2919061377b565b6131fc91906137b0565b670de0b6b3a7640000808481613212828061377b565b61321c91906137b0565b613226919061377b565b61323091906137b0565b61323a908661377b565b61324491906137b0565b6113209190613822565b6000670de0b6b3a76400008381613265828061377b565b61326f91906137b0565b613279919061377b565b61328391906137b0565b670de0b6b3a764000080613297858061377b565b6132a191906137b0565b6132ac86600361377b565b61323a919061377b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156132ed5750600090506003613371565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613341573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661336a57600060019250925050613371565b9150600090505b94509492505050565b80356001600160a01b038116811461339157600080fd5b919050565b60008083601f8401126133a857600080fd5b50813567ffffffffffffffff8111156133c057600080fd5b6020830191508360208285010111156131aa57600080fd5b6000806000806000608086880312156133f057600080fd5b85359450602086013593506134076040870161337a565b9250606086013567ffffffffffffffff81111561342357600080fd5b61342f88828901613396565b969995985093965092949392505050565b60005b8381101561345b578181015183820152602001613443565b8381111561346a576000848401525b50505050565b60008151808452613488816020860160208601613440565b601f01601f19169290920160200192915050565b6020815260006113206020830184613470565b600080604083850312156134c257600080fd5b6134cb8361337a565b946020939093013593505050565b600080600080608085870312156134ef57600080fd5b6134f88561337a565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b8181101561354a5783518352928401929184019160010161352e565b50909695505050505050565b60006020828403121561356857600080fd5b6113208261337a565b60008060006060848603121561358657600080fd5b61358f8461337a565b925061359d6020850161337a565b9150604084013590509250925092565b6000602082840312156135bf57600080fd5b5035919050565b6000806000606084860312156135db57600080fd5b6135e48461337a565b95602085013595506040909401359392505050565b60008060008060008060a0878903121561361257600080fd5b61361b8761337a565b95506136296020880161337a565b94506040870135935060608701359250608087013567ffffffffffffffff81111561365357600080fd5b61365f89828a01613396565b979a9699509497509295939492505050565b6000806040838503121561368457600080fd5b61368d8361337a565b915061369b6020840161337a565b90509250929050565b600080604083850312156136b757600080fd5b8235915061369b6020840161337a565b6000602082840312156136d957600080fd5b8151801515811461132057600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561374757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156137765761377661374e565b500390565b60008160001904831182151516156137955761379561374e565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826137cd57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c908216806137e657607f821691505b60208210810361380657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b600082198211156138355761383561374e565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600182016138625761386261374e565b5060010190565b600080835481600182811c91508083168061388557607f831692505b602080841082036138a457634e487b7160e01b86526022600452602486fd5b8180156138b857600181146138c9576138f6565b60ff198616895284890196506138f6565b60008a81526020902060005b868110156138ee5781548b8201529085019083016138d5565b505084890196505b509498975050505050505050565b60008251613916818460208701613440565b9190910192915050565b634e487b7160e01b600052602160045260246000fd5b8281526040602082015260006111e7604083018461347056fea2646970667358221220e1189b59612b72498d3f0fd459780c561e609e42438d71ad791386645891b48f64736f6c634300080d0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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.