ETH Price: $3,500.86 (+2.25%)
Gas: 2 Gwei

Token

Blooming Calamity (BLOOM)
 

Overview

Max Total Supply

21,000,000 BLOOM

Holders

134

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Filtered by Token Holder
fire4effect.eth
Balance
10,179.324968037874538247 BLOOM

Value
$0.00
0x85cdebb34b4c2edc66c0cf408afdb10213e414a9
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Bloom

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : Bloom.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;

import '@uniswap/v3-core/contracts/libraries/TickMath.sol';
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol';
import '@uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol';
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';

interface IUniswapV3PoolState {
      function slot0() external view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked);
}

contract Bloom is ERC20, Ownable {

    // struct to store queued walls update
    struct QueuedWallsUpdate {
        bool inQueue;
        int24[2][] newLiquidityWallsRanges;
        uint[] newLiquidityWallsRatios; 
        bool[] newLiquidityWallsInToken;
    }

    // token id and liquidity for each wall id
    struct WallInfo {
        uint tokenId;
        uint128 liquidity;
    }

    // fees
    uint baseFeesAmount; // base fees amount on each buy (base 10000)
    uint baseFeesAmountForRefferal; // base fees amount when referral is used(replace baseFeesAmount) (base 10000)
    uint feesAmountRatioForRefferer; // ratio (percent) of baseFeesAmountForRefferal gived to refferer when refferal is used (base 10000)
    uint PRPLL_fees; // ratio (percent) of base fees used to PRPLL (the rest is transferrer to the development address) (base 10000)
    mapping (address => bool) public feesExcludedAddresses;
    mapping (address => bool) public taxedPool; // mapping of taxed pool

    // liquidity walls
    int24[2][] public liquidityWallsRanges; // price range where each liquidity wall will be between
    uint[] public liquidityWallsRatios; // percent of all liquidity owned by the contract which will be placed in the walls
    bool[] public liquidityWallsInToken; // mapping of liquidity wall type (true for wall in BLOOM and false for wall in WETH)
    QueuedWallsUpdate public queuedWalls; // store queued wall update
    mapping (uint => WallInfo) public liquidityWallsTokenIds; // associate each wall id in array to WallInfo
    uint sellThresholdAmount; // token balance required to sell BLOOM

    // external address
    INonfungiblePositionManager public nonfungiblePositionManager;
    IUniswapV3PoolState public pairPool;
    uint24 public mainPoolFee;
    ISwapRouter public swapRouter;
    address public pairToken;

    // referral
    mapping (address => uint) refferalCodeByAddress;
    mapping (uint => address) reffererAddressByRefferalCode;
    mapping (address => bool) public usedRefferal;
    uint public tokensNeededForRefferalNumber; // minimum token required to generate a refferal code
    uint constant public maxRefferalCode = 999999999999999999;

    bool initialized;

    constructor(string memory _name, string memory _symbol, address _pairToken, INonfungiblePositionManager _nonfungiblePositionManager, ISwapRouter _swapRouter) ERC20(_name, _symbol) {
        _mint(msg.sender, 21000000e18);

        pairToken = _pairToken;

        nonfungiblePositionManager = _nonfungiblePositionManager;
        swapRouter = _swapRouter;

        _approveUniswap();
    }

    // OPERATOR FUNCTIONS

    // update external address to keep the smart contract functional in case of address changes
    function updateExternalAddressAndPoolFee(INonfungiblePositionManager _nonfungiblePositionManager, ISwapRouter _swapRouter, address _pairToken, IUniswapV3PoolState _pairPool, uint24 _mainPoolFee) external onlyOwner {
        nonfungiblePositionManager = _nonfungiblePositionManager;
        swapRouter = _swapRouter;
        pairToken = _pairToken;
        pairPool = _pairPool;
        mainPoolFee = _mainPoolFee;
    }

    function setFeesExcludedAddress(address _account, bool _isExcluded) external onlyOwner {
        feesExcludedAddresses[_account] = _isExcluded;
    }

    function setTaxedPool(address _pool, bool _isTaxed) external onlyOwner {
        taxedPool[_pool] = _isTaxed;
    }

    function setFeesAmount(uint _baseFeesAmount, uint _baseFeesAmountForRefferal, uint _feesAmountRatioForRefferer, uint _PRPLL_fees) external onlyOwner {
        require(_baseFeesAmount <= 5000);
        require(_baseFeesAmountForRefferal <= 5000);
        require(_feesAmountRatioForRefferer <= 5000);
        require(_PRPLL_fees <= 10000);
        baseFeesAmount = _baseFeesAmount;
        baseFeesAmountForRefferal = _baseFeesAmountForRefferal;
        feesAmountRatioForRefferer = _feesAmountRatioForRefferer;
        PRPLL_fees = _PRPLL_fees;
    }

    // put new liquidity wall in queue
    function queueLiquidityWallsParameters(int24[2][] calldata _liquidityWallsRanges, uint[] calldata _liquidityWallsRatios, bool[] calldata _liquidityWallsInToken) external onlyOwner {
        require(_liquidityWallsRanges.length == _liquidityWallsRatios.length && _liquidityWallsRatios.length == _liquidityWallsInToken.length);

        queuedWalls = QueuedWallsUpdate(true, _liquidityWallsRanges, _liquidityWallsRatios, _liquidityWallsInToken);
    }

    function setSellThresholdAmount(uint _sellThresholdAmount) external onlyOwner {
        sellThresholdAmount = _sellThresholdAmount;
    }

    function setTokensNeededForRefferalNumber(uint _tokensNeededForRefferalNumber) external onlyOwner {
        tokensNeededForRefferalNumber = _tokensNeededForRefferalNumber;
    }

    // OVERRIDE FUNCTIONS

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transferWithFees(sender, recipient, amount);
        _approve(sender, msg.sender, allowance(sender, msg.sender) - amount);
        return true;
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transferWithFees(msg.sender, recipient, amount);
        return true;
    }

    function _transferWithFees(address from, address to, uint256 amount) internal returns (bool) {
        if ((feesExcludedAddresses[from] == false && feesExcludedAddresses[to] == false) && taxedPool[from]) { // if the transfer is in a buy tx and "from" and "to" aren't excluded from fees
            uint feesAmount;
            
            uint referralCode = getReferralCodeFromTokenAmount(amount);

            if (usedRefferal[to] == false && isReferralCodeValid(referralCode) && getReffererAddressFromRefferalCode(referralCode) != tx.origin) {
                usedRefferal[to] = true;
                feesAmount = (amount * baseFeesAmountForRefferal) / 10000;
                uint feesAmountForRefferer = (feesAmount * feesAmountRatioForRefferer) / 10000;
                _transfer(from, getReffererAddressFromRefferalCode(referralCode), feesAmountForRefferer);
                feesAmount -= feesAmountForRefferer;
            } else {
                feesAmount = (amount * baseFeesAmount) / 10000;
            }
            
            uint feesForPRPLL = (feesAmount * PRPLL_fees) / 10000;
            uint feesForDevelopement = feesAmount - feesForPRPLL;
                
            _transfer(from, to, amount - feesAmount);
            _transfer(from, address(this), feesForPRPLL);
            _transfer(from, owner(), feesForDevelopement);
        } else {
            _transfer(from, to, amount);
        }

        handleNewBalance(to, balanceOf(to));

        return true;
    }

    // MAIN FUNCTIONS

    function init() external onlyOwner {
        require(initialized == false, "Already initialized");
        initialized = true;

        // get updated data
        (, int24 currentTick , , , , ,) = pairPool.slot0();
        uint quoteAmount = IERC20(pairToken).balanceOf(address(this));
        uint bloomAmount = balanceOf(address(this));

        // update walls configuration before adding new walls
        updateWallsIfQueued();

        // iterate each liquidity walls parameters and add it
        uint liquidityAmount;
        for (uint i=0; i < liquidityWallsRanges.length; i++) {
            if (liquidityWallsInToken[i]) {
                liquidityAmount = (liquidityWallsRatios[i] * bloomAmount) / 10000;

                if (liquidityAmount > 0) { // if there is enough liquidity to add
                    (uint tokenId, uint128 liquidity) = addLiquidity(currentTick + liquidityWallsRanges[i][0], currentTick + liquidityWallsRanges[i][1], liquidityAmount, 0);
                    liquidityWallsTokenIds[i] = WallInfo(tokenId, liquidity);
                } else 
                    liquidityWallsTokenIds[i] = WallInfo(0, 0);
            }
            else {
                liquidityAmount = (liquidityWallsRatios[i] * quoteAmount) / 10000;

                if (liquidityAmount > 0) { // if there is enough liquidity to add
                    (uint tokenId, uint128 liquidity) = addLiquidity(currentTick + liquidityWallsRanges[i][0], currentTick + liquidityWallsRanges[i][1], 0, liquidityAmount);
                    liquidityWallsTokenIds[i] = WallInfo(tokenId,liquidity);
                } else 
                    liquidityWallsTokenIds[i] = WallInfo(0, 0);
            }
        }
    }

    function reorganize(bool removeOldWalls) external onlyOwner {
        // Sell all BLOOM from fees
        if (balanceOf(address(this)) >= sellThresholdAmount)
            _sellBloom(1000);

        // Remove liquidity from old walls
        if (removeOldWalls) {
            for (uint i=0; i < liquidityWallsRanges.length; i++) {
                if (liquidityWallsTokenIds[i].tokenId != 0) {
                    removeLiquidity(liquidityWallsTokenIds[i]);
                    collectFees(liquidityWallsTokenIds[i]);
                }
            }
        }

        // get updated data
        (, int24 currentTick , , , , ,) = pairPool.slot0();
        uint quoteAmount = IERC20(pairToken).balanceOf(address(this));
        uint bloomAmount = balanceOf(address(this));

        // update walls configuration before adding new walls
        updateWallsIfQueued();

        // iterate each liquidity walls parameters and add it
        uint liquidityAmount;
        for (uint i=0; i < liquidityWallsRanges.length; i++) {
            if (liquidityWallsInToken[i]) {
                liquidityAmount = (liquidityWallsRatios[i] * bloomAmount) / 10000;

                if (liquidityAmount > 0) { // if there is enough liquidity to add
                    (uint tokenId, uint128 liquidity) = addLiquidity(currentTick + liquidityWallsRanges[i][0], currentTick + liquidityWallsRanges[i][1], liquidityAmount, 0);
                    liquidityWallsTokenIds[i] = WallInfo(tokenId, liquidity);
                } else 
                    liquidityWallsTokenIds[i] = WallInfo(0, 0);
            }
            else {
                liquidityAmount = (liquidityWallsRatios[i] * quoteAmount) / 10000;

                if (liquidityAmount > 0) { // if there is enough liquidity to add
                    (uint tokenId, uint128 liquidity) = addLiquidity(currentTick + liquidityWallsRanges[i][0], currentTick + liquidityWallsRanges[i][1], 0, liquidityAmount);
                    liquidityWallsTokenIds[i] = WallInfo(tokenId,liquidity);
                } else 
                    liquidityWallsTokenIds[i] = WallInfo(0, 0);
            }
        }
    }

    // INTERNAL AND PRIVATE UTILS FUNCTIONS

    function removeLiquidity(WallInfo memory _wall) private {
        INonfungiblePositionManager.DecreaseLiquidityParams memory params =
            INonfungiblePositionManager.DecreaseLiquidityParams({
                tokenId: _wall.tokenId,
                liquidity: _wall.liquidity,
                amount0Min: 0,
                amount1Min: 0,
                deadline: block.timestamp
            });

        nonfungiblePositionManager.decreaseLiquidity(params);
    }

    function collectFees(WallInfo memory _wall) private {
        INonfungiblePositionManager.CollectParams memory params =
            INonfungiblePositionManager.CollectParams({
                tokenId: _wall.tokenId,
                recipient: address(this),
                amount0Max: type(uint128).max,
                amount1Max: type(uint128).max
            });

        nonfungiblePositionManager.collect(params);
    }

    function sellBloom(uint _sellAmount) external onlyOwner {
        _sellBloom(_sellAmount);
    }

    function _sellBloom(uint _sellAmount) private {
        // _sellAmount between > 0 and 1000
        ISwapRouter.ExactInputSingleParams memory params =
            ISwapRouter.ExactInputSingleParams({
                tokenIn: address(this),
                tokenOut: pairToken,
                fee: mainPoolFee,
                recipient: address(this),
                deadline: block.timestamp,
                amountIn: (balanceOf(address(this)) * _sellAmount) / 1000,
                amountOutMinimum: 0,
                sqrtPriceLimitX96: 0
            });

        swapRouter.exactInputSingle(params);
    }

    function addLiquidity(int24 minTick, int24 maxTick, uint amountBloom, uint amountQuote) private returns (uint tokenId, uint128 liquidity) {
        minTick = nearestUsableTick(minTick);
        maxTick = nearestUsableTick(maxTick);

        address token0;
        address token1;
        uint token0Amount;
        uint token1Amount;

        if (address(this) < pairToken) {
            token0 = address(this);
            token1 = pairToken;
            token0Amount = amountBloom;
            token1Amount = amountQuote;
        } else {
            token0 = pairToken;
            token1 = address(this);
            token0Amount = amountQuote;
            token1Amount = amountBloom;
        }

        INonfungiblePositionManager.MintParams memory params =
            INonfungiblePositionManager.MintParams({
                token0: token0,
                token1: token1,
                fee: mainPoolFee,
                tickLower: minTick,
                tickUpper: maxTick,
                amount0Desired: token0Amount,
                amount1Desired: token1Amount,
                amount0Min: 0,
                amount1Min: 0,
                recipient: address(this),
                deadline: block.timestamp
            });

        (tokenId, liquidity, ,) = nonfungiblePositionManager.mint(params);
    }

    function updateWallsIfQueued() private {
        if (queuedWalls.inQueue) {
            liquidityWallsRanges = queuedWalls.newLiquidityWallsRanges;
            liquidityWallsRatios = queuedWalls.newLiquidityWallsRatios;
            liquidityWallsInToken = queuedWalls.newLiquidityWallsInToken;

            queuedWalls.inQueue = false;
        }
    }

    function _approveUniswap() private {
        TransferHelper.safeApprove(address(this), address(nonfungiblePositionManager), uint(-1));
        TransferHelper.safeApprove(pairToken, address(nonfungiblePositionManager), uint(-1));
        TransferHelper.safeApprove(address(this), address(swapRouter), uint(-1));
        TransferHelper.safeApprove(pairToken, address(swapRouter), uint(-1));
    }

    // REFERRAL FUNCTIONS

    function randomRefferal() private view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(block.difficulty, block.timestamp, block.gaslimit))) % maxRefferalCode;
    }

    function handleNewBalance(address account, uint256 balance) private {
        //already registered
        if(refferalCodeByAddress[account] != 0) {
            return;
        }
        //not enough tokens
        if(balance < tokensNeededForRefferalNumber) {
            return;
        }

        uint _refferalCode = randomRefferal();

        refferalCodeByAddress[account] = _refferalCode;
        reffererAddressByRefferalCode[_refferalCode] = account;
    }

    function getReferralCodeFromTokenAmount(uint256 tokenAmount) public pure returns (uint256) {
        uint256 decimals = 18;

        uint256 numberAfterDecimals = tokenAmount % (10**decimals);

        uint256 checkDecimals = 3;

        while(checkDecimals < decimals) {
            uint256 factor = 10**(decimals - checkDecimals);
            //check if number is all 0s after the decimalth decimal
            if(numberAfterDecimals % factor == 0) {
                return numberAfterDecimals / factor;
            }
            checkDecimals++;
        }

        return numberAfterDecimals;
    }

    function getRefferalCodeFromAddress(address account) public view returns (uint256) {
        return refferalCodeByAddress[account];
    }

    function getReffererAddressFromRefferalCode(uint refferalCode) public view returns (address) {
        return reffererAddressByRefferalCode[refferalCode];
    }

    function isReferralCodeValid(uint refferalCode) public view returns (bool) {
        if (getReffererAddressFromRefferalCode(refferalCode) != address(0)) return true;
        return false;
    }

    // TICK CALCULATION FUNCTIONS

    function nearestUsableTick(int24 _tick) pure public returns (int24) {
        if (_tick < 0) {
            return -_nearestNumber(-_tick, 60);
        } else {
            return _nearestNumber(_tick, 60);
        }
    }

    function _nearestNumber(int24 _tick, int24 _tickInterval) pure private returns (int24) {
        int24 high = ((_tick + _tickInterval - 1) / _tickInterval) * _tickInterval;
        int24 low = high - _tickInterval;
        if (abs(_tick - high) < abs(_tick - low)) return high;
        else return low;
    }

    function abs(int x) pure private returns (uint) {
        return uint(x >= 0 ? x : -x);
    }
}

