ETH Price: $1,804.47 (+10.63%)
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Fees290904092025-04-18 9:56:055 days ago1744970165IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000090.00083776
Claim Fees290099152025-04-16 13:12:576 days ago1744809177IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000230.0020009
Claim Fees290096332025-04-16 13:03:336 days ago1744808613IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000270.00206266
Claim Fees289414392025-04-14 23:10:258 days ago1744672225IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000210.00183544
Claim Fees288864632025-04-13 16:37:539 days ago1744562273IN
0xc868fcF8...b38B27Eb9
0 ETH0.00000010.00240277
Claim Fees286787482025-04-08 21:14:0314 days ago1744146843IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000230.00179887
Claim Fees286786822025-04-08 21:11:5114 days ago1744146711IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000230.00180214
Claim Fees284443302025-04-03 11:00:0720 days ago1743678007IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000310.0021947
Claim Fees284161122025-04-02 19:19:3120 days ago1743621571IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000240.00210167
Claim Fees283694842025-04-01 17:25:1521 days ago1743528315IN
0xc868fcF8...b38B27Eb9
0 ETH0.00000010.00235212
Claim Fees283210672025-03-31 14:31:2122 days ago1743431481IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000330.00284019
Claim Fees281461862025-03-27 13:21:5926 days ago1743081719IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000260.00178666
Claim Fees279736212025-03-23 13:29:4930 days ago1742736589IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000260.0019788
Approve279725592025-03-23 12:54:2530 days ago1742734465IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000090.00199656
Claim Fees279576002025-03-23 4:35:4731 days ago1742704547IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000390.00336455
Claim Fees278964902025-03-21 18:38:4732 days ago1742582327IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000710.00543465
Approve278146592025-03-19 21:11:0534 days ago1742418665IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000260.01092925
Approve278142062025-03-19 20:55:5934 days ago1742417759IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000290.01203191
Sync278113652025-03-19 19:21:1734 days ago1742412077IN
0xc868fcF8...b38B27Eb9
0 ETH0.000001010.01414653
Approve278112772025-03-19 19:18:2134 days ago1742411901IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000610.01334133
Claim Fees277763032025-03-18 23:52:3335 days ago1742341953IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000350.00300062
Claim Fees277697372025-03-18 20:13:4135 days ago1742328821IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000640.00489502
Claim Fees277674572025-03-18 18:57:4135 days ago1742324261IN
0xc868fcF8...b38B27Eb9
0 ETH0.0000010.00969157
Claim Fees277616352025-03-18 15:43:3735 days ago1742312617IN
0xc868fcF8...b38B27Eb9
0 ETH0.00000130.01102628
Approve277584622025-03-18 13:57:5135 days ago1742306271IN
0xc868fcF8...b38B27Eb9
0 ETH0.000000170.00375232
VIEW ADVANCED FILTER

Latest 2 internal transactions

Parent Transaction Hash Block From To
117338702024-03-12 15:24:47406 days ago1710257087
0xc868fcF8...b38B27Eb9
 Contract Creation0 ETH
117338702024-03-12 15:24:47406 days ago1710257087  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Pair

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 12 : Pair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "contracts/libraries/Math.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "contracts/interfaces/IPair.sol";
import "contracts/interfaces/IPairCallee.sol";
import "contracts/factories/PairFactory.sol";
import "contracts/PairFees.sol";
import "contracts/interfaces/IFeeDistributor.sol";

interface ERC20 {
    function symbol() external returns (string memory);

    function decimals() external returns (uint8);
}

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

    // LP fees proportion scale.
    uint internal constant LOCKER_FEES_SCALE = 1e4;
    // Fee distributor contract to accumulate fees for LP token lockers.
    IFeeDistributor public immutable feeDistributor;
    // LP fees percentage that goes to LP tokens that are not locked.
    uint public immutable lockerFeesP; // Scaled by 1e4.

    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,
            uint _lockerFeesP,
            address _feeDistributor
        ) = PairFactory(msg.sender).getInitializable();
        require(
            _lockerFeesP == 0 ||
                (_lockerFeesP < LOCKER_FEES_SCALE && _feeDistributor != address(0)),
            "MISS_FEE_DIST"
        );
        (token0, token1, stable, lockerFeesP, feeDistributor) = (
            _token0,
            _token1,
            _stable,
            _lockerFeesP,
            IFeeDistributor(_feeDistributor)
        );
        fees = address(new PairFees(_token0, _token1));
        if (_stable) {
            name = string(
                abi.encodePacked(
                    "StableV1 AMM - ",
                    ERC20(_token0).symbol(),
                    "/",
                    ERC20(_token1).symbol()
                )
            );
            symbol = string(
                abi.encodePacked(
                    "sAMM-",
                    ERC20(_token0).symbol(),
                    "/",
                    ERC20(_token1).symbol()
                )
            );
        } else {
            name = string(
                abi.encodePacked(
                    "VolatileV1 AMM - ",
                    ERC20(_token0).symbol(),
                    "/",
                    ERC20(_token1).symbol()
                )
            );
            symbol = string(
                abi.encodePacked(
                    "vAMM-",
                    ERC20(_token0).symbol(),
                    "/",
                    ERC20(_token1).symbol()
                )
            );
        }

        decimals0 = 10 ** ERC20(_token0).decimals();
        decimals1 = 10 ** ERC20(_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) {
        address claimer = msg.sender;
        if (msg.sender == address(feeDistributor)) {
            claimer = feeDistributor.tokenLocker();
        }

        _updateFor(claimer);
        claimed0 = claimable0[claimer];
        claimed1 = claimable1[claimer];

        if (claimed0 > 0 || claimed1 > 0) {
            claimable0[claimer] = 0;
            claimable1[claimer] = 0;
            PairFees(fees).claimFeesFor(msg.sender, claimed0, claimed1);

            emit Claim(claimer, 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
    // If non-zero lockerFeesP, then accrue portion of fees from LP fees to feeDistributor for LP lockers.
    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 -
                    (_share * lockerFeesP) /
                    LOCKER_FEES_SCALE;
                if (lockerFeesP != 0) {
                    claimable0[feeDistributor.tokenLocker()] +=
                        (_share * lockerFeesP) /
                        LOCKER_FEES_SCALE;
                }
            }
            if (_delta1 > 0) {
                uint _share = (_supplied * _delta1) / 1e18;
                claimable1[recipient] +=
                    _share -
                    (_share * lockerFeesP) /
                    LOCKER_FEES_SCALE;
                if (lockerFeesP != 0) {
                    claimable1[feeDistributor.tokenLocker()] +=
                        (_share * lockerFeesP) /
                        LOCKER_FEES_SCALE;
                }
            }
        } 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(_k(_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(stable)) / 10000
                ); // accrue fees for token0 and move them out of pool
            if (amount1In > 0)
                _update1(
                    (amount1In * PairFactory(factory).getFee(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(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
    ) 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"
        );
        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))));
    }
}

File 2 of 12 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 3 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 4 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 5 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

