Contract 0x25CbdDb98b35ab1FF77413456B31EC81A6B6B746 1

 
Txn Hash Method
Index
From
To
Value
0xa62800a01ba85f5f233a45c10affcce2a6408ce392d3d1ac9e61c2ac24887d97Create Pair220711032022-09-06 3:02:0624 days 19 hrs ago0x71d0db2a4b1b35631c821ebcba435db2584e35f0 IN  0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether0.0000512012720.001
0x6d9f183c30428c75cb1c4887a99918963dc14a7d66b3dc3fdbd49e4413b1eb80Set Fee Manager117792972022-06-14 18:46:08108 days 3 hrs agoVelodrome Finance: Deployer IN  0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether0.000120899190.001
0x20a74eb8cf4c60c63480a548edfff14126eed9dd86247416ad7c2816a1716a29Set Pauser100788482022-06-01 20:02:38121 days 2 hrs agoVelodrome Finance: Deployer IN  0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether0.0006101879180.001
0xa167d0e571b3651b20d804a80d78f717d3f67214d522cfad5d8f4af83cd1497a0x60806040100786862022-06-01 20:01:38121 days 2 hrs agoVelodrome Finance: Deployer IN  Create: PairFactory0 Ether0.0361297290.001
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xe8537b6ff1039cb9ed0b71713f697ddbadbb717d 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xe8537b6ff1039cb9ed0b71713f697ddbadbb717d 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x06141423dcf1a5a4c137039063ac873cdc1e363a 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x06141423dcf1a5a4c137039063ac873cdc1e363a 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xe8537b6ff1039cb9ed0b71713f697ddbadbb717d 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x06141423dcf1a5a4c137039063ac873cdc1e363a 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xd16232ad60188b68076a235c65d692090caba155 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xd16232ad60188b68076a235c65d692090caba155 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x58f98be02c4ffb675af8857013a9c0dfa5750d04 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x58f98be02c4ffb675af8857013a9c0dfa5750d04 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xd16232ad60188b68076a235c65d692090caba155 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x58f98be02c4ffb675af8857013a9c0dfa5750d04 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x6c5019d345ec05004a7e7b0623a91a0d9b8d590d 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x6c5019d345ec05004a7e7b0623a91a0d9b8d590d 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x43ce87a1ad20277b78cae52c7bcd5fc82a297551 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x43ce87a1ad20277b78cae52c7bcd5fc82a297551 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x6c5019d345ec05004a7e7b0623a91a0d9b8d590d 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x43ce87a1ad20277b78cae52c7bcd5fc82a297551 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
0x8be0c139e5865aec82e26f91f93446338440f6e0d9ae4c85093f243f45efc85a265817842022-09-30 22:10:0220 secs ago 0x47029bc8f5cbe3b464004e87ef9c9419a48018cd 0x25cbddb98b35ab1ff77413456b31ec81a6b6b7460 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PairFactory

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Optimistic.Etherscan.io on 2022-06-01
*/

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

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) external returns (address pair);
}

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

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint amount) external returns (bool);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function balanceOf(address) external view returns (uint);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint value) external returns (bool);

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

interface IPair {
    function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1);
    function claimFees() external returns (uint, uint);
    function tokens() external returns (address, address);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) 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);
}

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

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

}