File 2 of 21 : TransferHelper.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

library TransferHelper {
    /// @notice Transfers tokens from the targeted address to the given destination
    /// @notice Errors with 'STF' if transfer fails
    /// @param token The contract address of the token to be transferred
    /// @param from The originating address from which the tokens will be transferred
    /// @param to The destination address of the transfer
    /// @param value The amount to be transferred
    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) =
            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
    }

    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Errors with ST if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev Errors with 'SA' if transfer fails
    /// @param token The contract address of the token to be approved
    /// @param to The target of the approval
    /// @param value The amount of the given token the target will be allowed to spend
    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
    }

    /// @notice Transfers ETH to the recipient address
    /// @dev Fails with `STE`
    /// @param to The destination of the transfer
    /// @param value The value to be transferred
    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, 'STE');
    }
}

File 3 of 21 : PoolAddress.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
library PoolAddress {
    bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;

    /// @notice The identifying key of the pool
    struct PoolKey {
        address token0;
        address token1;
        uint24 fee;
    }

    /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
    /// @param tokenA The first token of a pool, unsorted
    /// @param tokenB The second token of a pool, unsorted
    /// @param fee The fee level of the pool
    /// @return Poolkey The pool details with ordered token0 and token1 assignments
    function getPoolKey(
        address tokenA,
        address tokenB,
        uint24 fee
    ) internal pure returns (PoolKey memory) {
        if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
        return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
    }

    /// @notice Deterministically computes the pool address given the factory and PoolKey
    /// @param factory The Uniswap V3 factory contract address
    /// @param key The PoolKey
    /// @return pool The contract address of the V3 pool
    function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
        require(key.token0 < key.token1);
        pool = address(
            uint256(
                keccak256(
                    abi.encodePacked(
                        hex'ff',
                        factory,
                        keccak256(abi.encode(key.token0, key.token1, key.fee)),
                        POOL_INIT_CODE_HASH
                    )
                )
            )
        );
    }
}