File 6 of 12 : PairFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

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 = 5; // 0.05%
    address public feeManager;
    address public pendingFeeManager;
    address public router;

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

    address internal _temp0;
    address internal _temp1;
    bool internal _temp;
    uint256 internal _tempP;
    address internal _tempF;

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

    constructor() {
        pauser = msg.sender;
        isPaused = false;
        feeManager = msg.sender;
        stableFee = 2; // 0.02%
        volatileFee = 2;
    }

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

    function getPairs(
        uint256 rangeA,
        uint256 rangeB
    ) external view returns (address[] memory pairs) {
        require(rangeB <= allPairs.length && rangeA < rangeB, "INVALID_RANGE");
        pairs = new address[](rangeB - rangeA);
        for (uint256 i = rangeA; i < rangeB; ++i) {
            pairs[i - rangeA] = allPairs[i];
        }
    }

    function initRouter(address _router) external {
        require(router == address(0), "router is set");
        router = _router;
    }

    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 getFee(bool _stable) public view returns (uint256) {
        return _stable ? stableFee : volatileFee;
    }

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

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

    // Creates pair, if lockerFeesP != 0, then lockerFeesP percentage of LP fees will go to a feeDistributor contract.
    function createPair(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 lockerFeesP,
        address feeDistributor
    ) external returns (address pair) {
        require(msg.sender == router, "NR");
        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, _tempP, _tempF) = (
            token0,
            token1,
            stable,
            lockerFeesP,
            feeDistributor
        );
        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;
        emit PairCreated(token0, token1, stable, pair, allPairs.length);
    }
}

File 7 of 12 : IFeeDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IFeeDistributor {
    function tokenLocker() external view returns (address);
}

File 8 of 12 : IPair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

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

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

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

File 10 of 12 : IPairFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IPairFactory {
    function allPairsLength() external view returns (uint);
    function isPair(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,
        uint256 lockerFeesP,
        address feeDistributor
    ) external returns (address pair);
}

File 11 of 12 : Math.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

library Math {
    function max(uint a, uint b) internal pure returns (uint) {
        return a >= b ? a : b;
    }

    function min(uint a, uint b) internal pure returns (uint) {
        return a < b ? a : b;
    }

    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }

    function cbrt(uint256 n) internal pure returns (uint256) {
        unchecked {
            uint256 x = 0;
            for (uint256 y = 1 << 255; y > 0; y >>= 3) {
                x <<= 1;
                uint256 z = 3 * x * (x + 1) + 1;
                if (n / y >= z) {
                    n -= y * z;
                    x += 1;
                }
            }
            return x;
        }
    }
}

File 12 of 12 : PairFees.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.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);
    }
}

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

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":"feeDistributor","outputs":[{"internalType":"contract IFeeDistributor","name":"","type":"address"}],"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":"lockerFeesP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"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"}]