// The base pair of pools, either stable or volatile
contract Pair is IPair {

    string public name;
    string public symbol;
    uint8 public constant decimals = 18;

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

    uint public totalSupply = 0;

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

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

    uint internal constant MINIMUM_LIQUIDITY = 10**3;

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

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

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

    Observation[] public observations;

    uint internal immutable decimals0;
    uint internal immutable decimals1;

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

    uint public reserve0CumulativeLast;
    uint public reserve1CumulativeLast;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    // gives the current twap price measured from amountIn * tokenIn gives amountOut
    function current(address tokenIn, uint amountIn) external view returns (uint amountOut) {
        Observation memory _observation = lastObservation();
        (uint reserve0Cumulative, uint reserve1Cumulative,) = currentCumulativePrices();
        if (block.timestamp == _observation.timestamp) {
            _observation = observations[observations.length-2];
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

        uint _balance0;
        uint _balance1;
        { // scope for _token{0,1}, avoids stack too deep errors
        (address _token0, address _token1) = (token0, token1);
        require(to != _token0 && to != _token1, 'IT'); // Pair: INVALID_TO
        if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
        if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
        if (data.length > 0) IPairCallee(to).hook(msg.sender, amount0Out, amount1Out, data); // callback, used for flash loans
        _balance0 = IERC20(_token0).balanceOf(address(this));
        _balance1 = IERC20(_token1).balanceOf(address(this));
        }
        uint amount0In = _balance0 > _reserve0 - amount0Out ? _balance0 - (_reserve0 - amount0Out) : 0;
        uint amount1In = _balance1 > _reserve1 - amount1Out ? _balance1 - (_reserve1 - amount1Out) : 0;
        require(amount0In > 0 || amount1In > 0, 'IIA'); // Pair: INSUFFICIENT_INPUT_AMOUNT
        { // scope for reserve{0,1}Adjusted, avoids stack too deep errors
        (address _token0, address _token1) = (token0, token1);
        if (amount0In > 0) _update0(amount0In * PairFactory(factory).getFee(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))));
    }
}

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;

    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;

    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 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) {
        return (_temp0, _temp1, _temp);
    }

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"bool","name":"stable","type":"bool"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptPauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_stable","type":"bool"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInitializable","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPair","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairCodeHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"pauser","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingFeeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingPauser","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_stable","type":"bool"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeManager","type":"address"}],"name":"setFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pauser","type":"address"}],"name":"setPauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stableFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"volatileFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a81b03191633610100810260ff1916919091178255600480546001600160a01b0319169091179055600280805560035561519190819061005a90396000f3fe60806040523480156200001157600080fd5b50600436106200015d5760003560e01c80639a7165e411620000c7578063bedb86fb1162000086578063bedb86fb14620002da578063d0fb020314620002f1578063e1f76b441462000305578063e5e31b13146200031c578063eb13c4cf1462000342578063f94c53c7146200037b57600080fd5b80639a7165e4146200027b5780639aab9248146200028f5780639fd0506d1462000299578063b187bd2614620002b2578063bc063e1a14620002d157600080fd5b80635084ed0311620001205780635084ed0314620001e9578063512b45ea14620001f3578063574f2ba3146200020a5780636801cc30146200021357806382dfdce414620002505780638a4fa0d2146200026757600080fd5b8063167a6f9014620001625780631e3dd18b146200016e5780632d88af4a14620001a257806340bbd77514620001b9578063472d35b914620001d2575b600080fd5b6200016c62000385565b005b620001856200017f36600462000989565b620003c8565b6040516001600160a01b0390911681526020015b60405180910390f35b6200016c620001b3366004620009c0565b620003f3565b620001c360025481565b60405190815260200162000199565b6200016c620001e3366004620009c0565b62000432565b620001c360035481565b620001c362000204366004620009f6565b620004a6565b600754620001c3565b620001856200022436600462000a14565b60066020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b620001856200026136600462000a14565b620004c1565b60055462000185906001600160a01b031681565b60015462000185906001600160a01b031681565b620001c3620007ac565b600054620001859061010090046001600160a01b031681565b600054620002c09060ff1681565b604051901515815260200162000199565b620001c3600581565b6200016c620002eb366004620009f6565b620007e0565b60045462000185906001600160a01b031681565b6200016c6200031636600462000a5e565b62000810565b620002c06200032d366004620009c0565b60086020526000908152604090205460ff1681565b600954600a54604080516001600160a01b0393841681529282166020840152600160a01b90910460ff1615159082015260600162000199565b6200016c620008fb565b6001546001600160a01b031633146200039d57600080fd5b600154600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60078181548110620003d957600080fd5b6000918252602090912001546001600160a01b0316905081565b60005461010090046001600160a01b031633146200041057600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b03163314620004845760405162461bcd60e51b815260206004820152600f60248201526e3737ba103332b29036b0b730b3b2b960891b60448201526064015b60405180910390fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600081620004b757600354620004bb565b6002545b92915050565b6000826001600160a01b0316846001600160a01b0316036200050b5760405162461bcd60e51b8152602060048201526002602482015261494160f01b60448201526064016200047b565b600080846001600160a01b0316866001600160a01b0316106200053057848662000533565b85855b90925090506001600160a01b038216620005755760405162461bcd60e51b81526020600482015260026024820152615a4160f01b60448201526064016200047b565b6001600160a01b0382811660009081526006602090815260408083208585168452825280832088151584529091529020541615620005db5760405162461bcd60e51b8152602060048201526002602482015261504560f01b60448201526064016200047b565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b604882015260009060490160408051601f19818403018152908290528051602090910120600a80546001600160a01b038087166001600160a01b03198b1515600160a01b0281166001600160a81b0319909416939093171790925560098054928816929091169190911790559150819062000682906200097b565b8190604051809103906000f5905080158015620006a3573d6000803e3d6000fd5b506001600160a01b0384811660008181526006602081815260408084208987168086529083528185208d15158087529084528286208054988a166001600160a01b0319998a16811790915582875294845282862087875284528286208187528452828620805489168617905560078054600181810183557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6889091018054909a1687179099558587526008855295839020805460ff1916909817909755935481519687529186019290925290840152929650907fc4805696c66d7cf352fc1d6bb633ad5ee82f6cb577c453024b6e0eb8306c6fc99060600160405180910390a35050509392505050565b600060405180602001620007c0906200097b565b6020820181038252601f19601f8201166040525080519060200120905090565b60005461010090046001600160a01b03163314620007fd57600080fd5b6000805460ff1916911515919091179055565b6004546001600160a01b031633146200085e5760405162461bcd60e51b815260206004820152600f60248201526e3737ba103332b29036b0b730b3b2b960891b60448201526064016200047b565b6005811115620008a05760405162461bcd60e51b815260206004820152600c60248201526b0cccaca40e8dede40d0d2ced60a31b60448201526064016200047b565b80600003620008e85760405162461bcd60e51b8152602060048201526013602482015272666565206d757374206265206e6f6e7a65726f60681b60448201526064016200047b565b8115620008f55760025550565b60035550565b6005546001600160a01b03163314620009575760405162461bcd60e51b815260206004820152601760248201527f6e6f742070656e64696e6720666565206d616e6167657200000000000000000060448201526064016200047b565b600554600480546001600160a01b0319166001600160a01b03909216919091179055565b6146d08062000a8c83390190565b6000602082840312156200099c57600080fd5b5035919050565b80356001600160a01b0381168114620009bb57600080fd5b919050565b600060208284031215620009d357600080fd5b620009de82620009a3565b9392505050565b80358015158114620009bb57600080fd5b60006020828403121562000a0957600080fd5b620009de82620009e5565b60008060006060848603121562000a2a57600080fd5b62000a3584620009a3565b925062000a4560208501620009a3565b915062000a5560408501620009e5565b90509250925092565b6000806040838503121562000a7257600080fd5b62000a7d83620009e5565b94602093909301359350505056fe61016060405260006002556000600d556000600e5560016013553480156200002657600080fd5b50336001600160a01b0316610100816001600160a01b0316815250506000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b8152600401606060405180830381865afa15801562000086573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ac9190620007c8565b8015156080526001600160a01b0380831660c052831660a052604051929550909350915083908390620000df90620006f7565b6001600160a01b03928316815291166020820152604001604051809103906000f08015801562000113573d6000803e3d6000fd5b506001600160a01b031660e05280156200034557826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000166573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000190919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001f9919081019062000863565b6040516020016200020c9291906200091b565b604051602081830303815290604052600090805190602001906200023292919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000272573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200029c919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620002db573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000305919081019062000863565b6040516020016200031892919062000976565b604051602081830303815290604052600190805190602001906200033e92919062000705565b506200055e565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000384573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003ae919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620003ed573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000417919081019062000863565b6040516020016200042a929190620009c7565b604051602081830303815290604052600090805190602001906200045092919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000490573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004ba919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620004f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000523919081019062000863565b6040516020016200053692919062000a24565b604051602081830303815290604052600190805190602001906200055c92919062000705565b505b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200059d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005c3919062000a46565b620005d090600a62000b87565b6101208181525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000617573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200063d919062000a46565b6200064a90600a62000b87565b6101405250506040805160608101825242815260006020820181815292820181815260078054600181018255925291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68860039092029182015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555062000bd4565b610370806200436083390190565b828054620007139062000b98565b90600052602060002090601f01602090048101928262000737576000855562000782565b82601f106200075257805160ff191683800117855562000782565b8280016001018555821562000782579182015b828111156200078257825182559160200191906001019062000765565b506200079092915062000794565b5090565b5b8082111562000790576000815560010162000795565b80516001600160a01b0381168114620007c357600080fd5b919050565b600080600060608486031215620007de57600080fd5b620007e984620007ab565b9250620007f960208501620007ab565b9150604084015180151581146200080f57600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200084d57818101518382015260200162000833565b838111156200085d576000848401525b50505050565b6000602082840312156200087657600080fd5b81516001600160401b03808211156200088e57600080fd5b818401915084601f830112620008a357600080fd5b815181811115620008b857620008b86200081a565b604051601f8201601f19908116603f01168101908382118183101715620008e357620008e36200081a565b81604052828152876020848701011115620008fd57600080fd5b6200091083602083016020880162000830565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200094781600f85016020880162000830565b602f60f81b600f9184019182015283516200096a81601084016020880162000830565b01601001949350505050565b6473414d4d2d60d81b8152600083516200099881600585016020880162000830565b602f60f81b6005918401918201528351620009bb81600684016020880162000830565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b815260008351620009f581601185016020880162000830565b602f60f81b601191840191820152835162000a1881601284016020880162000830565b01601201949350505050565b6476414d4d2d60d81b8152600083516200099881600585016020880162000830565b60006020828403121562000a5957600080fd5b815160ff8116811462000a6b57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000ac957816000190482111562000aad5762000aad62000a72565b8085161562000abb57918102915b93841c939080029062000a8d565b509250929050565b60008262000ae25750600162000b81565b8162000af15750600062000b81565b816001811462000b0a576002811462000b155762000b35565b600191505062000b81565b60ff84111562000b295762000b2962000a72565b50506001821b62000b81565b5060208310610133831016604e8410600b841016171562000b5a575081810a62000b81565b62000b66838362000a88565b806000190482111562000b7d5762000b7d62000a72565b0290505b92915050565b600062000a6b60ff84168362000ad1565b600181811c9082168062000bad57607f821691505b60208210810362000bce57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161360b62000d55600039600081816104310152818161253701528181612821015281816128e301526129ee01526000818161040e015281816124f6015281816127e20152818161292501526129c80152600081816107b801528181610c0701528181610cd801526120660152600081816105f201528181611c7a0152818161235d015261242a0152600081816104bb0152818161064701528181610714015281816108f301528181610b9b0152818161150f015281816116fa01528181611b21015281816121c301526124090152600081816102f90152818161049301528181610622015281816108d201528181610b7a01528181611479015281816116d801528181611aff0152818161213b0152818161233c01528181612863015281816128aa0152818161298f0152612a320152600081816103970152818161046301528181610bcf01528181610ca001528181612035015281816124ce01526127ae015261360b6000f3fe608060405234801561001057600080fd5b50600436106102745760003560e01c80637ecebe0011610151578063bda39cad116100c3578063d294f09311610087578063d294f09314610736578063d505accf1461073e578063dd62ed3e14610751578063ebeb31db1461077c578063f140a35a14610784578063fff6cae91461079757600080fd5b8063bda39cad146106eb578063bf944dbc146106f4578063c245febc146106fd578063c5700a0214610706578063d21220a71461070f57600080fd5b80639d63848a116101155780639d63848a146106145780639e8cc04b146106725780639f767c8814610685578063a1ac4d13146106a5578063a9059cbb146106c5578063bc25cf77146106d857600080fd5b80637ecebe001461057357806389afcb44146105935780638a7b8cf2146105bb57806395d89b41146105e55780639af1d35a146105ed57600080fd5b8063252c09d7116101ea5780634d5a9f8a116101ae5780634d5a9f8a146104f1578063517b3f82146105115780635881c475146105245780635a76f25e146105375780636a6278421461054057806370a082311461055357600080fd5b8063252c09d7146103cc578063313ce567146103df57806332c0defd146103f9578063392f37e914610402578063443cb4bc146104e857600080fd5b806313345fe11161023c57806313345fe11461033357806318160ddd146103535780631df8c7171461036a578063205aabf11461037257806322be3de11461039257806323b872dd146103b957600080fd5b8063022c0d9f1461027957806306fdde031461028e5780630902f1ac146102ac578063095ea7b3146102d15780630dfe1681146102f4575b600080fd5b61028c61028736600461308e565b61079f565b005b610296610eec565b6040516102a39190613152565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102a3565b6102e46102df366004613185565b610f7a565b60405190151581526020016102a3565b61031b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102a3565b6103466103413660046131af565b610fe7565b6040516102a391906131e8565b61035c60025481565b6040519081526020016102a3565b6102b66111e3565b61035c61038036600461322c565b60106020526000908152604090205481565b6102e47f000000000000000000000000000000000000000000000000000000000000000081565b6102e46103c7366004613247565b611252565b6102b66103da366004613283565b61131b565b6103e7601281565b60405160ff90911681526020016102a3565b61035c600d5481565b600854600954604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e0016102a3565b61035c60085481565b61035c6104ff36600461322c565b60116020526000908152604090205481565b61035c61051f366004613185565b61134e565b61034661053236600461329c565b611436565b61035c60095481565b61035c61054e36600461322c565b611445565b61035c61056136600461322c565b60046020526000908152604090205481565b61035c61058136600461322c565b60066020526000908152604090205481565b6105a66105a136600461322c565b6116a6565b604080519283526020830191909152016102a3565b6105c36119c3565b60408051825181526020808401519082015291810151908201526060016102a3565b610296611a43565b61031b7f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000166020820152016102a3565b61035c61068036600461329c565b611a50565b61035c61069336600461322c565b600f6020526000908152604090205481565b61035c6106b336600461322c565b60126020526000908152604090205481565b6102e46106d3366004613185565b611abd565b61028c6106e636600461322c565b611ad3565b61035c600e5481565b61035c600b5481565b61035c600c5481565b61035c600a5481565b61031b7f000000000000000000000000000000000000000000000000000000000000000081565b6105a6611bf1565b61028c61074c3660046132cf565b611d18565b61035c61075f366004613342565b600360209081526000928352604080842090915290825290205481565b60075461035c565b61035c610792366004613375565b612020565b61028c61210e565b6013546001146107ae57600080fd5b60026013819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190613398565b1561084257600080fd5b60008511806108515750600084115b6108885760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600854600954818710801561089c57508086105b6108cd5760405162461bcd60e51b8152602060048201526002602482015261125360f21b604482015260640161087f565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906109405750806001600160a01b0316896001600160a01b031614155b6109715760405162461bcd60e51b8152602060048201526002602482015261125560f21b604482015260640161087f565b8a1561098257610982828a8d612248565b891561099357610993818a8c612248565b8615610a0057604051639a7bff7960e01b81526001600160a01b038a1690639a7bff79906109cd9033908f908f908e908e906004016133ba565b600060405180830381600087803b1580156109e757600080fd5b505af11580156109fb573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a689190613406565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190613406565b9250505060008985610ae59190613435565b8311610af2576000610b06565b610afc8a86613435565b610b069084613435565b90506000610b148a86613435565b8311610b21576000610b35565b610b2b8a86613435565b610b359084613435565b90506000821180610b465750600081115b610b785760405162461bcd60e51b815260206004820152600360248201526249494160e81b604482015260640161087f565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008315610c8b57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610c8b90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c729190613406565b610c7c908761344c565b610c86919061346b565b612337565b8215610d5c57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610d5c90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610d1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d439190613406565b610d4d908661344c565b610d57919061346b565b612404565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610da0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc49190613406565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f9190613406565b9450610e3b88886124ca565b610e4587876124ca565b1015610e775760405162461bcd60e51b81526020600482015260016024820152604b60f81b604482015260640161087f565b5050610e8584848888612616565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610ef99061348d565b80601f0160208091040260200160405190810160405280929190818152602001828054610f259061348d565b8015610f725780601f10610f4757610100808354040283529160200191610f72565b820191906000526020600020905b815481529060010190602001808311610f5557829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610fd59086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff811115611004576110046134c1565b60405190808252806020026020018201604052801561102d578160200160208202803683370190505b5060075490915060009061104390600190613435565b90506000611051858761344c565b61105b9083613435565b90506000805b838310156111d35761107387846134d7565b915060006007848154811061108a5761108a6134ef565b906000526020600020906003020160000154600784815481106110af576110af6134ef565b9060005260206000209060030201600001546110cb9190613435565b9050600081600786815481106110e3576110e36134ef565b90600052602060002090600302016001015460078681548110611108576111086134ef565b9060005260206000209060030201600101546111249190613435565b61112e919061346b565b905060008260078781548110611146576111466134ef565b9060005260206000209060030201600201546007878154811061116b5761116b6134ef565b9060005260206000209060030201600201546111879190613435565b611191919061346b565b905061119f8c8e84846127aa565b8885815181106111b1576111b16134ef565b60209081029190910101525050506001016111cc87846134d7565b9250611061565b509293505050505b949350505050565b600b54600c544260008080611201600854600954600a549192909190565b92509250925083811461124a57600061121a8286613435565b9050611226818561344c565b61123090886134d7565b965061123c818461344c565b61124690876134d7565b9550505b505050909192565b6001600160a01b03831660008181526003602090815260408083203380855292528220549192909190821480159061128c57506000198114155b1561130257600061129d8583613435565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b61130d868686612a9f565b6001925050505b9392505050565b6007818154811061132b57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000806113596119c3565b90506000806113666111e3565b508451919350915042036113ce576007805461138490600290613435565b81548110611394576113946134ef565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b82516000906113dd9042613435565b90506000818560200151856113f29190613435565b6113fc919061346b565b90506000828660400151856114119190613435565b61141b919061346b565b9050611429888a84846127aa565b9998505050505050505050565b60606111db8484846001610fe7565b600060135460011461145657600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156114c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ec9190613406565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611556573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157a9190613406565b905060006115888584613435565b905060006115968584613435565b60025490915060008190036115d8576103e86115ba6115b5848661344c565b612b5f565b6115c49190613435565b97506115d360006103e8612bcf565b61160d565b61160a876115e6838661344c565b6115f0919061346b565b876115fb848661344c565b611605919061346b565b612c62565b97505b600088116116435760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b604482015260640161087f565b61164d8989612bcf565b61165985858989612616565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b6000806013546001146116b857600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561174e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117729190613406565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e09190613406565b306000908152600460205260409020546002549192509080611802858461344c565b61180c919061346b565b995080611819848461344c565b611823919061346b565b985060008a1180156118355750600089115b6118675760405162461bcd60e51b815260206004820152600360248201526224a62160e91b604482015260640161087f565b6118713083612c78565b61187c868c8c612248565b611887858c8b612248565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156118cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ef9190613406565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa158015611936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195a9190613406565b925061196884848a8a612616565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b6119e760405180606001604052806000815260200160008152602001600081525090565b600780546119f790600190613435565b81548110611a0757611a076134ef565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610ef99061348d565b600080611a608585856001610fe7565b90506000805b8251811015611aa857828181518110611a8157611a816134ef565b602002602001015182611a9491906134d7565b915080611aa081613505565b915050611a66565b50611ab3848261346b565b9695505050505050565b6000611aca338484612a9f565b50600192915050565b601354600114611ae257600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611baf9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba09190613406565b611baa9190613435565b612248565b6009546040516370a0823160e01b8152306004820152611be79183918691906001600160a01b038416906370a0823190602401611b5f565b5050600160135550565b600080611bfd33612d03565b50503360009081526011602090815260408083205460129092529091205481151580611c295750600081115b15611d14573360008181526011602090815260408083208390556012909152808220919091555163299e7ae760e11b8152600481019190915260248101839052604481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063533cf5ce90606401600060405180830381600087803b158015611cbe57600080fd5b505af1158015611cd2573d6000803e3d6000fd5b505060408051858152602081018590523393508392507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b9091565b42841015611d585760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b604482015260640161087f565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611d88919061351e565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611e5383613505565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611ecc92919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611f37573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611f6d5750886001600160a01b0316816001600160a01b0316145b611fb95760405162461bcd60e51b815260206004820152601760248201527f506169723a20494e56414c49445f5349474e4154555245000000000000000000604482015260640161087f565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b600854600954604051632895a2f560e11b81527f0000000000000000000000000000000000000000000000000000000000000000151560048201526000929190612710907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063512b45ea90602401602060405180830381865afa1580156120b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d99190613406565b6120e3908761344c565b6120ed919061346b565b6120f79086613435565b9450612105858584846127aa565b95945050505050565b60135460011461211d57600080fd5b60026013556040516370a0823160e01b8152306004820152612241907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561218a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ae9190613406565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612212573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122369190613406565b600854600954612616565b6001601355565b6000836001600160a01b03163b1161225f57600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916122bb91906135b9565b6000604051808303816000865af19150503d80600081146122f8576040519150601f19603f3d011682016040523d82523d6000602084013e6122fd565b606091505b50915091508180156123275750805115806123275750808060200190518101906123279190613398565b61233057600080fd5b5050505050565b6123827f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083612248565b60025460009061239a83670de0b6b3a764000061344c565b6123a4919061346b565b905080156123c45780600d60008282546123be91906134d7565b90915550505b604080518381526000602082015233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291015b60405180910390a25050565b61244f7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083612248565b60025460009061246783670de0b6b3a764000061344c565b612471919061346b565b905080156124915780600e600082825461248b91906134d7565b90915550505b60408051600081526020810184905233917f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a860291016123f8565b60007f0000000000000000000000000000000000000000000000000000000000000000156126055760007f000000000000000000000000000000000000000000000000000000000000000061252785670de0b6b3a764000061344c565b612531919061346b565b905060007f000000000000000000000000000000000000000000000000000000000000000061256885670de0b6b3a764000061344c565b612572919061346b565b90506000670de0b6b3a7640000612589838561344c565b612593919061346b565b90506000670de0b6b3a76400006125aa848061344c565b6125b4919061346b565b670de0b6b3a76400006125c7868061344c565b6125d1919061346b565b6125db91906134d7565b9050670de0b6b3a76400006125f0828461344c565b6125fa919061346b565b945050505050610fe1565b61260f828461344c565b9050610fe1565b600a5442906000906126289083613435565b905060008111801561263957508315155b801561264457508215155b1561268b57612653818561344c565b600b600082825461266491906134d7565b909155506126749050818461344c565b600c600082825461268591906134d7565b90915550505b60006126956119c3565b80519091506126a49084613435565b91506107088211156127595760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000015612a2d5760006127de84846124ca565b90507f000000000000000000000000000000000000000000000000000000000000000061281385670de0b6b3a764000061344c565b61281d919061346b565b93507f000000000000000000000000000000000000000000000000000000000000000061285284670de0b6b3a764000061344c565b61285c919061346b565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316146128a15784866128a4565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612923577f000000000000000000000000000000000000000000000000000000000000000061291489670de0b6b3a764000061344c565b61291e919061346b565b612960565b7f000000000000000000000000000000000000000000000000000000000000000061295689670de0b6b3a764000061344c565b612960919061346b565b97506000612978612971848b6134d7565b8584612e63565b6129829083613435565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b0316146129ec577f0000000000000000000000000000000000000000000000000000000000000000612a0e565b7f00000000000000000000000000000000000000000000000000000000000000005b612a18908361344c565b612a22919061346b565b9450505050506111db565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614612a70578385612a73565b84845b9092509050612a8287836134d7565b612a8c828961344c565b612a96919061346b565b925050506111db565b612aa883612d03565b612ab182612d03565b6001600160a01b03831660009081526004602052604081208054839290612ad9908490613435565b90915550506001600160a01b03821660009081526004602052604081208054839290612b069084906134d7565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612b5291815260200190565b60405180910390a3505050565b60006003821115612bc05750806000612b7960028361346b565b612b849060016134d7565b90505b81811015612bba57905080600281612b9f818661346b565b612ba991906134d7565b612bb3919061346b565b9050612b87565b50919050565b8115612bca575060015b919050565b612bd882612d03565b8060026000828254612bea91906134d7565b90915550506001600160a01b03821660009081526004602052604081208054839290612c179084906134d7565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612c715781611314565b5090919050565b612c8182612d03565b8060026000828254612c939190613435565b90915550506001600160a01b03821660009081526004602052604081208054839290612cc0908490613435565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612c56565b6001600160a01b0381166000908152600460205260409020548015612e31576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e54948190559490955282905593612d658584613435565b90506000612d738584613435565b90508115612dce576000670de0b6b3a7640000612d90848a61344c565b612d9a919061346b565b6001600160a01b038a16600090815260116020526040812080549293508392909190612dc79084906134d7565b9091555050505b8015612e27576000670de0b6b3a7640000612de9838a61344c565b612df3919061346b565b6001600160a01b038a16600090815260126020526040812080549293508392909190612e209084906134d7565b9091555050505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff811015612f6957826000612e7d8783612f72565b905085811015612ecd576000612e93888761300f565b612e9d8389613435565b612eaf90670de0b6b3a764000061344c565b612eb9919061346b565b9050612ec581876134d7565b955050612f0f565b6000612ed9888761300f565b612ee38884613435565b612ef590670de0b6b3a764000061344c565b612eff919061346b565b9050612f0b8187613435565b9550505b81851115612f38576001612f238387613435565b11612f3357849350505050611314565b612f54565b6001612f448684613435565b11612f5457849350505050611314565b50508080612f6190613505565b915050612e67565b50909392505050565b6000670de0b6b3a764000082818581612f8b828061344c565b612f95919061346b565b612f9f919061344c565b612fa9919061346b565b612fb3919061344c565b612fbd919061346b565b670de0b6b3a7640000808481612fd3828061344c565b612fdd919061346b565b612fe7919061344c565b612ff1919061346b565b612ffb908661344c565b613005919061346b565b61131491906134d7565b6000670de0b6b3a76400008381613026828061344c565b613030919061346b565b61303a919061344c565b613044919061346b565b670de0b6b3a764000080613058858061344c565b613062919061346b565b61306d86600361344c565b612ffb919061344c565b80356001600160a01b0381168114612bca57600080fd5b6000806000806000608086880312156130a657600080fd5b85359450602086013593506130bd60408701613077565b9250606086013567ffffffffffffffff808211156130da57600080fd5b818801915088601f8301126130ee57600080fd5b8135818111156130fd57600080fd5b89602082850101111561310f57600080fd5b9699959850939650602001949392505050565b60005b8381101561313d578181015183820152602001613125565b8381111561314c576000848401525b50505050565b6020815260008251806020840152613171816040850160208701613122565b601f01601f19169190910160400192915050565b6000806040838503121561319857600080fd5b6131a183613077565b946020939093013593505050565b600080600080608085870312156131c557600080fd5b6131ce85613077565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b8181101561322057835183529284019291840191600101613204565b50909695505050505050565b60006020828403121561323e57600080fd5b61131482613077565b60008060006060848603121561325c57600080fd5b61326584613077565b925061327360208501613077565b9150604084013590509250925092565b60006020828403121561329557600080fd5b5035919050565b6000806000606084860312156132b157600080fd5b6132ba84613077565b95602085013595506040909401359392505050565b600080600080600080600060e0888a0312156132ea57600080fd5b6132f388613077565b965061330160208901613077565b95506040880135945060608801359350608088013560ff8116811461332557600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561335557600080fd5b61335e83613077565b915061336c60208401613077565b90509250929050565b6000806040838503121561338857600080fd5b8235915061336c60208401613077565b6000602082840312156133aa57600080fd5b8151801515811461131457600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561341857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156134475761344761341f565b500390565b60008160001904831182151516156134665761346661341f565b500290565b60008261348857634e487b7160e01b600052601260045260246000fd5b500490565b600181811c908216806134a157607f821691505b602082108103612bba57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600082198211156134ea576134ea61341f565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600182016135175761351761341f565b5060010190565b600080835481600182811c91508083168061353a57607f831692505b6020808410820361355957634e487b7160e01b86526022600452602486fd5b81801561356d576001811461357e576135ab565b60ff198616895284890196506135ab565b60008a81526020902060005b868110156135a35781548b82015290850190830161358a565b505084890196505b509498975050505050505050565b600082516135cb818460208701613122565b919091019291505056fea2646970667358221220a19e3ae5a8be50d3f0214f26cdfbbf27d23d06d04049400f5246a73b9288278264736f6c634300080d003360e060405234801561001057600080fd5b5060405161037038038061037083398101604081905261002f91610066565b336080526001600160a01b0391821660a0521660c052610099565b80516001600160a01b038116811461006157600080fd5b919050565b6000806040838503121561007957600080fd5b6100828361004a565b91506100906020840161004a565b90509250929050565b60805160a05160c0516102ab6100c5600039600060b601526000608501526000605001526102ab6000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063533cf5ce14610030575b600080fd5b61004361003e3660046101d0565b610045565b005b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461007a57600080fd5b81156100ab576100ab7f000000000000000000000000000000000000000000000000000000000000000084846100e1565b80156100dc576100dc7f000000000000000000000000000000000000000000000000000000000000000084836100e1565b505050565b6000836001600160a01b03163b116100f857600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101549190610211565b6000604051808303816000865af19150503d8060008114610191576040519150601f19603f3d011682016040523d82523d6000602084013e610196565b606091505b50915091508180156101c05750805115806101c05750808060200190518101906101c0919061024c565b6101c957600080fd5b5050505050565b6000806000606084860312156101e557600080fd5b83356001600160a01b03811681146101fc57600080fd5b95602085013595506040909401359392505050565b6000825160005b818110156102325760208186018101518583015201610218565b81811115610241576000828501525b509190910192915050565b60006020828403121561025e57600080fd5b8151801515811461026e57600080fd5b939250505056fea2646970667358221220da11d5f4f07a4d6e0e32270656e2fd1d34e9d687975338c1859f5bd93fd2899264736f6c634300080d0033a26469706673582212200e81b50dce868aca4cb03a5e26fd23df1ca2c157a93842bced2387a1c810ed2564736f6c634300080d0033