File 4 of 21 : ISwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

File 5 of 21 : IPoolInitializer.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

/// @title Creates and initializes V3 Pools
/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that
/// require the pool to exist.
interface IPoolInitializer {
    /// @notice Creates a new pool if it does not exist, then initializes if not initialized
    /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool
    /// @param token0 The contract address of token0 of the pool
    /// @param token1 The contract address of token1 of the pool
    /// @param fee The fee amount of the v3 pool for the specified token pair
    /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value
    /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
    function createAndInitializePoolIfNecessary(
        address token0,
        address token1,
        uint24 fee,
        uint160 sqrtPriceX96
    ) external payable returns (address pool);
}

File 6 of 21 : IPeripheryPayments.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;

/// @title Periphery Payments
/// @notice Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments {
    /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
    /// @param amountMinimum The minimum amount of WETH9 to unwrap
    /// @param recipient The address receiving ETH
    function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;

    /// @notice Refunds any ETH balance held by this contract to the `msg.sender`
    /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
    /// that use ether for the input amount
    function refundETH() external payable;

    /// @notice Transfers the full amount of a token held by this contract to recipient
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
    /// @param token The contract address of the token which will be transferred to `recipient`
    /// @param amountMinimum The minimum amount of token required for a transfer
    /// @param recipient The destination address of the token
    function sweepToken(
        address token,
        uint256 amountMinimum,
        address recipient
    ) external payable;
}

File 7 of 21 : IPeripheryImmutableState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
    /// @return Returns the address of the Uniswap V3 factory
    function factory() external view returns (address);

    /// @return Returns the address of WETH9
    function WETH9() external view returns (address);
}

File 8 of 21 : INonfungiblePositionManager.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol';

import './IPoolInitializer.sol';
import './IERC721Permit.sol';
import './IPeripheryPayments.sol';
import './IPeripheryImmutableState.sol';
import '../libraries/PoolAddress.sol';