6101a060405260006002556000600d556000600e5560016013553480156200002657600080fd5b50336001600160a01b0316610100816001600160a01b0316815250506000806000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b815260040160a060405180830381865afa15801562000089573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000af919062000795565b945094509450945094508160001480620000de575061271082108015620000de57506001600160a01b03811615155b6200011f5760405162461bcd60e51b815260206004820152600d60248201526c135254d4d7d1915157d11254d5609a1b604482015260640160405180910390fd5b6001600160a01b038082166101605261018083905283151560805280851660c052851660a0526040518590859062000157906200076a565b6001600160a01b03928316815291166020820152604001604051809103906000f0801580156200018b573d6000803e3d6000fd5b506001600160a01b031660e0528215620003b757846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af1158015620001e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200020a91908101906200083f565b846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af11580156200024b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200027591908101906200083f565b60405160200162000288929190620008f7565b60405160208183030381529060405260009081620002a79190620009e1565b50846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af1158015620002e9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200031391908101906200083f565b846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af115801562000354573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200037e91908101906200083f565b6040516020016200039192919062000aad565b60405160208183030381529060405260019081620003b09190620009e1565b50620005ca565b846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af1158015620003f8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200042291908101906200083f565b846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af115801562000463573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200048d91908101906200083f565b604051602001620004a092919062000afe565b60405160208183030381529060405260009081620004bf9190620009e1565b50846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af115801562000501573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200052b91908101906200083f565b846001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af11580156200056c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200059691908101906200083f565b604051602001620005a992919062000b5b565b60405160208183030381529060405260019081620005c89190620009e1565b505b846001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af11580156200060b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000631919062000b7d565b6200063e90600a62000cbe565b6101208181525050836001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af115801562000687573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006ad919062000b7d565b620006ba90600a62000cbe565b6101405250506040805160608101825242815260006020820181815292820181815260078054600181018255925291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68860039092029182015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555062000ccf915050565b61036480620048b583390190565b80516001600160a01b03811681146200079057600080fd5b919050565b600080600080600060a08688031215620007ae57600080fd5b620007b98662000778565b9450620007c96020870162000778565b935060408601518015158114620007df57600080fd5b60608701519093509150620007f76080870162000778565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620008365781810151838201526020016200081c565b50506000910152565b6000602082840312156200085257600080fd5b81516001600160401b03808211156200086a57600080fd5b818401915084601f8301126200087f57600080fd5b81518181111562000894576200089462000803565b604051601f8201601f19908116603f01168101908382118183101715620008bf57620008bf62000803565b81604052828152876020848701011115620008d957600080fd5b620008ec83602083016020880162000819565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200092381600f85016020880162000819565b602f60f81b600f9184019182015283516200094681601084016020880162000819565b01601001949350505050565b600181811c908216806200096757607f821691505b6020821081036200098857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620009dc57600081815260208120601f850160051c81016020861015620009b75750805b601f850160051c820191505b81811015620009d857828155600101620009c3565b5050505b505050565b81516001600160401b03811115620009fd57620009fd62000803565b62000a158162000a0e845462000952565b846200098e565b602080601f83116001811462000a4d576000841562000a345750858301515b600019600386901b1c1916600185901b178555620009d8565b600085815260208120601f198616915b8281101562000a7e5788860151825594840194600190910190840162000a5d565b508582101562000a9d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6473414d4d2d60d81b81526000835162000acf81600585016020880162000819565b602f60f81b600591840191820152835162000af281600684016020880162000819565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b81526000835162000b2c81601185016020880162000819565b602f60f81b601191840191820152835162000b4f81601284016020880162000819565b01601201949350505050565b6476414d4d2d60d81b81526000835162000acf81600585016020880162000819565b60006020828403121562000b9057600080fd5b815160ff8116811462000ba257600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000c0057816000190482111562000be45762000be462000ba9565b8085161562000bf257918102915b93841c939080029062000bc4565b509250929050565b60008262000c195750600162000cb8565b8162000c285750600062000cb8565b816001811462000c41576002811462000c4c5762000c6c565b600191505062000cb8565b60ff84111562000c605762000c6062000ba9565b50506001821b62000cb8565b5060208310610133831016604e8410600b841016171562000c91575081810a62000cb8565b62000c9d838362000bbf565b806000190482111562000cb45762000cb462000ba9565b0290505b92915050565b600062000ba260ff84168362000c08565b60805160a05160c05160e0516101005161012051610140516101605161018051613a0962000eac600039600081816107d901528181612ed601528181612f3e01528181612f6a01528181613085015281816130ed015261311901526000818161030f01528181611c6301528181611c8b01528181612f9f015261314e01526000818161046e015281816126690152818161295301528181612a150152612b2001526000818161044b015281816126280152818161291401528181612a570152612afa01526000818161081c01528181610c6b01528181610d3c015261219801526000818161062f01528181611da00152818161248f015261255c0152600081816104f801528181610684015281816107510152818161095701528181610bff015281816115730152818161175e01528181611b85015281816122f5015261253b01526000818161034e015281816104d00152818161065f0152818161093601528181610bde015281816114dd0152818161173c01528181611b630152818161226d0152818161246e01528181612995015281816129dc01528181612ac10152612b640152600081816103d4015281816104a001528181610c3301528181610d04015281816121670152818161260001526128e00152613a096000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80637ecebe001161015c578063bda39cad116100ce578063d505accf11610087578063d505accf1461077b578063dd62ed3e1461078e578063ebeb31db146107b9578063f140a35a146107c1578063fb6d6659146107d4578063fff6cae9146107fb57600080fd5b8063bda39cad14610728578063bf944dbc14610731578063c245febc1461073a578063c5700a0214610743578063d21220a71461074c578063d294f0931461077357600080fd5b80639d63848a116101205780639d63848a146106515780639e8cc04b146106af5780639f767c88146106c2578063a1ac4d13146106e2578063a9059cbb14610702578063bc25cf771461071557600080fd5b80637ecebe00146105b057806389afcb44146105d05780638a7b8cf2146105f857806395d89b41146106225780639af1d35a1461062a57600080fd5b806323b872dd116102005780634d5a9f8a116101b95780634d5a9f8a1461052e578063517b3f821461054e5780635881c475146105615780635a76f25e146105745780636a6278421461057d57806370a082311461059057600080fd5b806323b872dd146103f6578063252c09d714610409578063313ce5671461041c57806332c0defd14610436578063392f37e91461043f578063443cb4bc1461052557600080fd5b80630dfe1681116102525780630dfe16811461034957806313345fe11461037057806318160ddd146103905780631df8c717146103a7578063205aabf1146103af57806322be3de1146103cf57600080fd5b8063022c0d9f1461028f57806306fdde03146102a45780630902f1ac146102c2578063095ea7b3146102e75780630d43e8ad1461030a575b600080fd5b6102a261029d36600461346d565b610803565b005b6102ac610f50565b6040516102b99190613527565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102b9565b6102fa6102f536600461355a565b610fde565b60405190151581526020016102b9565b6103317f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102b9565b6103317f000000000000000000000000000000000000000000000000000000000000000081565b61038361037e366004613586565b61104b565b6040516102b991906135c1565b61039960025481565b6040519081526020016102b9565b6102cc611247565b6103996103bd366004613605565b60106020526000908152604090205481565b6102fa7f000000000000000000000000000000000000000000000000000000000000000081565b6102fa610404366004613622565b6112b6565b6102cc610417366004613663565b61137f565b610424601281565b60405160ff90911681526020016102b9565b610399600d5481565b600854600954604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e0016102b9565b61039960085481565b61039961053c366004613605565b60116020526000908152604090205481565b61039961055c36600461355a565b6113b2565b61038361056f36600461367c565b61149a565b61039960095481565b61039961058b366004613605565b6114a9565b61039961059e366004613605565b60046020526000908152604090205481565b6103996105be366004613605565b60066020526000908152604090205481565b6105e36105de366004613605565b61170a565b604080519283526020830191909152016102b9565b610600611a27565b60408051825181526020808401519082015291810151908201526060016102b9565b6102ac611aa7565b6103317f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000166020820152016102b9565b6103996106bd36600461367c565b611ab4565b6103996106d0366004613605565b600f6020526000908152604090205481565b6103996106f0366004613605565b60126020526000908152604090205481565b6102fa61071036600461355a565b611b21565b6102a2610723366004613605565b611b37565b610399600e5481565b610399600b5481565b610399600c5481565b610399600a5481565b6103317f000000000000000000000000000000000000000000000000000000000000000081565b6105e3611c55565b6102a26107893660046136b1565b611e4a565b61039961079c366004613728565b600360209081526000928352604080842090915290825290205481565b600754610399565b6103996107cf366004613761565b612152565b6103997f000000000000000000000000000000000000000000000000000000000000000081565b6102a2612240565b60135460011461081257600080fd5b60026013819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089c9190613786565b156108a657600080fd5b60008511806108b55750600084115b6108ec5760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600854600954818710801561090057508086105b6109315760405162461bcd60e51b8152602060048201526002602482015261125360f21b60448201526064016108e3565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906109a45750806001600160a01b0316896001600160a01b031614155b6109d55760405162461bcd60e51b8152602060048201526002602482015261125560f21b60448201526064016108e3565b8a156109e6576109e6828a8d61237a565b89156109f7576109f7818a8c61237a565b8615610a6457604051639a7bff7960e01b81526001600160a01b038a1690639a7bff7990610a319033908f908f908e908e906004016137a8565b600060405180830381600087803b158015610a4b57600080fd5b505af1158015610a5f573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc91906137f4565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3791906137f4565b9250505060008985610b499190613823565b8311610b56576000610b6a565b610b608a86613823565b610b6a9084613823565b90506000610b788a86613823565b8311610b85576000610b99565b610b8f8a86613823565b610b999084613823565b90506000821180610baa5750600081115b610bdc5760405162461bcd60e51b815260206004820152600360248201526249494160e81b60448201526064016108e3565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008315610cef57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610cef90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610cb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd691906137f4565b610ce09087613836565b610cea919061384d565b612469565b8215610dc057604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610dc090612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610d83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da791906137f4565b610db19086613836565b610dbb919061384d565b612536565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2891906137f4565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9391906137f4565b9450610e9f88886125fc565b610ea987876125fc565b1015610edb5760405162461bcd60e51b81526020600482015260016024820152604b60f81b60448201526064016108e3565b5050610ee984848888612748565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610f5d9061386f565b80601f0160208091040260200160405190810160405280929190818152602001828054610f899061386f565b8015610fd65780601f10610fab57610100808354040283529160200191610fd6565b820191906000526020600020905b815481529060010190602001808311610fb957829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906110399086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff811115611068576110686138a3565b604051908082528060200260200182016040528015611091578160200160208202803683370190505b506007549091506000906110a790600190613823565b905060006110b58587613836565b6110bf9083613823565b90506000805b83831015611237576110d787846138b9565b91506000600784815481106110ee576110ee6138cc565b90600052602060002090600302016000015460078481548110611113576111136138cc565b90600052602060002090600302016000015461112f9190613823565b905060008160078681548110611147576111476138cc565b9060005260206000209060030201600101546007868154811061116c5761116c6138cc565b9060005260206000209060030201600101546111889190613823565b611192919061384d565b9050600082600787815481106111aa576111aa6138cc565b906000526020600020906003020160020154600787815481106111cf576111cf6138cc565b9060005260206000209060030201600201546111eb9190613823565b6111f5919061384d565b90506112038c8e84846128dc565b888581518110611215576112156138cc565b602090810291909101015250505060010161123087846138b9565b92506110c5565b509293505050505b949350505050565b600b54600c544260008080611265600854600954600a549192909190565b9250925092508381146112ae57600061127e8286613823565b905061128a8185613836565b61129490886138b9565b96506112a08184613836565b6112aa90876138b9565b9550505b505050909192565b6001600160a01b0383166000818152600360209081526040808320338085529252822054919290919082148015906112f057506000198114155b156113665760006113018583613823565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b611371868686612bd1565b6001925050505b9392505050565b6007818154811061138f57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000806113bd611a27565b90506000806113ca611247565b5084519193509150420361143257600780546113e890600290613823565b815481106113f8576113f86138cc565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b82516000906114419042613823565b90506000818560200151856114569190613823565b611460919061384d565b90506000828660400151856114759190613823565b61147f919061384d565b905061148d888a84846128dc565b9998505050505050505050565b606061123f848484600161104b565b60006013546001146114ba57600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561152c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155091906137f4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156115ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115de91906137f4565b905060006115ec8584613823565b905060006115fa8584613823565b600254909150600081900361163c576103e861161e61161985856125fc565b612c91565b6116289190613823565b975061163760006103e8612d01565b611671565b61166e8761164a8386613836565b611654919061384d565b8761165f8486613836565b611669919061384d565b612d94565b97505b600088116116a75760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b60448201526064016108e3565b6116b18989612d01565b6116bd85858989612748565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b60008060135460011461171c57600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d691906137f4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa158015611820573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184491906137f4565b3060009081526004602052604090205460025491925090806118668584613836565b611870919061384d565b99508061187d8484613836565b611887919061384d565b985060008a1180156118995750600089115b6118cb5760405162461bcd60e51b815260206004820152600360248201526224a62160e91b60448201526064016108e3565b6118d53083612daa565b6118e0868c8c61237a565b6118eb858c8b61237a565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa15801561192f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195391906137f4565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa15801561199a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119be91906137f4565b92506119cc84848a8a612748565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b611a4b60405180606001604052806000815260200160008152602001600081525090565b60078054611a5b90600190613823565b81548110611a6b57611a6b6138cc565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610f5d9061386f565b600080611ac4858585600161104b565b90506000805b8251811015611b0c57828181518110611ae557611ae56138cc565b602002602001015182611af891906138b9565b915080611b04816138e2565b915050611aca565b50611b17848261384d565b9695505050505050565b6000611b2e338484612bd1565b50600192915050565b601354600114611b4657600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611c139184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0491906137f4565b611c0e9190613823565b61237a565b6009546040516370a0823160e01b8152306004820152611c4b9183918691906001600160a01b038416906370a0823190602401611bc3565b5050600160135550565b600080336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168103611d0e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a80bf3e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0b91906138fb565b90505b611d1781612e35565b6001600160a01b038116600090815260116020908152604080832054601290925290912054909350915082151580611d4f5750600082115b15611e45576001600160a01b0381811660009081526011602090815260408083208390556012909152808220919091555163299e7ae760e11b815233600482015260248101859052604481018490527f00000000000000000000000000000000000000000000000000000000000000009091169063533cf5ce90606401600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b505060408051868152602081018690523393506001600160a01b03851692507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b509091565b42841015611e8a5760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b60448201526064016108e3565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611eba9190613918565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611f85836138e2565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611ffe92919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015612069573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061209f5750886001600160a01b0316816001600160a01b0316145b6120eb5760405162461bcd60e51b815260206004820152601760248201527f506169723a20494e56414c49445f5349474e415455524500000000000000000060448201526064016108e3565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b600854600954604051632895a2f560e11b81527f0000000000000000000000000000000000000000000000000000000000000000151560048201526000929190612710907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063512b45ea90602401602060405180830381865afa1580156121e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220b91906137f4565b6122159087613836565b61221f919061384d565b6122299086613823565b9450612237858584846128dc565b95945050505050565b60135460011461224f57600080fd5b60026013556040516370a0823160e01b8152306004820152612373907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156122bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e091906137f4565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236891906137f4565b600854600954612748565b6001601355565b6000836001600160a01b03163b1161239157600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916123ed91906139b7565b6000604051808303816000865af19150503d806000811461242a576040519150601f19603f3d011682016040523d82523d6000602084013e61242f565b606091505b50915091508180156124595750805115806124595750808060200190518101906124599190613786565b61246257600080fd5b5050505050565b6124b47f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008361237a565b6002546000906124cc83670de0b6b3a7640000613836565b6124d6919061384d565b905080156124f65780600d60008282546124f091906138b9565b90915550505b604080518381526000602082015233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291015b60405180910390a25050565b6125817f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008361237a565b60025460009061259983670de0b6b3a7640000613836565b6125a3919061384d565b905080156125c35780600e60008282546125bd91906138b9565b90915550505b60408051600081526020810184905233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602910161252a565b60007f0000000000000000000000000000000000000000000000000000000000000000156127375760007f000000000000000000000000000000000000000000000000000000000000000061265985670de0b6b3a7640000613836565b612663919061384d565b905060007f000000000000000000000000000000000000000000000000000000000000000061269a85670de0b6b3a7640000613836565b6126a4919061384d565b90506000670de0b6b3a76400006126bb8385613836565b6126c5919061384d565b90506000670de0b6b3a76400006126dc8480613836565b6126e6919061384d565b670de0b6b3a76400006126f98680613836565b612703919061384d565b61270d91906138b9565b9050670de0b6b3a76400006127228284613836565b61272c919061384d565b945050505050611045565b6127418284613836565b9050611045565b600a54429060009061275a9083613823565b905060008111801561276b57508315155b801561277657508215155b156127bd576127858185613836565b600b600082825461279691906138b9565b909155506127a690508184613836565b600c60008282546127b791906138b9565b90915550505b60006127c7611a27565b80519091506127d69084613823565b915061070882111561288b5760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000015612b5f57600061291084846125fc565b90507f000000000000000000000000000000000000000000000000000000000000000061294585670de0b6b3a7640000613836565b61294f919061384d565b93507f000000000000000000000000000000000000000000000000000000000000000061298484670de0b6b3a7640000613836565b61298e919061384d565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316146129d35784866129d6565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612a55577f0000000000000000000000000000000000000000000000000000000000000000612a4689670de0b6b3a7640000613836565b612a50919061384d565b612a92565b7f0000000000000000000000000000000000000000000000000000000000000000612a8889670de0b6b3a7640000613836565b612a92919061384d565b97506000612aaa612aa3848b6138b9565b8584613241565b612ab49083613823565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b031614612b1e577f0000000000000000000000000000000000000000000000000000000000000000612b40565b7f00000000000000000000000000000000000000000000000000000000000000005b612b4a9083613836565b612b54919061384d565b94505050505061123f565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614612ba2578385612ba5565b84845b9092509050612bb487836138b9565b612bbe8289613836565b612bc8919061384d565b9250505061123f565b612bda83612e35565b612be382612e35565b6001600160a01b03831660009081526004602052604081208054839290612c0b908490613823565b90915550506001600160a01b03821660009081526004602052604081208054839290612c389084906138b9565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c8491815260200190565b60405180910390a3505050565b60006003821115612cf25750806000612cab60028361384d565b612cb69060016138b9565b90505b81811015612cec57905080600281612cd1818661384d565b612cdb91906138b9565b612ce5919061384d565b9050612cb9565b50919050565b8115612cfc575060015b919050565b612d0a82612e35565b8060026000828254612d1c91906138b9565b90915550506001600160a01b03821660009081526004602052604081208054839290612d499084906138b9565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612da35781611378565b5090919050565b612db382612e35565b8060026000828254612dc59190613823565b90915550506001600160a01b03821660009081526004602052604081208054839290612df2908490613823565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612d88565b6001600160a01b038116600090815260046020526040902054801561320f576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e54948190559490955282905593612e978584613823565b90506000612ea58584613823565b90508115613056576000670de0b6b3a7640000612ec2848a613836565b612ecc919061384d565b9050612710612efb7f000000000000000000000000000000000000000000000000000000000000000083613836565b612f05919061384d565b612f0f9082613823565b6001600160a01b038a1660009081526011602052604081208054909190612f379084906138b9565b90915550507f00000000000000000000000000000000000000000000000000000000000000001561305457612710612f8f7f000000000000000000000000000000000000000000000000000000000000000083613836565b612f99919061384d565b601160007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a80bf3e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301f91906138fb565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461304e91906138b9565b90915550505b505b8015613205576000670de0b6b3a7640000613071838a613836565b61307b919061384d565b90506127106130aa7f000000000000000000000000000000000000000000000000000000000000000083613836565b6130b4919061384d565b6130be9082613823565b6001600160a01b038a16600090815260126020526040812080549091906130e69084906138b9565b90915550507f0000000000000000000000000000000000000000000000000000000000000000156132035761271061313e7f000000000000000000000000000000000000000000000000000000000000000083613836565b613148919061384d565b601260007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a80bf3e66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ce91906138fb565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546131fd91906138b9565b90915550505b505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff8110156133475782600061325b8783613350565b9050858110156132ab57600061327188876133ed565b61327b8389613823565b61328d90670de0b6b3a7640000613836565b613297919061384d565b90506132a381876138b9565b9550506132ed565b60006132b788876133ed565b6132c18884613823565b6132d390670de0b6b3a7640000613836565b6132dd919061384d565b90506132e98187613823565b9550505b818511156133165760016133018387613823565b1161331157849350505050611378565b613332565b60016133228684613823565b1161333257849350505050611378565b5050808061333f906138e2565b915050613245565b50909392505050565b6000670de0b6b3a7640000828185816133698280613836565b613373919061384d565b61337d9190613836565b613387919061384d565b6133919190613836565b61339b919061384d565b670de0b6b3a76400008084816133b18280613836565b6133bb919061384d565b6133c59190613836565b6133cf919061384d565b6133d99086613836565b6133e3919061384d565b61137891906138b9565b6000670de0b6b3a764000083816134048280613836565b61340e919061384d565b6134189190613836565b613422919061384d565b670de0b6b3a7640000806134368580613836565b613440919061384d565b61344b866003613836565b6133d99190613836565b6001600160a01b038116811461346a57600080fd5b50565b60008060008060006080868803121561348557600080fd5b8535945060208601359350604086013561349e81613455565b9250606086013567ffffffffffffffff808211156134bb57600080fd5b818801915088601f8301126134cf57600080fd5b8135818111156134de57600080fd5b8960208285010111156134f057600080fd5b9699959850939650602001949392505050565b60005b8381101561351e578181015183820152602001613506565b50506000910152565b6020815260008251806020840152613546816040850160208701613503565b601f01601f19169190910160400192915050565b6000806040838503121561356d57600080fd5b823561357881613455565b946020939093013593505050565b6000806000806080858703121561359c57600080fd5b84356135a781613455565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b818110156135f9578351835292840192918401916001016135dd565b50909695505050505050565b60006020828403121561361757600080fd5b813561137881613455565b60008060006060848603121561363757600080fd5b833561364281613455565b9250602084013561365281613455565b929592945050506040919091013590565b60006020828403121561367557600080fd5b5035919050565b60008060006060848603121561369157600080fd5b833561369c81613455565b95602085013595506040909401359392505050565b600080600080600080600060e0888a0312156136cc57600080fd5b87356136d781613455565b965060208801356136e781613455565b95506040880135945060608801359350608088013560ff8116811461370b57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561373b57600080fd5b823561374681613455565b9150602083013561375681613455565b809150509250929050565b6000806040838503121561377457600080fd5b82359150602083013561375681613455565b60006020828403121561379857600080fd5b8151801515811461137857600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561380657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156110455761104561380d565b80820281158282048414176110455761104561380d565b60008261386a57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c9082168061388357607f821691505b602082108103612cec57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b808201808211156110455761104561380d565b634e487b7160e01b600052603260045260246000fd5b6000600182016138f4576138f461380d565b5060010190565b60006020828403121561390d57600080fd5b815161137881613455565b600080835481600182811c91508083168061393457607f831692505b6020808410820361395357634e487b7160e01b86526022600452602486fd5b818015613967576001811461397c576139a9565b60ff19861689528415158502890196506139a9565b60008a81526020902060005b868110156139a15781548b820152908501908301613988565b505084890196505b509498975050505050505050565b600082516139c9818460208701613503565b919091019291505056fea26469706673582212205c2340f2ff25d0648b2ca54cf9cf5112139f13dc03943d832d1c2323b97cc43b64736f6c6343000814003360e060405234801561001057600080fd5b5060405161036438038061036483398101604081905261002f91610066565b336080526001600160a01b0391821660a0521660c052610099565b80516001600160a01b038116811461006157600080fd5b919050565b6000806040838503121561007957600080fd5b6100828361004a565b91506100906020840161004a565b90509250929050565b60805160a05160c05161029f6100c5600039600060b6015260006085015260006050015261029f6000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063533cf5ce14610030575b600080fd5b61004361003e3660046101d0565b610045565b005b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461007a57600080fd5b81156100ab576100ab7f000000000000000000000000000000000000000000000000000000000000000084846100e1565b80156100dc576100dc7f000000000000000000000000000000000000000000000000000000000000000084836100e1565b505050565b6000836001600160a01b03163b116100f857600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101549190610211565b6000604051808303816000865af19150503d8060008114610191576040519150601f19603f3d011682016040523d82523d6000602084013e610196565b606091505b50915091508180156101c05750805115806101c05750808060200190518101906101c09190610240565b6101c957600080fd5b5050505050565b6000806000606084860312156101e557600080fd5b83356001600160a01b03811681146101fc57600080fd5b95602085013595506040909401359392505050565b6000825160005b818110156102325760208186018101518583015201610218565b506000920191825250919050565b60006020828403121561025257600080fd5b8151801515811461026257600080fd5b939250505056fea264697066735822122018e0b6fd09fee6f66fed2e5d04b50e3c6109e5d5b9c896b0ffc3bc90ce8c017c64736f6c63430008140033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80637ecebe001161015c578063bda39cad116100ce578063d505accf11610087578063d505accf1461077b578063dd62ed3e1461078e578063ebeb31db146107b9578063f140a35a146107c1578063fb6d6659146107d4578063fff6cae9146107fb57600080fd5b8063bda39cad14610728578063bf944dbc14610731578063c245febc1461073a578063c5700a0214610743578063d21220a71461074c578063d294f0931461077357600080fd5b80639d63848a116101205780639d63848a146106515780639e8cc04b146106af5780639f767c88146106c2578063a1ac4d13146106e2578063a9059cbb14610702578063bc25cf771461071557600080fd5b80637ecebe00146105b057806389afcb44146105d05780638a7b8cf2146105f857806395d89b41146106225780639af1d35a1461062a57600080fd5b806323b872dd116102005780634d5a9f8a116101b95780634d5a9f8a1461052e578063517b3f821461054e5780635881c475146105615780635a76f25e146105745780636a6278421461057d57806370a082311461059057600080fd5b806323b872dd146103f6578063252c09d714610409578063313ce5671461041c57806332c0defd14610436578063392f37e91461043f578063443cb4bc1461052557600080fd5b80630dfe1681116102525780630dfe16811461034957806313345fe11461037057806318160ddd146103905780631df8c717146103a7578063205aabf1146103af57806322be3de1146103cf57600080fd5b8063022c0d9f1461028f57806306fdde03146102a45780630902f1ac146102c2578063095ea7b3146102e75780630d43e8ad1461030a575b600080fd5b6102a261029d36600461346d565b610803565b005b6102ac610f50565b6040516102b99190613527565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102b9565b6102fa6102f536600461355a565b610fde565b60405190151581526020016102b9565b6103317f0000000000000000000000007721137f19b78b546cd890b9075b49678acb7ed881565b6040516001600160a01b0390911681526020016102b9565b6103317f000000000000000000000000420000000000000000000000000000000000000681565b61038361037e366004613586565b61104b565b6040516102b991906135c1565b61039960025481565b6040519081526020016102b9565b6102cc611247565b6103996103bd366004613605565b60106020526000908152604090205481565b6102fa7f000000000000000000000000000000000000000000000000000000000000000081565b6102fa610404366004613622565b6112b6565b6102cc610417366004613663565b61137f565b610424601281565b60405160ff90911681526020016102b9565b610399600d5481565b600854600954604080517f0000000000000000000000000000000000000000000000000de0b6b3a764000081527f00000000000000000000000000000000000000000000000000000000000f424060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000004200000000000000000000000000000000000006811660a08301527f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029131660c082015260e0016102b9565b61039960085481565b61039961053c366004613605565b60116020526000908152604090205481565b61039961055c36600461355a565b6113b2565b61038361056f36600461367c565b61149a565b61039960095481565b61039961058b366004613605565b6114a9565b61039961059e366004613605565b60046020526000908152604090205481565b6103996105be366004613605565b60066020526000908152604090205481565b6105e36105de366004613605565b61170a565b604080519283526020830191909152016102b9565b610600611a27565b60408051825181526020808401519082015291810151908201526060016102b9565b6102ac611aa7565b6103317f000000000000000000000000a029dc6b1e8c9d3ef0b232279f587d9a3d79eba981565b604080516001600160a01b037f0000000000000000000000004200000000000000000000000000000000000006811682527f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913166020820152016102b9565b6103996106bd36600461367c565b611ab4565b6103996106d0366004613605565b600f6020526000908152604090205481565b6103996106f0366004613605565b60126020526000908152604090205481565b6102fa61071036600461355a565b611b21565b6102a2610723366004613605565b611b37565b610399600e5481565b610399600b5481565b610399600c5481565b610399600a5481565b6103317f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291381565b6105e3611c55565b6102a26107893660046136b1565b611e4a565b61039961079c366004613728565b600360209081526000928352604080842090915290825290205481565b600754610399565b6103996107cf366004613761565b612152565b6103997f00000000000000000000000000000000000000000000000000000000000007d081565b6102a2612240565b60135460011461081257600080fd5b60026013819055507f0000000000000000000000002d9a3a2bd6400ee28d770c7254ca840c82faf23f6001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089c9190613786565b156108a657600080fd5b60008511806108b55750600084115b6108ec5760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600854600954818710801561090057508086105b6109315760405162461bcd60e51b8152602060048201526002602482015261125360f21b60448201526064016108e3565b6000807f00000000000000000000000042000000000000000000000000000000000000067f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029136001600160a01b03898116908316148015906109a45750806001600160a01b0316896001600160a01b031614155b6109d55760405162461bcd60e51b8152602060048201526002602482015261125560f21b60448201526064016108e3565b8a156109e6576109e6828a8d61237a565b89156109f7576109f7818a8c61237a565b8615610a6457604051639a7bff7960e01b81526001600160a01b038a1690639a7bff7990610a319033908f908f908e908e906004016137a8565b600060405180830381600087803b158015610a4b57600080fd5b505af1158015610a5f573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc91906137f4565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3791906137f4565b9250505060008985610b499190613823565b8311610b56576000610b6a565b610b608a86613823565b610b6a9084613823565b90506000610b788a86613823565b8311610b85576000610b99565b610b8f8a86613823565b610b999084613823565b90506000821180610baa5750600081115b610bdc5760405162461bcd60e51b815260206004820152600360248201526249494160e81b60448201526064016108e3565b7f00000000000000000000000042000000000000000000000000000000000000067f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029138315610cef57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610cef90612710906001600160a01b037f0000000000000000000000002d9a3a2bd6400ee28d770c7254ca840c82faf23f169063512b45ea90602401602060405180830381865afa158015610cb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd691906137f4565b610ce09087613836565b610cea919061384d565b612469565b8215610dc057604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610dc090612710906001600160a01b037f0000000000000000000000002d9a3a2bd6400ee28d770c7254ca840c82faf23f169063512b45ea90602401602060405180830381865afa158015610d83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da791906137f4565b610db19086613836565b610dbb919061384d565b612536565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2891906137f4565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9391906137f4565b9450610e9f88886125fc565b610ea987876125fc565b1015610edb5760405162461bcd60e51b81526020600482015260016024820152604b60f81b60448201526064016108e3565b5050610ee984848888612748565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610f5d9061386f565b80601f0160208091040260200160405190810160405280929190818152602001828054610f899061386f565b8015610fd65780601f10610fab57610100808354040283529160200191610fd6565b820191906000526020600020905b815481529060010190602001808311610fb957829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906110399086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff811115611068576110686138a3565b604051908082528060200260200182016040528015611091578160200160208202803683370190505b506007549091506000906110a790600190613823565b905060006110b58587613836565b6110bf9083613823565b90506000805b83831015611237576110d787846138b9565b91506000600784815481106110ee576110ee6138cc565b90600052602060002090600302016000015460078481548110611113576111136138cc565b90600052602060002090600302016000015461112f9190613823565b905060008160078681548110611147576111476138cc565b9060005260206000209060030201600101546007868154811061116c5761116c6138cc565b9060005260206000209060030201600101546111889190613823565b611192919061384d565b9050600082600787815481106111aa576111aa6138cc565b906000526020600020906003020160020154600787815481106111cf576111cf6138cc565b9060005260206000209060030201600201546111eb9190613823565b6111f5919061384d565b90506112038c8e84846128dc565b888581518110611215576112156138cc565b602090810291909101015250505060010161123087846138b9565b92506110c5565b509293505050505b949350505050565b600b54600c544260008080611265600854600954600a549192909190565b9250925092508381146112ae57600061127e8286613823565b905061128a8185613836565b61129490886138b9565b96506112a08184613836565b6112aa90876138b9565b9550505b505050909192565b6001600160a01b0383166000818152600360209081526040808320338085529252822054919290919082148015906112f057506000198114155b156113665760006113018583613823565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b611371868686612bd1565b6001925050505b9392505050565b6007818154811061138f57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000806113bd611a27565b90506000806113ca611247565b5084519193509150420361143257600780546113e890600290613823565b815481106113f8576113f86138cc565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b82516000906114419042613823565b90506000818560200151856114569190613823565b611460919061384d565b90506000828660400151856114759190613823565b61147f919061384d565b905061148d888a84846128dc565b9998505050505050505050565b606061123f848484600161104b565b60006013546001146114ba57600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316906370a0823190602401602060405180830381865afa15801561152c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155091906137f4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291316906370a0823190602401602060405180830381865afa1580156115ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115de91906137f4565b905060006115ec8584613823565b905060006115fa8584613823565b600254909150600081900361163c576103e861161e61161985856125fc565b612c91565b6116289190613823565b975061163760006103e8612d01565b611671565b61166e8761164a8386613836565b611654919061384d565b8761165f8486613836565b611669919061384d565b612d94565b97505b600088116116a75760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b60448201526064016108e3565b6116b18989612d01565b6116bd85858989612748565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b60008060135460011461171c57600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000004200000000000000000000000000000000000006907f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913906000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d691906137f4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa158015611820573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184491906137f4565b3060009081526004602052604090205460025491925090806118668584613836565b611870919061384d565b99508061187d8484613836565b611887919061384d565b985060008a1180156118995750600089115b6118cb5760405162461bcd60e51b815260206004820152600360248201526224a62160e91b60448201526064016108e3565b6118d53083612daa565b6118e0868c8c61237a565b6118eb858c8b61237a565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa15801561192f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195391906137f4565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa15801561199a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119be91906137f4565b92506119cc84848a8a612748565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b611a4b60405180606001604052806000815260200160008152602001600081525090565b60078054611a5b90600190613823565b81548110611a6b57611a6b6138cc565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610f5d9061386f565b600080611ac4858585600161104b565b90506000805b8251811015611b0c57828181518110611ae557611ae56138cc565b602002602001015182611af891906138b9565b915080611b04816138e2565b915050611aca565b50611b17848261384d565b9695505050505050565b6000611b2e338484612bd1565b50600192915050565b601354600114611b4657600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000004200000000000000000000000000000000000006917f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291391611c139184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0491906137f4565b611c0e9190613823565b61237a565b6009546040516370a0823160e01b8152306004820152611c4b9183918691906001600160a01b038416906370a0823190602401611bc3565b5050600160135550565b600080336001600160a01b037f0000000000000000000000007721137f19b78b546cd890b9075b49678acb7ed8168103611d0e577f0000000000000000000000007721137f19b78b546cd890b9075b49678acb7ed86001600160a01b031663a80bf3e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0b91906138fb565b90505b611d1781612e35565b6001600160a01b038116600090815260116020908152604080832054601290925290912054909350915082151580611d4f5750600082115b15611e45576001600160a01b0381811660009081526011602090815260408083208390556012909152808220919091555163299e7ae760e11b815233600482015260248101859052604481018490527f000000000000000000000000a029dc6b1e8c9d3ef0b232279f587d9a3d79eba99091169063533cf5ce90606401600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b505060408051868152602081018690523393506001600160a01b03851692507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b509091565b42841015611e8a5760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b60448201526064016108e3565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611eba9190613918565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611f85836138e2565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611ffe92919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015612069573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061209f5750886001600160a01b0316816001600160a01b0316145b6120eb5760405162461bcd60e51b815260206004820152601760248201527f506169723a20494e56414c49445f5349474e415455524500000000000000000060448201526064016108e3565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b600854600954604051632895a2f560e11b81527f0000000000000000000000000000000000000000000000000000000000000000151560048201526000929190612710907f0000000000000000000000002d9a3a2bd6400ee28d770c7254ca840c82faf23f6001600160a01b03169063512b45ea90602401602060405180830381865afa1580156121e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220b91906137f4565b6122159087613836565b61221f919061384d565b6122299086613823565b9450612237858584846128dc565b95945050505050565b60135460011461224f57600080fd5b60026013556040516370a0823160e01b8152306004820152612373907f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316906370a0823190602401602060405180830381865afa1580156122bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e091906137f4565b6040516370a0823160e01b81523060048201527f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029136001600160a01b0316906370a0823190602401602060405180830381865afa158015612344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236891906137f4565b600854600954612748565b6001601355565b6000836001600160a01b03163b1161239157600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916123ed91906139b7565b6000604051808303816000865af19150503d806000811461242a576040519150601f19603f3d011682016040523d82523d6000602084013e61242f565b606091505b50915091508180156124595750805115806124595750808060200190518101906124599190613786565b61246257600080fd5b5050505050565b6124b47f00000000000000000000000042000000000000000000000000000000000000067f000000000000000000000000a029dc6b1e8c9d3ef0b232279f587d9a3d79eba98361237a565b6002546000906124cc83670de0b6b3a7640000613836565b6124d6919061384d565b905080156124f65780600d60008282546124f091906138b9565b90915550505b604080518381526000602082015233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291015b60405180910390a25050565b6125817f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029137f000000000000000000000000a029dc6b1e8c9d3ef0b232279f587d9a3d79eba98361237a565b60025460009061259983670de0b6b3a7640000613836565b6125a3919061384d565b905080156125c35780600e60008282546125bd91906138b9565b90915550505b60408051600081526020810184905233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602910161252a565b60007f0000000000000000000000000000000000000000000000000000000000000000156127375760007f0000000000000000000000000000000000000000000000000de0b6b3a764000061265985670de0b6b3a7640000613836565b612663919061384d565b905060007f00000000000000000000000000000000000000000000000000000000000f424061269a85670de0b6b3a7640000613836565b6126a4919061384d565b90506000670de0b6b3a76400006126bb8385613836565b6126c5919061384d565b90506000670de0b6b3a76400006126dc8480613836565b6126e6919061384d565b670de0b6b3a76400006126f98680613836565b612703919061384d565b61270d91906138b9565b9050670de0b6b3a76400006127228284613836565b61272c919061384d565b945050505050611045565b6127418284613836565b9050611045565b600a54429060009061275a9083613823565b905060008111801561276b57508315155b801561277657508215155b156127bd576127858185613836565b600b600082825461279691906138b9565b909155506127a690508184613836565b600c60008282546127b791906138b9565b90915550505b60006127c7611a27565b80519091506127d69084613823565b915061070882111561288b5760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000015612b5f57600061291084846125fc565b90507f0000000000000000000000000000000000000000000000000de0b6b3a764000061294585670de0b6b3a7640000613836565b61294f919061384d565b93507f00000000000000000000000000000000000000000000000000000000000f424061298484670de0b6b3a7640000613836565b61298e919061384d565b92506000807f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316876001600160a01b0316146129d35784866129d6565b85855b915091507f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316876001600160a01b031614612a55577f00000000000000000000000000000000000000000000000000000000000f4240612a4689670de0b6b3a7640000613836565b612a50919061384d565b612a92565b7f0000000000000000000000000000000000000000000000000de0b6b3a7640000612a8889670de0b6b3a7640000613836565b612a92919061384d565b97506000612aaa612aa3848b6138b9565b8584613241565b612ab49083613823565b9050670de0b6b3a76400007f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316896001600160a01b031614612b1e577f0000000000000000000000000000000000000000000000000de0b6b3a7640000612b40565b7f00000000000000000000000000000000000000000000000000000000000f42405b612b4a9083613836565b612b54919061384d565b94505050505061123f565b6000807f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316866001600160a01b031614612ba2578385612ba5565b84845b9092509050612bb487836138b9565b612bbe8289613836565b612bc8919061384d565b9250505061123f565b612bda83612e35565b612be382612e35565b6001600160a01b03831660009081526004602052604081208054839290612c0b908490613823565b90915550506001600160a01b03821660009081526004602052604081208054839290612c389084906138b9565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c8491815260200190565b60405180910390a3505050565b60006003821115612cf25750806000612cab60028361384d565b612cb69060016138b9565b90505b81811015612cec57905080600281612cd1818661384d565b612cdb91906138b9565b612ce5919061384d565b9050612cb9565b50919050565b8115612cfc575060015b919050565b612d0a82612e35565b8060026000828254612d1c91906138b9565b90915550506001600160a01b03821660009081526004602052604081208054839290612d499084906138b9565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612da35781611378565b5090919050565b612db382612e35565b8060026000828254612dc59190613823565b90915550506001600160a01b03821660009081526004602052604081208054839290612df2908490613823565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612d88565b6001600160a01b038116600090815260046020526040902054801561320f576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e54948190559490955282905593612e978584613823565b90506000612ea58584613823565b90508115613056576000670de0b6b3a7640000612ec2848a613836565b612ecc919061384d565b9050612710612efb7f00000000000000000000000000000000000000000000000000000000000007d083613836565b612f05919061384d565b612f0f9082613823565b6001600160a01b038a1660009081526011602052604081208054909190612f379084906138b9565b90915550507f00000000000000000000000000000000000000000000000000000000000007d01561305457612710612f8f7f00000000000000000000000000000000000000000000000000000000000007d083613836565b612f99919061384d565b601160007f0000000000000000000000007721137f19b78b546cd890b9075b49678acb7ed86001600160a01b031663a80bf3e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301f91906138fb565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461304e91906138b9565b90915550505b505b8015613205576000670de0b6b3a7640000613071838a613836565b61307b919061384d565b90506127106130aa7f00000000000000000000000000000000000000000000000000000000000007d083613836565b6130b4919061384d565b6130be9082613823565b6001600160a01b038a16600090815260126020526040812080549091906130e69084906138b9565b90915550507f00000000000000000000000000000000000000000000000000000000000007d0156132035761271061313e7f00000000000000000000000000000000000000000000000000000000000007d083613836565b613148919061384d565b601260007f0000000000000000000000007721137f19b78b546cd890b9075b49678acb7ed86001600160a01b031663a80bf3e66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ce91906138fb565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546131fd91906138b9565b90915550505b505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff8110156133475782600061325b8783613350565b9050858110156132ab57600061327188876133ed565b61327b8389613823565b61328d90670de0b6b3a7640000613836565b613297919061384d565b90506132a381876138b9565b9550506132ed565b60006132b788876133ed565b6132c18884613823565b6132d390670de0b6b3a7640000613836565b6132dd919061384d565b90506132e98187613823565b9550505b818511156133165760016133018387613823565b1161331157849350505050611378565b613332565b60016133228684613823565b1161333257849350505050611378565b5050808061333f906138e2565b915050613245565b50909392505050565b6000670de0b6b3a7640000828185816133698280613836565b613373919061384d565b61337d9190613836565b613387919061384d565b6133919190613836565b61339b919061384d565b670de0b6b3a76400008084816133b18280613836565b6133bb919061384d565b6133c59190613836565b6133cf919061384d565b6133d99086613836565b6133e3919061384d565b61137891906138b9565b6000670de0b6b3a764000083816134048280613836565b61340e919061384d565b6134189190613836565b613422919061384d565b670de0b6b3a7640000806134368580613836565b613440919061384d565b61344b866003613836565b6133d99190613836565b6001600160a01b038116811461346a57600080fd5b50565b60008060008060006080868803121561348557600080fd5b8535945060208601359350604086013561349e81613455565b9250606086013567ffffffffffffffff808211156134bb57600080fd5b818801915088601f8301126134cf57600080fd5b8135818111156134de57600080fd5b8960208285010111156134f057600080fd5b9699959850939650602001949392505050565b60005b8381101561351e578181015183820152602001613506565b50506000910152565b6020815260008251806020840152613546816040850160208701613503565b601f01601f19169190910160400192915050565b6000806040838503121561356d57600080fd5b823561357881613455565b946020939093013593505050565b6000806000806080858703121561359c57600080fd5b84356135a781613455565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b818110156135f9578351835292840192918401916001016135dd565b50909695505050505050565b60006020828403121561361757600080fd5b813561137881613455565b60008060006060848603121561363757600080fd5b833561364281613455565b9250602084013561365281613455565b929592945050506040919091013590565b60006020828403121561367557600080fd5b5035919050565b60008060006060848603121561369157600080fd5b833561369c81613455565b95602085013595506040909401359392505050565b600080600080600080600060e0888a0312156136cc57600080fd5b87356136d781613455565b965060208801356136e781613455565b95506040880135945060608801359350608088013560ff8116811461370b57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561373b57600080fd5b823561374681613455565b9150602083013561375681613455565b809150509250929050565b6000806040838503121561377457600080fd5b82359150602083013561375681613455565b60006020828403121561379857600080fd5b8151801515811461137857600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561380657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156110455761104561380d565b80820281158282048414176110455761104561380d565b60008261386a57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c9082168061388357607f821691505b602082108103612cec57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b808201808211156110455761104561380d565b634e487b7160e01b600052603260045260246000fd5b6000600182016138f4576138f461380d565b5060010190565b60006020828403121561390d57600080fd5b815161137881613455565b600080835481600182811c91508083168061393457607f831692505b6020808410820361395357634e487b7160e01b86526022600452602486fd5b818015613967576001811461397c576139a9565b60ff19861689528415158502890196506139a9565b60008a81526020902060005b868110156139a15781548b820152908501908301613988565b505084890196505b509498975050505050505050565b600082516139c9818460208701613503565b919091019291505056fea26469706673582212205c2340f2ff25d0648b2ca54cf9cf5112139f13dc03943d832d1c2323b97cc43b64736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.