Deployed ByteCode Sourcemap

28137:3519:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29340:121;;;:::i;:::-;;28549:25;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;363:32:1;;;345:51;;333:2;318:18;28549:25:0;;;;;;;;29205:127;;;;;;:::i;:::-;;:::i;28275:24::-;;;;;;;;;922:25:1;;;910:2;895:18;28275:24:0;776:177:1;29593:166:0;;;;;;:::i;:::-;;:::i;28306:26::-;;;;;;30291:118;;;;;;:::i;:::-;;:::i;29101:96::-;29174:8;:15;29101:96;;28463:79;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;28463:79:0;;;30673:980;;;;;;:::i;:::-;;:::i;28422:32::-;;;;;-1:-1:-1;;;;;28422:32:0;;;28238:28;;;;;-1:-1:-1;;;;;28238:28:0;;;30417:116;;;:::i;28210:21::-;;;;;;;;-1:-1:-1;;;;;28210:21:0;;;28183:20;;;;;;;;;;;;1988:14:1;;1981:22;1963:41;;1951:2;1936:18;28183:20:0;1823:187:1;28339:35:0;;28373:1;28339:35;;29469:116;;;;;;:::i;:::-;;:::i;28390:25::-;;;;;-1:-1:-1;;;;;28390:25:0;;;29939:344;;;;;;:::i;:::-;;:::i;28581:38::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;30541:124;30635:6;;30643;;30541:124;;;-1:-1:-1;;;;;30635:6:0;;;2502:34:1;;30643:6:0;;;2567:2:1;2552:18;;2545:43;-1:-1:-1;;;30651:5:0;;;;;2631:14:1;2624:22;2604:18;;;2597:50;2452:2;2437:18;30541:124:0;2268:385:1;29767:164:0;;;:::i;29340:121::-;29406:13;;-1:-1:-1;;;;;29406:13:0;29392:10;:27;29384:36;;;;;;29440:13;;;29431:22;;-1:-1:-1;;;;;29440:13:0;;;;29431:22;-1:-1:-1;;;;;;29431:22:0;;;;;;;;;29340:121::o;28549:25::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;28549:25:0;;-1:-1:-1;28549:25:0;:::o;29205:127::-;29283:6;;;;;-1:-1:-1;;;;;29283:6:0;29269:10;:20;29261:29;;;;;;29301:13;:23;;-1:-1:-1;;;;;;29301:23:0;-1:-1:-1;;;;;29301:23:0;;;;;;;;;;29205:127::o;29593:166::-;29679:10;;-1:-1:-1;;;;;29679:10:0;29665;:24;29657:52;;;;-1:-1:-1;;;29657:52:0;;2860:2:1;29657:52:0;;;2842:21:1;2899:2;2879:18;;;2872:30;-1:-1:-1;;;2918:18:1;;;2911:45;2973:18;;29657:52:0;;;;;;;;;29720:17;:31;;-1:-1:-1;;;;;;29720:31:0;-1:-1:-1;;;;;29720:31:0;;;;;;;;;;29593:166::o;30291:118::-;30341:7;30368;:33;;30390:11;;30368:33;;;30378:9;;30368:33;30361:40;30291:118;-1:-1:-1;;30291:118:0:o;30673:980::-;30756:12;30799:6;-1:-1:-1;;;;;30789:16:0;:6;-1:-1:-1;;;;;30789:16:0;;30781:31;;;;-1:-1:-1;;;30781:31:0;;3204:2:1;30781:31:0;;;3186:21:1;3243:1;3223:18;;;3216:29;-1:-1:-1;;;3261:18:1;;;3254:32;3303:18;;30781:31:0;3002:325:1;30781:31:0;30853:14;30869;30896:6;-1:-1:-1;;;;;30887:15:0;:6;-1:-1:-1;;;;;30887:15:0;;:53;;30925:6;30933;30887:53;;;30906:6;30914;30887:53;30852:88;;-1:-1:-1;30852:88:0;-1:-1:-1;;;;;;30959:20:0;;30951:35;;;;-1:-1:-1;;;30951:35:0;;3534:2:1;30951:35:0;;;3516:21:1;3573:1;3553:18;;;3546:29;-1:-1:-1;;;3591:18:1;;;3584:32;3633:18;;30951:35:0;3332:325:1;30951:35:0;-1:-1:-1;;;;;31027:15:0;;;31070:1;31027:15;;;:7;:15;;;;;;;;:23;;;;;;;;;;:31;;;;;;;;;;;;:45;31019:60;;;;-1:-1:-1;;;31019:60:0;;3864:2:1;31019:60:0;;;3846:21:1;3903:1;3883:18;;;3876:29;-1:-1:-1;;;3921:18:1;;;3914:32;3963:18;;31019:60:0;3662:325:1;31019:60:0;31165:40;;-1:-1:-1;;4241:2:1;4237:15;;;4233:24;;31165:40:0;;;4221:37:1;4292:15;;;4288:24;4274:12;;;4267:46;4359:14;;4352:22;4347:3;4343:32;4329:12;;;4322:54;31140:12:0;;4392::1;;31165:40:0;;;-1:-1:-1;;31165:40:0;;;;;;;;;;31155:51;;31165:40;31155:51;;;;31279:6;31270:50;;-1:-1:-1;;;;;31270:50:0;;;-1:-1:-1;;;;;;31270:50:0;;;-1:-1:-1;;;31270:50:0;;;-1:-1:-1;;;;;;31270:50:0;;;;;;;;;;;31271:6;31270:50;;;;;;;;;;;;;;;31155:51;-1:-1:-1;31155:51:0;;31346:21;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;31379:15:0;;;;;;;:7;:15;;;;;;;;:23;;;;;;;;;;;;:31;;;;;;;;;;;;:38;;;;;-1:-1:-1;;;;;;31379:38:0;;;;;;;;31428:15;;;;;;;;;:23;;;;;;;;:31;;;;;;;;:38;;;;;;;;31522:8;:19;;-1:-1:-1;31522:19:0;;;;;;;;;;;;;;;;;;;31552:12;;;:6;:12;;;;;;:19;;-1:-1:-1;;31552:19:0;;;;;;;31629:15;;31587:58;;4611:41:1;;;4668:18;;;4661:60;;;;4737:18;;;4730:34;31379:38:0;;-1:-1:-1;31379:15:0;31587:58;;4599:2:1;4584:18;31587:58:0;;;;;;;30770:883;;;30673:980;;;;;:::o;30417:116::-;30464:7;30501:23;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;30491:34;;;;;;30484:41;;30417:116;:::o;29469:::-;29542:6;;;;;-1:-1:-1;;;;;29542:6:0;29528:10;:20;29520:29;;;;;;29560:8;:17;;-1:-1:-1;;29560:17:0;;;;;;;;;;29469:116::o;29939:344::-;30025:10;;-1:-1:-1;;;;;30025:10:0;30011;:24;30003:52;;;;-1:-1:-1;;;30003:52:0;;2860:2:1;30003:52:0;;;2842:21:1;2899:2;2879:18;;;2872:30;-1:-1:-1;;;2918:18:1;;;2911:45;2973:18;;30003:52:0;2658:339:1;30003:52:0;28373:1;30074:4;:15;;30066:40;;;;-1:-1:-1;;;30066:40:0;;4977:2:1;30066:40:0;;;4959:21:1;5016:2;4996:18;;;4989:30;-1:-1:-1;;;5035:18:1;;;5028:42;5087:18;;30066:40:0;4775:336:1;30066:40:0;30125:4;30133:1;30125:9;30117:41;;;;-1:-1:-1;;;30117:41:0;;5318:2:1;30117:41:0;;;5300:21:1;5357:2;5337:18;;;5330:30;-1:-1:-1;;;5376:18:1;;;5369:49;5435:18;;30117:41:0;5116:343:1;30117:41:0;30173:7;30169:107;;;30197:9;:16;-1:-1:-1;29939:344:0:o;30169:107::-;30246:11;:18;-1:-1:-1;29939:344:0:o;29767:164::-;29837:17;;-1:-1:-1;;;;;29837:17:0;29823:10;:31;29815:67;;;;-1:-1:-1;;;29815:67:0;;5666:2:1;29815:67:0;;;5648:21:1;5705:2;5685:18;;;5678:30;5744:25;5724:18;;;5717:53;5787:18;;29815:67:0;5464:347:1;29815:67:0;29906:17;;29893:10;:30;;-1:-1:-1;;;;;;29893:30:0;-1:-1:-1;;;;;29906:17:0;;;29893:30;;;;;;29767:164::o;-1:-1:-1:-;;;;;;;;:::o;14:180:1:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:1;;14:180;-1:-1:-1;14:180:1:o;407:173::-;475:20;;-1:-1:-1;;;;;524:31:1;;514:42;;504:70;;570:1;567;560:12;504:70;407:173;;;:::o;585:186::-;644:6;697:2;685:9;676:7;672:23;668:32;665:52;;;713:1;710;703:12;665:52;736:29;755:9;736:29;:::i;:::-;726:39;585:186;-1:-1:-1;;;585:186:1:o;958:160::-;1023:20;;1079:13;;1072:21;1062:32;;1052:60;;1108:1;1105;1098:12;1123:180;1179:6;1232:2;1220:9;1211:7;1207:23;1203:32;1200:52;;;1248:1;1245;1238:12;1200:52;1271:26;1287:9;1271:26;:::i;1308:328::-;1382:6;1390;1398;1451:2;1439:9;1430:7;1426:23;1422:32;1419:52;;;1467:1;1464;1457:12;1419:52;1490:29;1509:9;1490:29;:::i;:::-;1480:39;;1538:38;1572:2;1561:9;1557:18;1538:38;:::i;:::-;1528:48;;1595:35;1626:2;1615:9;1611:18;1595:35;:::i;:::-;1585:45;;1308:328;;;;;:::o;2015:248::-;2080:6;2088;2141:2;2129:9;2120:7;2116:23;2112:32;2109:52;;;2157:1;2154;2147:12;2109:52;2180:26;2196:9;2180:26;:::i;:::-;2170:36;2253:2;2238:18;;;;2225:32;;-1:-1:-1;;;2015:248:1:o

Swarm Source

ipfs://0e81b50dce868aca4cb03a5e26fd23df1ca2c157a93842bced2387a1c810ed25
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.