/// @title Non-fungible token for positions
/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface INonfungiblePositionManager is
    IPoolInitializer,
    IPeripheryPayments,
    IPeripheryImmutableState,
    IERC721Metadata,
    IERC721Enumerable,
    IERC721Permit
{
    /// @notice Emitted when liquidity is increased for a position NFT
    /// @dev Also emitted when a token is minted
    /// @param tokenId The ID of the token for which liquidity was increased
    /// @param liquidity The amount by which liquidity for the NFT position was increased
    /// @param amount0 The amount of token0 that was paid for the increase in liquidity
    /// @param amount1 The amount of token1 that was paid for the increase in liquidity
    event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
    /// @notice Emitted when liquidity is decreased for a position NFT
    /// @param tokenId The ID of the token for which liquidity was decreased
    /// @param liquidity The amount by which liquidity for the NFT position was decreased
    /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity
    /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity
    event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
    /// @notice Emitted when tokens are collected for a position NFT
    /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior
    /// @param tokenId The ID of the token for which underlying tokens were collected
    /// @param recipient The address of the account that received the collected tokens
    /// @param amount0 The amount of token0 owed to the position that was collected
    /// @param amount1 The amount of token1 owed to the position that was collected
    event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);

    /// @notice Returns the position information associated with a given token ID.
    /// @dev Throws if the token ID is not valid.
    /// @param tokenId The ID of the token that represents the position
    /// @return nonce The nonce for permits
    /// @return operator The address that is approved for spending
    /// @return token0 The address of the token0 for a specific pool
    /// @return token1 The address of the token1 for a specific pool
    /// @return fee The fee associated with the pool
    /// @return tickLower The lower end of the tick range for the position
    /// @return tickUpper The higher end of the tick range for the position
    /// @return liquidity The liquidity of the position
    /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
    /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
    /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
    /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
    function positions(uint256 tokenId)
        external
        view
        returns (
            uint96 nonce,
            address operator,
            address token0,
            address token1,
            uint24 fee,
            int24 tickLower,
            int24 tickUpper,
            uint128 liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    struct MintParams {
        address token0;
        address token1;
        uint24 fee;
        int24 tickLower;
        int24 tickUpper;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        address recipient;
        uint256 deadline;
    }

    /// @notice Creates a new position wrapped in a NFT
    /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
    /// a method does not exist, i.e. the pool is assumed to be initialized.
    /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
    /// @return tokenId The ID of the token that represents the minted position
    /// @return liquidity The amount of liquidity for this position
    /// @return amount0 The amount of token0
    /// @return amount1 The amount of token1
    function mint(MintParams calldata params)
        external
        payable
        returns (
            uint256 tokenId,
            uint128 liquidity,
            uint256 amount0,
            uint256 amount1
        );

    struct IncreaseLiquidityParams {
        uint256 tokenId;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
    /// @param params tokenId The ID of the token for which liquidity is being increased,
    /// amount0Desired The desired amount of token0 to be spent,
    /// amount1Desired The desired amount of token1 to be spent,
    /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
    /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return liquidity The new liquidity amount as a result of the increase
    /// @return amount0 The amount of token0 to acheive resulting liquidity
    /// @return amount1 The amount of token1 to acheive resulting liquidity
    function increaseLiquidity(IncreaseLiquidityParams calldata params)
        external
        payable
        returns (
            uint128 liquidity,
            uint256 amount0,
            uint256 amount1
        );

    struct DecreaseLiquidityParams {
        uint256 tokenId;
        uint128 liquidity;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Decreases the amount of liquidity in a position and accounts it to the position
    /// @param params tokenId The ID of the token for which liquidity is being decreased,
    /// amount The amount by which liquidity will be decreased,
    /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
    /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return amount0 The amount of token0 accounted to the position's tokens owed
    /// @return amount1 The amount of token1 accounted to the position's tokens owed
    function decreaseLiquidity(DecreaseLiquidityParams calldata params)
        external
        payable
        returns (uint256 amount0, uint256 amount1);

    struct CollectParams {
        uint256 tokenId;
        address recipient;
        uint128 amount0Max;
        uint128 amount1Max;
    }

    /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
    /// @param params tokenId The ID of the NFT for which tokens are being collected,
    /// recipient The account that should receive the tokens,
    /// amount0Max The maximum amount of token0 to collect,
    /// amount1Max The maximum amount of token1 to collect
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);

    /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens
    /// must be collected first.
    /// @param tokenId The ID of the token that is being burned
    function burn(uint256 tokenId) external payable;
}

File 9 of 21 : IERC721Permit.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

/// @title ERC721 with permit
/// @notice Extension to ERC721 that includes a permit function for signature based approvals
interface IERC721Permit is IERC721 {
    /// @notice The permit typehash used in the permit signature
    /// @return The typehash for the permit
    function PERMIT_TYPEHASH() external pure returns (bytes32);

    /// @notice The domain separator used in the permit signature
    /// @return The domain seperator used in encoding of permit signature
    function DOMAIN_SEPARATOR() external view returns (bytes32);

    /// @notice Approve of a specific token ID for spending by spender via signature
    /// @param spender The account that is being approved
    /// @param tokenId The ID of the token that is being approved for spending
    /// @param deadline The deadline timestamp by which the call must be mined for the approve to work
    /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
    /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
    /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
    function permit(
        address spender,
        uint256 tokenId,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external payable;
}

File 10 of 21 : TickMath.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0 <0.8.0;

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MAX_TICK = -MIN_TICK;

    /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
    /// at the given tick
    function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
        uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
        require(absTick <= uint256(MAX_TICK), 'T');

        uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
        if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
        if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
        if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
        if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
        if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
        if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
        if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
        if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
        if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
        if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
        if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
        if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
        if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
        if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
        if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
        if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
        if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
        if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
        if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

        if (tick > 0) ratio = type(uint256).max / ratio;

        // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
        // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
        // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
        sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
    }

    /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
    function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
        // second inequality must be < because the price can never reach the price at the max tick
        require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
        uint256 ratio = uint256(sqrtPriceX96) << 32;

        uint256 r = ratio;
        uint256 msb = 0;

        assembly {
            let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(5, gt(r, 0xFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(4, gt(r, 0xFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(3, gt(r, 0xFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(2, gt(r, 0xF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(1, gt(r, 0x3))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := gt(r, 0x1)
            msb := or(msb, f)
        }

        if (msb >= 128) r = ratio >> (msb - 127);
        else r = ratio << (127 - msb);

        int256 log_2 = (int256(msb) - 128) << 64;

        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(63, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(62, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(61, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(60, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(59, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(58, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(57, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(56, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(55, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(54, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(53, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(52, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(51, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(50, f))
        }

        int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number

        int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
        int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);

        tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
    }
}

File 11 of 21 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

File 12 of 21 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 13 of 21 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 14 of 21 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 15 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../../introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transfered from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
      * @dev Safely transfers `tokenId` token from `from` to `to`.
      *
      * Requirements:
      *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
      * - `tokenId` token must exist and be owned by `from`.
      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
      *
      * Emits a {Transfer} event.
      */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}

File 16 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

File 17 of 21 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
     *
     * This is internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 18 of 21 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

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

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

File 19 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 20 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../GSN/Context.sol";
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 21 of 21 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_pairToken","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"_nonfungiblePositionManager","type":"address"},{"internalType":"contract ISwapRouter","name":"_swapRouter","type":"address"}],"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":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","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":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feesExcludedAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"getReferralCodeFromTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRefferalCodeFromAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"refferalCode","type":"uint256"}],"name":"getReffererAddressFromRefferalCode","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"refferalCode","type":"uint256"}],"name":"isReferralCodeValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"liquidityWallsInToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"liquidityWallsRanges","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"liquidityWallsRatios","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"liquidityWallsTokenIds","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mainPoolFee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRefferalCode","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"_tick","type":"int24"}],"name":"nearestUsableTick","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"nonfungiblePositionManager","outputs":[{"internalType":"contract INonfungiblePositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairPool","outputs":[{"internalType":"contract IUniswapV3PoolState","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24[2][]","name":"_liquidityWallsRanges","type":"int24[2][]"},{"internalType":"uint256[]","name":"_liquidityWallsRatios","type":"uint256[]"},{"internalType":"bool[]","name":"_liquidityWallsInToken","type":"bool[]"}],"name":"queueLiquidityWallsParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"queuedWalls","outputs":[{"internalType":"bool","name":"inQueue","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"removeOldWalls","type":"bool"}],"name":"reorganize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sellAmount","type":"uint256"}],"name":"sellBloom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_baseFeesAmount","type":"uint256"},{"internalType":"uint256","name":"_baseFeesAmountForRefferal","type":"uint256"},{"internalType":"uint256","name":"_feesAmountRatioForRefferer","type":"uint256"},{"internalType":"uint256","name":"_PRPLL_fees","type":"uint256"}],"name":"setFeesAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isExcluded","type":"bool"}],"name":"setFeesExcludedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sellThresholdAmount","type":"uint256"}],"name":"setSellThresholdAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"bool","name":"_isTaxed","type":"bool"}],"name":"setTaxedPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokensNeededForRefferalNumber","type":"uint256"}],"name":"setTokensNeededForRefferalNumber","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"taxedPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensNeededForRefferalNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INonfungiblePositionManager","name":"_nonfungiblePositionManager","type":"address"},{"internalType":"contract ISwapRouter","name":"_swapRouter","type":"address"},{"internalType":"address","name":"_pairToken","type":"address"},{"internalType":"contract IUniswapV3PoolState","name":"_pairPool","type":"address"},{"internalType":"uint24","name":"_mainPoolFee","type":"uint24"}],"name":"updateExternalAddressAndPoolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usedRefferal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620037883803806200378883398101604081905262000034916200060f565b8451859085906200004d906003906020850190620004c8565b50805162000063906004906020840190620004c8565b50506005805460ff191660121790555060006200007f6200013e565b60058054610100600160a81b0319166101006001600160a01b03841690810291909117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620000ec336a115eec47f6cf7e3500000062000142565b601880546001600160a01b038086166001600160a01b0319928316179092556015805485841690831617905560178054928416929091169190911790556200013362000251565b5050505050620006d1565b3390565b6001600160a01b0382166200019e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b620001ac600083836200030b565b620001c8816002546200031060201b62001a1c1790919060201c565b6002556001600160a01b03821660009081526020818152604090912054620001fb91839062001a1c62000310821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6200028030601560009054906101000a90046001600160a01b03166000196200037260201b62001a7d1760201c565b601854601554620002ad916001600160a01b03908116911660001962000372602090811b62001a7d17901c565b620002dc30601760009054906101000a90046001600160a01b03166000196200037260201b62001a7d1760201c565b60185460175462000309916001600160a01b03908116911660001962000372602090811b62001a7d17901c565b565b505050565b6000828201838110156200036b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b60208310620003f05780518252601f199092019160209182019101620003cf565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811462000454576040519150601f19603f3d011682016040523d82523d6000602084013e62000459565b606091505b50915091508180156200048a5750805115806200048a57508080602001905160208110156200048757600080fd5b50515b620004c1576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b5050505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826200050057600085556200054b565b82601f106200051b57805160ff19168380011785556200054b565b828001600101855582156200054b579182015b828111156200054b5782518255916020019190600101906200052e565b50620005599291506200055d565b5090565b5b808211156200055957600081556001016200055e565b600082601f83011262000585578081fd5b81516001600160401b03808211156200059a57fe5b6040516020601f8401601f1916820181018381118382101715620005ba57fe5b6040528382528584018101871015620005d1578485fd5b8492505b83831015620005f45785830181015182840182015291820191620005d5565b838311156200060557848185840101525b5095945050505050565b600080600080600060a0868803121562000627578081fd5b85516001600160401b03808211156200063e578283fd5b6200064c89838a0162000574565b9650602088015191508082111562000662578283fd5b50620006718882890162000574565b94505060408601516200068481620006b8565b60608701519093506200069781620006b8565b6080870151909250620006aa81620006b8565b809150509295509295909350565b6001600160a01b0381168114620006ce57600080fd5b50565b6130a780620006e16000396000f3fe608060405234801561001057600080fd5b50600436106102745760003560e01c80638dfa070211610151578063c2cbeb88116100c3578063e404152811610087578063e404152814610517578063e7df561814610538578063e7f339891461054b578063e7f404c01461055e578063f2fde38b14610566578063f680cf491461057957610274565b8063c2cbeb88146104d9578063c31c9c07146104ec578063dc0ab640146104f4578063dd62ed3e146104fc578063e1c7392a1461050f57610274565b8063a457c2d711610115578063a457c2d714610470578063a9059cbb14610483578063b01a3a2b14610496578063b1ff66d8146104a9578063b44a2722146104bc578063ba43db50146104c457610274565b80638dfa070214610427578063955c422f1461043a57806395d89b411461044d5780639808797c146104555780639dd4becb1461045d57610274565b80634e0014d6116101ea5780636970fafa116101ae5780636970fafa146103cb5780636a1363d9146103de57806370a08231146103f1578063715018a6146104045780637f254b921461040c5780638da5cb5b1461041f57610274565b80634e0014d6146103775780634f4a4e331461038a578063540ba09e146103925780635e3ecb35146103a557806364ae74a9146103b857610274565b806323b872dd1161023c57806323b872dd14610301578063313ce5671461031457806333efd83614610329578063395093511461033c5780633de35b791461034f578063465738ad1461036457610274565b806306fdde0314610279578063095ea7b314610297578063176d5dfa146102b757806318160ddd146102d75780631816a758146102ec575b600080fd5b61028161058c565b60405161028e9190612cc5565b60405180910390f35b6102aa6102a5366004612947565b610622565b60405161028e9190612cac565b6102ca6102c5366004612bf0565b610640565b60405161028e9190612cb7565b6102df610688565b60405161028e9190612ef2565b6102ff6102fa366004612c34565b61068e565b005b6102aa61030f3660046128da565b61073b565b61031c610769565b60405161028e9190612f12565b6102aa610337366004612b78565b610772565b6102aa61034a366004612947565b6107a6565b6103576107f9565b60405161028e9190612c98565b6102ff610372366004612b78565b610808565b6102aa610385366004612886565b61086a565b6102df61087f565b6102ff6103a036600461291a565b61088b565b6102ff6103b3366004612a4f565b610913565b6102ca6103c6366004612ac6565b6109dd565b6102df6103d9366004612b78565b610a15565b6102aa6103ec366004612886565b610a69565b6102df6103ff366004612886565b610a7e565b6102ff610a99565b6102ff61041a366004612b78565b610b46565b610357610ba8565b6102ff610435366004612972565b610bbc565b6102df610448366004612b78565b610d87565b610281610da8565b610357610e09565b6102ff61046b366004612b78565b610e18565b6102aa61047e366004612947565b610e81565b6102aa610491366004612947565b610ee9565b6102ff6104a4366004612a33565b610ef6565b6102aa6104b7366004612b78565b6113c4565b6103576113ee565b6104cc6113fd565b60405161028e9190612ee2565b6102df6104e7366004612886565b61140f565b61035761142a565b6102df611439565b6102df61050a3660046128a2565b61143f565b6102ff61146a565b61052a610525366004612b78565b611830565b60405161028e929190612efb565b6102aa610546366004612886565b611852565b610357610559366004612b78565b611867565b6102aa611882565b6102ff610574366004612886565b61188b565b6102ff61058736600461291a565b611994565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106185780601f106105ed57610100808354040283529160200191610618565b820191906000526020600020905b8154815290600101906020018083116105fb57829003601f168201915b5050505050905090565b600061063661062f611bc4565b8484611bc8565b5060015b92915050565b600c828154811061065057600080fd5b90600052602060002001816002811061066857600080fd5b600a9182820401919006600302915091509054906101000a900460020b81565b60025490565b610696611bc4565b60055461010090046001600160a01b039081169116146106eb576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6113888411156106fa57600080fd5b61138883111561070957600080fd5b61138882111561071857600080fd5b61271081111561072757600080fd5b600693909355600791909155600855600955565b6000610748848484611cb4565b5061075f843384610759883361143f565b03611bc8565b5060019392505050565b60055460ff1690565b600e818154811061078257600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b60006106366107b3611bc4565b846107f485600160006107c4611bc4565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611a1c565b611bc8565b6018546001600160a01b031681565b610810611bc4565b60055461010090046001600160a01b03908116911614610865576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601c55565b600b6020526000908152604090205460ff1681565b670de0b6b3a763ffff81565b610893611bc4565b60055461010090046001600160a01b039081169116146108e8576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b61091b611bc4565b60055461010090046001600160a01b03908116911614610970576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601580546001600160a01b03199081166001600160a01b039788161790915560178054821695871695909517909455601880548516938616939093179092556016805490931693169290921762ffffff60a01b1916600160a01b62ffffff90931692909202919091179055565b6000808260020b1215610a02576109f882600003603c611e50565b6000039050610a10565b610a0d82603c611e50565b90505b919050565b60006012670de0b6b3a7640000830660035b82811015610a6157808303600a0a808381610a3e57fe5b06610a5857808381610a4c57fe5b04945050505050610a10565b50600101610a27565b509392505050565b601b6020526000908152604090205460ff1681565b6001600160a01b031660009081526020819052604090205490565b610aa1611bc4565b60055461010090046001600160a01b03908116911614610af6576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b610b4e611bc4565b60055461010090046001600160a01b03908116911614610ba3576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601455565b60055461010090046001600160a01b031690565b610bc4611bc4565b60055461010090046001600160a01b03908116911614610c19576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b8483148015610c2757508281145b610c3057600080fd5b60405180608001604052806001151581526020018787808060200260200160405190810160405280939291908181526020016000905b82821015610ca45760408051808201825290808402870190600290839083908082843760009201919091525050508152600190910190602001610c66565b50505050508152602001858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020858102828101820190935285825292830192909186918691829185019084908082843760009201919091525050509152508051600f805460ff19169115159190911781556020808301518051610d44926010920190612526565b5060408201518051610d60916002840191602090910190612579565b5060608201518051610d7c9160038401916020909101906125c0565b505050505050505050565b600d8181548110610d9757600080fd5b600091825260209091200154905081565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106185780601f106105ed57610100808354040283529160200191610618565b6016546001600160a01b031681565b610e20611bc4565b60055461010090046001600160a01b03908116911614610e75576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b610e7e81611ea2565b50565b6000610636610e8e611bc4565b846107f48560405180606001604052806025815260200161304d6025913960016000610eb8611bc4565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611f9d565b600061075f338484611cb4565b610efe611bc4565b60055461010090046001600160a01b03908116911614610f53576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601454610f5f30610a7e565b10610f6f57610f6f6103e8611ea2565b80156110105760005b600c5481101561100e576000818152601360205260409020541561100657600081815260136020908152604091829020825180840190935280548352600101546001600160801b031690820152610fce90612034565b600081815260136020908152604091829020825180840190935280548352600101546001600160801b031690820152611006906120ee565b600101610f78565b505b60165460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b15801561105557600080fd5b505afa158015611069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108d9190612ae2565b50506018546040516370a0823160e01b8152949650600095506001600160a01b0316936370a0823193506110c79250309150600401612c98565b60206040518083038186803b1580156110df57600080fd5b505afa1580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111179190612b90565b9050600061112430610a7e565b905061112e612144565b6000805b600c548110156113bc57600e818154811061114957fe5b90600052602060002090602091828204019190069054906101000a900460ff16156112945761271083600d838154811061117f57fe5b9060005260206000200154028161119257fe5b0491508115611245576000806111f0600c84815481106111ae57fe5b600091825260209091200154600c805460029290920b8a0191869081106111d157fe5b60009182526020822001546301000000900460020b8a0190879061218f565b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b031916929091169190911790555061128f9050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b6113b4565b61271084600d83815481106112a557fe5b906000526020600020015402816112b857fe5b049150811561136a57600080611315600c84815481106112d457fe5b600091825260209091200154600c805460029290920b8a0191869081106112f757fe5b60009182526020822001546301000000900460020b8a01908761218f565b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b03191692909116919091179055506113b49050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b600101611132565b505050505050565b6000806113d083611867565b6001600160a01b0316146113e657506001610a10565b506000919050565b6015546001600160a01b031681565b601654600160a01b900462ffffff1681565b6001600160a01b031660009081526019602052604090205490565b6017546001600160a01b031681565b601c5481565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611472611bc4565b60055461010090046001600160a01b039081169116146114c7576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601d5460ff16156114f35760405162461bcd60e51b81526004016114ea90612d18565b60405180910390fd5b601d805460ff1916600117905560165460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b15801561154557600080fd5b505afa158015611559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157d9190612ae2565b50506018546040516370a0823160e01b8152949650600095506001600160a01b0316936370a0823193506115b79250309150600401612c98565b60206040518083038186803b1580156115cf57600080fd5b505afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190612b90565b9050600061161430610a7e565b905061161e612144565b6000805b600c5481101561182957600e818154811061163957fe5b90600052602060002090602091828204019190069054906101000a900460ff16156117425761271083600d838154811061166f57fe5b9060005260206000200154028161168257fe5b04915081156116f35760008061169e600c84815481106111ae57fe5b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b031916929091169190911790555061173d9050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b611821565b61271084600d838154811061175357fe5b9060005260206000200154028161176657fe5b04915081156117d757600080611782600c84815481106112d457fe5b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b03191692909116919091179055506118219050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b600101611622565b5050505050565b601360205260009081526040902080546001909101546001600160801b031682565b600a6020526000908152604090205460ff1681565b6000908152601a60205260409020546001600160a01b031690565b600f5460ff1681565b611893611bc4565b60055461010090046001600160a01b039081169116146118e8576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6001600160a01b03811661192d5760405162461bcd60e51b8152600401808060200182810382526026815260200180612f766026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b61199c611bc4565b60055461010090046001600160a01b039081169116146119f1576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600082820183811015611a76576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b60208310611af95780518252601f199092019160209182019101611ada565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611b5b576040519150601f19603f3d011682016040523d82523d6000602084013e611b60565b606091505b5091509150818015611b8e575080511580611b8e5750808060200190516020811015611b8b57600080fd5b50515b611829576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b3390565b6001600160a01b038316611c0d5760405162461bcd60e51b81526004018080602001828103825260248152602001806130296024913960400191505060405180910390fd5b6001600160a01b038216611c525760405162461bcd60e51b8152600401808060200182810382526022815260200180612f9c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166000908152600a602052604081205460ff16158015611cf657506001600160a01b0383166000908152600a602052604090205460ff16155b8015611d1a57506001600160a01b0384166000908152600b602052604090205460ff165b15611e3357600080611d2b84610a15565b6001600160a01b0386166000908152601b602052604090205490915060ff16158015611d5b5750611d5b816113c4565b8015611d78575032611d6c82611867565b6001600160a01b031614155b15611ddc576001600160a01b0385166000908152601b60205260409020805460ff191660011790556007546127109085020491506000612710600854840281611dbd57fe5b049050611dd387611dcd84611867565b836122f2565b90910390611def565b612710600654850281611deb57fe5b0491505b6000612710600954840281611e0057fe5b049050808303611e1388888689036122f2565b611e1e8830846122f2565b611e2a88611dcd610ba8565b50505050611e3e565b611e3e8484846122f2565b61075f83611e4b85610a7e565b61244d565b600080828360020b60018587010360020b81611e6857fe5b05029050828103611e7d81860360020b6124c9565b611e8b83870360020b6124c9565b1015611e995750905061063a565b915061063a9050565b6040805161010081018252308082526018546001600160a01b03166020830152601654600160a01b900462ffffff16928201929092526060810182905242608082015260009160a08201906103e8908590611efc90610a7e565b0281611f0457fe5b048152600060208201819052604091820152601754905163414bf38960e01b81529192506001600160a01b03169063414bf38990611f46908490600401612dcb565b602060405180830381600087803b158015611f6057600080fd5b505af1158015611f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f989190612b90565b505050565b6000818484111561202c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ff1578181015183820152602001611fd9565b50505050905090810190601f16801561201e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6040805160a081018252825181526020808401516001600160801b031690820152600081830181905260608201524260808201526015549151630624e65f60e11b815290916001600160a01b031690630c49ccbe90612097908490600401612d88565b6040805180830381600087803b1580156120b057600080fd5b505af11580156120c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e89190612c11565b50505050565b60408051608081018252825181523060208201526001600160801b038183018190526060820152601554915163fc6f786560e01b815290916001600160a01b03169063fc6f786590612097908490600401612d45565b600f5460ff161561218d576010805461215f91600c91612660565b506011805461217091600d916126a9565b506012805461218191600e916126e9565b50600f805460ff191690555b565b60008061219b866109dd565b95506121a6856109dd565b6018549095506000908190819081906001600160a01b03163010156121df5750506018543092506001600160a01b0316905085856121f5565b50506018546001600160a01b0316915030905084865b60408051610160810182526001600160a01b0386811682528581166020830152601654600160a01b900462ffffff168284015260028d810b60608401528c900b608083015260a0820185905260c08201849052600060e0830181905261010083015230610120830152426101408301526015549251634418b22b60e11b81529192169063883164569061228c908490600401612e34565b608060405180830381600087803b1580156122a657600080fd5b505af11580156122ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122de9190612ba8565b50919d909c509a5050505050505050505050565b6001600160a01b0383166123375760405162461bcd60e51b81526004018080602001828103825260258152602001806130046025913960400191505060405180910390fd5b6001600160a01b03821661237c5760405162461bcd60e51b8152600401808060200182810382526023815260200180612f536023913960400191505060405180910390fd5b612387838383611f98565b6123c481604051806060016040528060268152602001612fbe602691396001600160a01b0386166000908152602081905260409020549190611f9d565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546123f39082611a1c565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b03821660009081526019602052604090205415612470576124c5565b601c5481101561247f576124c5565b60006124896124e0565b6001600160a01b0384166000818152601960209081526040808320859055938252601a90529190912080546001600160a01b0319169091179055505b5050565b6000808212156124dc5781600003610a0d565b5090565b6000670de0b6b3a763ffff44424560405160200161250093929190612c82565b6040516020818303038152906040528051906020012060001c8161252057fe5b06905090565b82805482825590600052602060002090810192821561256d579160200282015b8281111561256d57825161255d9083906002612736565b5091602001919060010190612546565b506124dc9291506127c0565b8280548282559060005260206000209081019282156125b4579160200282015b828111156125b4578251825591602001919060010190612599565b506124dc9291506127dd565b82805482825590600052602060002090601f016020900481019282156125b45791602002820160005b8382111561262657835183826101000a81548160ff02191690831515021790555092602001926001016020816000010492830192600103026125e9565b80156126535782816101000a81549060ff0219169055600101602081600001049283019260010302612626565b50506124dc9291506127dd565b82805482825590600052602060002090810192821561256d5760005260206000209182015b8281111561256d57612699828460026127f2565b5091600101919060010190612685565b8280548282559060005260206000209081019282156125b45760005260206000209182015b828111156125b45782548255916001019190600101906126ce565b82805482825590600052602060002090601f016020900481019282156125b457600052602060002091601f01602090048201828111156125b45782548255916001019190600101906126ce565b6001830191839082156125b45791602002820160005b8382111561279157835183826101000a81548162ffffff021916908360020b62ffffff160217905550926020019260030160208160020104928301926001030261274c565b80156126535782816101000a81549062ffffff0219169055600301602081600201049283019260010302612791565b808211156124dc5760006127d48282612824565b506001016127c0565b5b808211156124dc57600081556001016127de565b6001830191839082156125b45791600901600a90048201828111156125b45782548255916001019190600101906126ce565b5060009055565b60008083601f84011261283c578182fd5b50813567ffffffffffffffff811115612853578182fd5b602083019150836020808302850101111561286d57600080fd5b9250929050565b805161ffff81168114610a1057600080fd5b600060208284031215612897578081fd5b8135611a7681612f20565b600080604083850312156128b4578081fd5b82356128bf81612f20565b915060208301356128cf81612f20565b809150509250929050565b6000806000606084860312156128ee578081fd5b83356128f981612f20565b9250602084013561290981612f20565b929592945050506040919091013590565b6000806040838503121561292c578182fd5b823561293781612f20565b915060208301356128cf81612f35565b60008060408385031215612959578182fd5b823561296481612f20565b946020939093013593505050565b6000806000806000806060878903121561298a578182fd5b863567ffffffffffffffff808211156129a1578384fd5b818901915089601f8301126129b4578384fd5b8135818111156129c2578485fd5b8a60206040830285010111156129d6578485fd5b6020928301985096509088013590808211156129f0578384fd5b6129fc8a838b0161282b565b90965094506040890135915080821115612a14578384fd5b50612a2189828a0161282b565b979a9699509497509295939492505050565b600060208284031215612a44578081fd5b8135611a7681612f35565b600080600080600060a08688031215612a66578081fd5b8535612a7181612f20565b94506020860135612a8181612f20565b93506040860135612a9181612f20565b92506060860135612aa181612f20565b9150608086013562ffffff81168114612ab8578182fd5b809150509295509295909350565b600060208284031215612ad7578081fd5b8135611a7681612f43565b600080600080600080600060e0888a031215612afc578485fd5b8751612b0781612f20565b6020890151909750612b1881612f43565b9550612b2660408901612874565b9450612b3460608901612874565b9350612b4260808901612874565b925060a088015160ff81168114612b57578182fd5b60c0890151909250612b6881612f35565b8091505092959891949750929550565b600060208284031215612b89578081fd5b5035919050565b600060208284031215612ba1578081fd5b5051919050565b60008060008060808587031215612bbd578182fd5b8451935060208501516001600160801b0381168114612bda578283fd5b6040860151606090960151949790965092505050565b60008060408385031215612c02578182fd5b50508035926020909101359150565b60008060408385031215612c23578182fd5b505080516020909101519092909150565b60008060008060808587031215612c49578182fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b03169052565b60020b9052565b62ffffff169052565b9283526020830191909152604082015260600190565b6001600160a01b0391909116815260200190565b901515815260200190565b60029190910b815260200190565b6000602080835283518082850152825b81811015612cf157858101830151858201604001528201612cd5565b81811115612d025783604083870101525b50601f01601f1916929092016040019392505050565b602080825260139082015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604082015260600190565b815181526020808301516001600160a01b0316908201526040808301516001600160801b0390811691830191909152606092830151169181019190915260800190565b600060a082019050825182526001600160801b03602084015116602083015260408301516040830152606083015160608301526080830151608083015292915050565b81516001600160a01b03908116825260208084015182169083015260408084015162ffffff16908301526060808401518216908301526080808401519083015260a0838101519083015260c0808401519083015260e09283015116918101919091526101000190565b600061016082019050612e48828451612c65565b6020830151612e5a6020840182612c65565b506040830151612e6d6040840182612c79565b506060830151612e806060840182612c72565b506080830151612e936080840182612c72565b5060a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525061012080840151612ed182850182612c65565b505061014092830151919092015290565b62ffffff91909116815260200190565b90815260200190565b9182526001600160801b0316602082015260400190565b60ff91909116815260200190565b6001600160a01b0381168114610e7e57600080fd5b8015158114610e7e57600080fd5b8060020b8114610e7e57600080fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208b0bd7614b730f73f2245568933285467b2ca515743fe722b50127f49abbe46664736f6c6343000706003300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88000000000000000000000000e592427a0aece92de3edee1f18e0157c058615640000000000000000000000000000000000000000000000000000000000000011426c6f6f6d696e672043616c616d6974790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005424c4f4f4d000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102745760003560e01c80638dfa070211610151578063c2cbeb88116100c3578063e404152811610087578063e404152814610517578063e7df561814610538578063e7f339891461054b578063e7f404c01461055e578063f2fde38b14610566578063f680cf491461057957610274565b8063c2cbeb88146104d9578063c31c9c07146104ec578063dc0ab640146104f4578063dd62ed3e146104fc578063e1c7392a1461050f57610274565b8063a457c2d711610115578063a457c2d714610470578063a9059cbb14610483578063b01a3a2b14610496578063b1ff66d8146104a9578063b44a2722146104bc578063ba43db50146104c457610274565b80638dfa070214610427578063955c422f1461043a57806395d89b411461044d5780639808797c146104555780639dd4becb1461045d57610274565b80634e0014d6116101ea5780636970fafa116101ae5780636970fafa146103cb5780636a1363d9146103de57806370a08231146103f1578063715018a6146104045780637f254b921461040c5780638da5cb5b1461041f57610274565b80634e0014d6146103775780634f4a4e331461038a578063540ba09e146103925780635e3ecb35146103a557806364ae74a9146103b857610274565b806323b872dd1161023c57806323b872dd14610301578063313ce5671461031457806333efd83614610329578063395093511461033c5780633de35b791461034f578063465738ad1461036457610274565b806306fdde0314610279578063095ea7b314610297578063176d5dfa146102b757806318160ddd146102d75780631816a758146102ec575b600080fd5b61028161058c565b60405161028e9190612cc5565b60405180910390f35b6102aa6102a5366004612947565b610622565b60405161028e9190612cac565b6102ca6102c5366004612bf0565b610640565b60405161028e9190612cb7565b6102df610688565b60405161028e9190612ef2565b6102ff6102fa366004612c34565b61068e565b005b6102aa61030f3660046128da565b61073b565b61031c610769565b60405161028e9190612f12565b6102aa610337366004612b78565b610772565b6102aa61034a366004612947565b6107a6565b6103576107f9565b60405161028e9190612c98565b6102ff610372366004612b78565b610808565b6102aa610385366004612886565b61086a565b6102df61087f565b6102ff6103a036600461291a565b61088b565b6102ff6103b3366004612a4f565b610913565b6102ca6103c6366004612ac6565b6109dd565b6102df6103d9366004612b78565b610a15565b6102aa6103ec366004612886565b610a69565b6102df6103ff366004612886565b610a7e565b6102ff610a99565b6102ff61041a366004612b78565b610b46565b610357610ba8565b6102ff610435366004612972565b610bbc565b6102df610448366004612b78565b610d87565b610281610da8565b610357610e09565b6102ff61046b366004612b78565b610e18565b6102aa61047e366004612947565b610e81565b6102aa610491366004612947565b610ee9565b6102ff6104a4366004612a33565b610ef6565b6102aa6104b7366004612b78565b6113c4565b6103576113ee565b6104cc6113fd565b60405161028e9190612ee2565b6102df6104e7366004612886565b61140f565b61035761142a565b6102df611439565b6102df61050a3660046128a2565b61143f565b6102ff61146a565b61052a610525366004612b78565b611830565b60405161028e929190612efb565b6102aa610546366004612886565b611852565b610357610559366004612b78565b611867565b6102aa611882565b6102ff610574366004612886565b61188b565b6102ff61058736600461291a565b611994565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106185780601f106105ed57610100808354040283529160200191610618565b820191906000526020600020905b8154815290600101906020018083116105fb57829003601f168201915b5050505050905090565b600061063661062f611bc4565b8484611bc8565b5060015b92915050565b600c828154811061065057600080fd5b90600052602060002001816002811061066857600080fd5b600a9182820401919006600302915091509054906101000a900460020b81565b60025490565b610696611bc4565b60055461010090046001600160a01b039081169116146106eb576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6113888411156106fa57600080fd5b61138883111561070957600080fd5b61138882111561071857600080fd5b61271081111561072757600080fd5b600693909355600791909155600855600955565b6000610748848484611cb4565b5061075f843384610759883361143f565b03611bc8565b5060019392505050565b60055460ff1690565b600e818154811061078257600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b60006106366107b3611bc4565b846107f485600160006107c4611bc4565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611a1c565b611bc8565b6018546001600160a01b031681565b610810611bc4565b60055461010090046001600160a01b03908116911614610865576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601c55565b600b6020526000908152604090205460ff1681565b670de0b6b3a763ffff81565b610893611bc4565b60055461010090046001600160a01b039081169116146108e8576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b61091b611bc4565b60055461010090046001600160a01b03908116911614610970576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601580546001600160a01b03199081166001600160a01b039788161790915560178054821695871695909517909455601880548516938616939093179092556016805490931693169290921762ffffff60a01b1916600160a01b62ffffff90931692909202919091179055565b6000808260020b1215610a02576109f882600003603c611e50565b6000039050610a10565b610a0d82603c611e50565b90505b919050565b60006012670de0b6b3a7640000830660035b82811015610a6157808303600a0a808381610a3e57fe5b06610a5857808381610a4c57fe5b04945050505050610a10565b50600101610a27565b509392505050565b601b6020526000908152604090205460ff1681565b6001600160a01b031660009081526020819052604090205490565b610aa1611bc4565b60055461010090046001600160a01b03908116911614610af6576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b610b4e611bc4565b60055461010090046001600160a01b03908116911614610ba3576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601455565b60055461010090046001600160a01b031690565b610bc4611bc4565b60055461010090046001600160a01b03908116911614610c19576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b8483148015610c2757508281145b610c3057600080fd5b60405180608001604052806001151581526020018787808060200260200160405190810160405280939291908181526020016000905b82821015610ca45760408051808201825290808402870190600290839083908082843760009201919091525050508152600190910190602001610c66565b50505050508152602001858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020858102828101820190935285825292830192909186918691829185019084908082843760009201919091525050509152508051600f805460ff19169115159190911781556020808301518051610d44926010920190612526565b5060408201518051610d60916002840191602090910190612579565b5060608201518051610d7c9160038401916020909101906125c0565b505050505050505050565b600d8181548110610d9757600080fd5b600091825260209091200154905081565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106185780601f106105ed57610100808354040283529160200191610618565b6016546001600160a01b031681565b610e20611bc4565b60055461010090046001600160a01b03908116911614610e75576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b610e7e81611ea2565b50565b6000610636610e8e611bc4565b846107f48560405180606001604052806025815260200161304d6025913960016000610eb8611bc4565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611f9d565b600061075f338484611cb4565b610efe611bc4565b60055461010090046001600160a01b03908116911614610f53576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601454610f5f30610a7e565b10610f6f57610f6f6103e8611ea2565b80156110105760005b600c5481101561100e576000818152601360205260409020541561100657600081815260136020908152604091829020825180840190935280548352600101546001600160801b031690820152610fce90612034565b600081815260136020908152604091829020825180840190935280548352600101546001600160801b031690820152611006906120ee565b600101610f78565b505b60165460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b15801561105557600080fd5b505afa158015611069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108d9190612ae2565b50506018546040516370a0823160e01b8152949650600095506001600160a01b0316936370a0823193506110c79250309150600401612c98565b60206040518083038186803b1580156110df57600080fd5b505afa1580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111179190612b90565b9050600061112430610a7e565b905061112e612144565b6000805b600c548110156113bc57600e818154811061114957fe5b90600052602060002090602091828204019190069054906101000a900460ff16156112945761271083600d838154811061117f57fe5b9060005260206000200154028161119257fe5b0491508115611245576000806111f0600c84815481106111ae57fe5b600091825260209091200154600c805460029290920b8a0191869081106111d157fe5b60009182526020822001546301000000900460020b8a0190879061218f565b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b031916929091169190911790555061128f9050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b6113b4565b61271084600d83815481106112a557fe5b906000526020600020015402816112b857fe5b049150811561136a57600080611315600c84815481106112d457fe5b600091825260209091200154600c805460029290920b8a0191869081106112f757fe5b60009182526020822001546301000000900460020b8a01908761218f565b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b03191692909116919091179055506113b49050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b600101611132565b505050505050565b6000806113d083611867565b6001600160a01b0316146113e657506001610a10565b506000919050565b6015546001600160a01b031681565b601654600160a01b900462ffffff1681565b6001600160a01b031660009081526019602052604090205490565b6017546001600160a01b031681565b601c5481565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611472611bc4565b60055461010090046001600160a01b039081169116146114c7576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b601d5460ff16156114f35760405162461bcd60e51b81526004016114ea90612d18565b60405180910390fd5b601d805460ff1916600117905560165460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b15801561154557600080fd5b505afa158015611559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157d9190612ae2565b50506018546040516370a0823160e01b8152949650600095506001600160a01b0316936370a0823193506115b79250309150600401612c98565b60206040518083038186803b1580156115cf57600080fd5b505afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190612b90565b9050600061161430610a7e565b905061161e612144565b6000805b600c5481101561182957600e818154811061163957fe5b90600052602060002090602091828204019190069054906101000a900460ff16156117425761271083600d838154811061166f57fe5b9060005260206000200154028161168257fe5b04915081156116f35760008061169e600c84815481106111ae57fe5b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b031916929091169190911790555061173d9050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b611821565b61271084600d838154811061175357fe5b9060005260206000200154028161176657fe5b04915081156117d757600080611782600c84815481106112d457fe5b6040805180820182529283526001600160801b03918216602080850191825260008881526013909152919091209251835551600190920180546001600160801b03191692909116919091179055506118219050565b604080518082018252600080825260208083018281528583526013909152929020905181559051600190910180546001600160801b0319166001600160801b039092169190911790555b600101611622565b5050505050565b601360205260009081526040902080546001909101546001600160801b031682565b600a6020526000908152604090205460ff1681565b6000908152601a60205260409020546001600160a01b031690565b600f5460ff1681565b611893611bc4565b60055461010090046001600160a01b039081169116146118e8576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6001600160a01b03811661192d5760405162461bcd60e51b8152600401808060200182810382526026815260200180612f766026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b61199c611bc4565b60055461010090046001600160a01b039081169116146119f1576040805162461bcd60e51b81526020600482018190526024820152600080516020612fe4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600082820183811015611a76576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b60208310611af95780518252601f199092019160209182019101611ada565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611b5b576040519150601f19603f3d011682016040523d82523d6000602084013e611b60565b606091505b5091509150818015611b8e575080511580611b8e5750808060200190516020811015611b8b57600080fd5b50515b611829576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b3390565b6001600160a01b038316611c0d5760405162461bcd60e51b81526004018080602001828103825260248152602001806130296024913960400191505060405180910390fd5b6001600160a01b038216611c525760405162461bcd60e51b8152600401808060200182810382526022815260200180612f9c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166000908152600a602052604081205460ff16158015611cf657506001600160a01b0383166000908152600a602052604090205460ff16155b8015611d1a57506001600160a01b0384166000908152600b602052604090205460ff165b15611e3357600080611d2b84610a15565b6001600160a01b0386166000908152601b602052604090205490915060ff16158015611d5b5750611d5b816113c4565b8015611d78575032611d6c82611867565b6001600160a01b031614155b15611ddc576001600160a01b0385166000908152601b60205260409020805460ff191660011790556007546127109085020491506000612710600854840281611dbd57fe5b049050611dd387611dcd84611867565b836122f2565b90910390611def565b612710600654850281611deb57fe5b0491505b6000612710600954840281611e0057fe5b049050808303611e1388888689036122f2565b611e1e8830846122f2565b611e2a88611dcd610ba8565b50505050611e3e565b611e3e8484846122f2565b61075f83611e4b85610a7e565b61244d565b600080828360020b60018587010360020b81611e6857fe5b05029050828103611e7d81860360020b6124c9565b611e8b83870360020b6124c9565b1015611e995750905061063a565b915061063a9050565b6040805161010081018252308082526018546001600160a01b03166020830152601654600160a01b900462ffffff16928201929092526060810182905242608082015260009160a08201906103e8908590611efc90610a7e565b0281611f0457fe5b048152600060208201819052604091820152601754905163414bf38960e01b81529192506001600160a01b03169063414bf38990611f46908490600401612dcb565b602060405180830381600087803b158015611f6057600080fd5b505af1158015611f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f989190612b90565b505050565b6000818484111561202c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ff1578181015183820152602001611fd9565b50505050905090810190601f16801561201e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6040805160a081018252825181526020808401516001600160801b031690820152600081830181905260608201524260808201526015549151630624e65f60e11b815290916001600160a01b031690630c49ccbe90612097908490600401612d88565b6040805180830381600087803b1580156120b057600080fd5b505af11580156120c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e89190612c11565b50505050565b60408051608081018252825181523060208201526001600160801b038183018190526060820152601554915163fc6f786560e01b815290916001600160a01b03169063fc6f786590612097908490600401612d45565b600f5460ff161561218d576010805461215f91600c91612660565b506011805461217091600d916126a9565b506012805461218191600e916126e9565b50600f805460ff191690555b565b60008061219b866109dd565b95506121a6856109dd565b6018549095506000908190819081906001600160a01b03163010156121df5750506018543092506001600160a01b0316905085856121f5565b50506018546001600160a01b0316915030905084865b60408051610160810182526001600160a01b0386811682528581166020830152601654600160a01b900462ffffff168284015260028d810b60608401528c900b608083015260a0820185905260c08201849052600060e0830181905261010083015230610120830152426101408301526015549251634418b22b60e11b81529192169063883164569061228c908490600401612e34565b608060405180830381600087803b1580156122a657600080fd5b505af11580156122ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122de9190612ba8565b50919d909c509a5050505050505050505050565b6001600160a01b0383166123375760405162461bcd60e51b81526004018080602001828103825260258152602001806130046025913960400191505060405180910390fd5b6001600160a01b03821661237c5760405162461bcd60e51b8152600401808060200182810382526023815260200180612f536023913960400191505060405180910390fd5b612387838383611f98565b6123c481604051806060016040528060268152602001612fbe602691396001600160a01b0386166000908152602081905260409020549190611f9d565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546123f39082611a1c565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b03821660009081526019602052604090205415612470576124c5565b601c5481101561247f576124c5565b60006124896124e0565b6001600160a01b0384166000818152601960209081526040808320859055938252601a90529190912080546001600160a01b0319169091179055505b5050565b6000808212156124dc5781600003610a0d565b5090565b6000670de0b6b3a763ffff44424560405160200161250093929190612c82565b6040516020818303038152906040528051906020012060001c8161252057fe5b06905090565b82805482825590600052602060002090810192821561256d579160200282015b8281111561256d57825161255d9083906002612736565b5091602001919060010190612546565b506124dc9291506127c0565b8280548282559060005260206000209081019282156125b4579160200282015b828111156125b4578251825591602001919060010190612599565b506124dc9291506127dd565b82805482825590600052602060002090601f016020900481019282156125b45791602002820160005b8382111561262657835183826101000a81548160ff02191690831515021790555092602001926001016020816000010492830192600103026125e9565b80156126535782816101000a81549060ff0219169055600101602081600001049283019260010302612626565b50506124dc9291506127dd565b82805482825590600052602060002090810192821561256d5760005260206000209182015b8281111561256d57612699828460026127f2565b5091600101919060010190612685565b8280548282559060005260206000209081019282156125b45760005260206000209182015b828111156125b45782548255916001019190600101906126ce565b82805482825590600052602060002090601f016020900481019282156125b457600052602060002091601f01602090048201828111156125b45782548255916001019190600101906126ce565b6001830191839082156125b45791602002820160005b8382111561279157835183826101000a81548162ffffff021916908360020b62ffffff160217905550926020019260030160208160020104928301926001030261274c565b80156126535782816101000a81549062ffffff0219169055600301602081600201049283019260010302612791565b808211156124dc5760006127d48282612824565b506001016127c0565b5b808211156124dc57600081556001016127de565b6001830191839082156125b45791600901600a90048201828111156125b45782548255916001019190600101906126ce565b5060009055565b60008083601f84011261283c578182fd5b50813567ffffffffffffffff811115612853578182fd5b602083019150836020808302850101111561286d57600080fd5b9250929050565b805161ffff81168114610a1057600080fd5b600060208284031215612897578081fd5b8135611a7681612f20565b600080604083850312156128b4578081fd5b82356128bf81612f20565b915060208301356128cf81612f20565b809150509250929050565b6000806000606084860312156128ee578081fd5b83356128f981612f20565b9250602084013561290981612f20565b929592945050506040919091013590565b6000806040838503121561292c578182fd5b823561293781612f20565b915060208301356128cf81612f35565b60008060408385031215612959578182fd5b823561296481612f20565b946020939093013593505050565b6000806000806000806060878903121561298a578182fd5b863567ffffffffffffffff808211156129a1578384fd5b818901915089601f8301126129b4578384fd5b8135818111156129c2578485fd5b8a60206040830285010111156129d6578485fd5b6020928301985096509088013590808211156129f0578384fd5b6129fc8a838b0161282b565b90965094506040890135915080821115612a14578384fd5b50612a2189828a0161282b565b979a9699509497509295939492505050565b600060208284031215612a44578081fd5b8135611a7681612f35565b600080600080600060a08688031215612a66578081fd5b8535612a7181612f20565b94506020860135612a8181612f20565b93506040860135612a9181612f20565b92506060860135612aa181612f20565b9150608086013562ffffff81168114612ab8578182fd5b809150509295509295909350565b600060208284031215612ad7578081fd5b8135611a7681612f43565b600080600080600080600060e0888a031215612afc578485fd5b8751612b0781612f20565b6020890151909750612b1881612f43565b9550612b2660408901612874565b9450612b3460608901612874565b9350612b4260808901612874565b925060a088015160ff81168114612b57578182fd5b60c0890151909250612b6881612f35565b8091505092959891949750929550565b600060208284031215612b89578081fd5b5035919050565b600060208284031215612ba1578081fd5b5051919050565b60008060008060808587031215612bbd578182fd5b8451935060208501516001600160801b0381168114612bda578283fd5b6040860151606090960151949790965092505050565b60008060408385031215612c02578182fd5b50508035926020909101359150565b60008060408385031215612c23578182fd5b505080516020909101519092909150565b60008060008060808587031215612c49578182fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b03169052565b60020b9052565b62ffffff169052565b9283526020830191909152604082015260600190565b6001600160a01b0391909116815260200190565b901515815260200190565b60029190910b815260200190565b6000602080835283518082850152825b81811015612cf157858101830151858201604001528201612cd5565b81811115612d025783604083870101525b50601f01601f1916929092016040019392505050565b602080825260139082015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604082015260600190565b815181526020808301516001600160a01b0316908201526040808301516001600160801b0390811691830191909152606092830151169181019190915260800190565b600060a082019050825182526001600160801b03602084015116602083015260408301516040830152606083015160608301526080830151608083015292915050565b81516001600160a01b03908116825260208084015182169083015260408084015162ffffff16908301526060808401518216908301526080808401519083015260a0838101519083015260c0808401519083015260e09283015116918101919091526101000190565b600061016082019050612e48828451612c65565b6020830151612e5a6020840182612c65565b506040830151612e6d6040840182612c79565b506060830151612e806060840182612c72565b506080830151612e936080840182612c72565b5060a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525061012080840151612ed182850182612c65565b505061014092830151919092015290565b62ffffff91909116815260200190565b90815260200190565b9182526001600160801b0316602082015260400190565b60ff91909116815260200190565b6001600160a01b0381168114610e7e57600080fd5b8015158114610e7e57600080fd5b8060020b8114610e7e57600080fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208b0bd7614b730f73f2245568933285467b2ca515743fe722b50127f49abbe46664736f6c63430007060033

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

00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88000000000000000000000000e592427a0aece92de3edee1f18e0157c058615640000000000000000000000000000000000000000000000000000000000000011426c6f6f6d696e672043616c616d6974790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005424c4f4f4d000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _name (string): Blooming Calamity
Arg [1] : _symbol (string): BLOOM
Arg [2] : _pairToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [3] : _nonfungiblePositionManager (address): 0xC36442b4a4522E871399CD717aBDD847Ab11FE88
Arg [4] : _swapRouter (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [3] : 000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88
Arg [4] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000011
Arg [6] : 426c6f6f6d696e672043616c616d697479000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [8] : 424c4f4f4d000000000000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.