ETH Price: $3,263.68 (+1.31%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Swap Without Loa...154102662022-08-25 16:56:14889 days ago1661446574IN
0x470Aa7Ca...E321a4a16
0 ETH0.0056706145.71527105
Update MEV User154102632022-08-25 16:55:08889 days ago1661446508IN
0x470Aa7Ca...E321a4a16
0 ETH0.0012984944.32620104
Swap Without Loa...154102582022-08-25 16:54:02889 days ago1661446442IN
0x470Aa7Ca...E321a4a16
0 ETH0.0011749148.63060527

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MevTest

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : MevTest.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.9;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IUniswapV2Router01} from "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol";
import {IUniswapV2Pair} from "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import {IUniswapV2Factory} from "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import {ILendingPool, ILendingPoolAddressesProvider} from "./interfaces/Interfaces.sol";
import {IFlashLoanReceiver, ILendingPoolAddressesProvider, ILendingPool} from "./interfaces/Interfaces.sol";
import {IWETH} from "./interfaces/IWETH.sol";
import {ISwapRouter} from "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import {IQuoter} from "@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol";
import {IUniswapV3Factory} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol";
import "./libraries/TransferHelper.sol";

/************
    This contract only works for v2 LP contracts.  Uniswap v3 contracts are not supported. 
***********/
contract MevTest is Ownable, ReentrancyGuard, IFlashLoanReceiver {
    using SafeERC20 for IERC20;
    uint256 public deadline = 20e18;
    address public mevUser;
    ILendingPoolAddressesProvider public immutable addressProvider;
    ILendingPool public immutable lendingPool;
    address public token0;
    address public token1;
    address public poolA;
    address public poolB;
    address public poolC;
    address constant factoryA = 0x1F98431c8aD98523631AE4a59f267346ea31F984; //Address for UniswapV3 factory
    address constant factoryB = 0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac; //Address for SushiSwap factory
    address constant factoryC = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; //Address for UniswapV2 factory
    address constant routerA = 0xE592427A0AEce92De3Edee1F18E0157C05861564; //Address for UniswapV3 router
    address constant routerB = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F; //Address for SushiSwap router
    address constant routerC = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; //Address for UniswapV2 router
    bytes public byteRouterB = "0x001";
    bytes public byteRouterC = "0x002";
    address public WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    bool public minProfitEnabled;
    uint256 public minProfit;
    uint256 public minerNumerator = 500;
    uint256 constant minerDenominator = 1000;
    uint256 gasReimbursement = 100;
    uint256 public slippage = 50;
    uint256 constant slippageDenom = 10000;
    uint24 public fee;

    event ExecuteSwap(
        address indexed initiator,
        uint256 amountInvested,
        uint256 amountGained,
        uint256 premium,
        uint256 minerFee,
        uint256 profit,
        uint256 time
    );

    event Withdraw(address indexed user, uint256 amountWithdraw);

    struct Adjustments {
        address adjustmentPool;
        address adjustmentToken0;
        uint256 adjustment0;
        uint256 adjustment1;
    }

    struct OrderedReserves {
        address pool1;
        uint256 pool1Reserve0;
        uint256 pool1Reserve1;
    }

    constructor(
        address _addressProvider,
        address _mevUser,
        address _token0,
        address _token1,
        uint24 _fee
    ) {
        mevUser = _mevUser;
        addressProvider = ILendingPoolAddressesProvider(_addressProvider);
        lendingPool = ILendingPool(addressProvider.getLendingPool());
        token0 = _token0;
        token1 = _token1;
        fee = _fee;
        poolA = IUniswapV3Factory(factoryA).getPool(_token0, _token1, _fee);
        poolB = IUniswapV2Factory(factoryB).getPair(_token0, _token1);
        poolC = IUniswapV2Factory(factoryC).getPair(_token0, _token1);
    }

    modifier onlyMEVUser() {
        require(mevUser == msg.sender, "MEVUser: caller is not the user");
        _;
    }

    // Updates the mev user
    function updateMEVUser(address _user) external onlyOwner {
        mevUser = _user;
    }

    // Updates the minimum profit that the bot must check for.
    function updateMinProft(uint256 _minProfit) external onlyOwner {
        minProfit = _minProfit;
    }

    // Update the numerator percentage for paying the miner.
    function updateMinerNumerator(uint256 _minerNumerator) external onlyOwner {
        minerNumerator = _minerNumerator;
    }

    // Updates the swap deadline
    function updateDeadline(uint256 _deadline) external onlyOwner {
        deadline = _deadline;
    }

    // Updates the swap slippage
    function updateSlippage(uint256 _slippage) external onlyOwner {
        slippage = _slippage;
    }

    // Withdraw tokens from the contract
    // To deposit, just simply send tokens to the contract address
    function withdraw(uint256 _amount, address _token) external onlyOwner {
        uint256 _balance = IERC20(_token).balanceOf(address(this));
        require(_amount <= _balance && _balance > 0, "Invalid amount");
        if (_balance > 0) IERC20(_token).safeTransfer(msg.sender, _amount);
        emit Withdraw(msg.sender, _amount);
    }

    function baseTokenBalance() external view returns (uint256 _balance) {
        _balance = IERC20(token0).balanceOf(address(this));
    }

    // Incorporate mempool adjustments to each token in the token pair
    // This could come from uniswap or sushi
    function _getReserves(address _pool1, address _token0)
        internal
        view
        returns (OrderedReserves memory _orderReserves)
    {
        (uint256 _pool1Reserve0, uint256 _pool1Reserve1, ) = IUniswapV2Pair(
            _pool1
        ).getReserves();

        address _pool1Token0 = IUniswapV2Pair(_pool1).token0();

        _orderReserves.pool1 = _pool1;

        if (_token0 == _pool1Token0) {
            _orderReserves.pool1Reserve0 = _pool1Reserve0;
            _orderReserves.pool1Reserve1 = _pool1Reserve1;
        } else {
            _orderReserves.pool1Reserve1 = _pool1Reserve0;
            _orderReserves.pool1Reserve0 = _pool1Reserve1;
        }
    }

    function swapWithoutLoan(uint256 amountIn0)
        public
        onlyMEVUser
        returns (uint256 amountOut)
    {
        IERC20(token0).safeTransferFrom(msg.sender, address(this), amountIn0);
        amountOut = _swap(amountIn0, msg.sender);
        IERC20(token0).safeTransfer(msg.sender, amountOut);
    }

    // Used if the base token is an ERC20 token
    function _swap(uint256 amountIn0, address _sender)
        internal
        returns (uint256 amountOut1)
    {
        OrderedReserves memory _orderReserves;
        _orderReserves = _getReserves(poolB, token0);

        uint256 amountOutMinimum = 1;
        uint160 sqrtPriceLimitX96 = 0;

        ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
            .ExactInputSingleParams(
                token0,
                token1,
                fee,
                _sender,
                deadline,
                amountIn0,
                amountOutMinimum,
                sqrtPriceLimitX96
            );

        IERC20(token0).approve(routerA, amountIn0);

        uint256 amountOut0 = ISwapRouter(routerA).exactInputSingle(params);

        amountOut1 = IUniswapV2Router01(routerB).getAmountOut(
            amountOut0,
            _orderReserves.pool1Reserve1,
            _orderReserves.pool1Reserve0
        );

        address[] memory path1 = new address[](2);
        path1[0] = token1;
        path1[1] = token0;

        IERC20(token1).approve(routerB, amountOut0);

        // Swap from token1 to token0 on pool1
        IUniswapV2Router01(poolB).swapExactTokensForTokens(
            amountOut0,
            amountOut1,
            path1,
            _sender,
            deadline
        );
    }

    //Required callback function for flashlloan
    function executeOperation(
        address[] calldata assets,
        uint256[] calldata amounts,
        uint256[] calldata premiums,
        address initiator,
        bytes calldata params
    ) external override returns (bool) {
        //
        // This contract now has the funds requested.
        // Your logic goes here.
        //

        // At the end of your logic above, this contract owes
        // the flashloaned amounts + premiums.
        // Therefore ensure your contract has enough to repay
        // these amounts.
        uint256 _netAmount = _swap(amounts[0], address(this));

        IERC20(assets[0]).approve(
            address(lendingPool),
            amounts[0] + premiums[0]
        );

        return true;
    }

    // This function calls flashloans to borrow funds.  It will fail, if it doesn't pay back in a single TX.
    function flashArb(uint256 _amount, bytes memory params) public onlyMEVUser {
        address receiverAddress = address(this);

        address[] memory assets = new address[](1);
        assets[0] = address(token0);

        uint256[] memory amounts = new uint256[](1);
        amounts[0] = _amount;

        // 0 = no debt, 1 = stable, 2 = variable
        uint256[] memory modes = new uint256[](1);
        modes[0] = 0;

        address onBehalfOf = address(this);
        uint16 referralCode = 0;

        lendingPool.flashLoan(
            receiverAddress,
            assets,
            amounts,
            modes,
            onBehalfOf,
            params,
            referralCode
        );
    }
}

File 2 of 19 : 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 3 of 19 : IQuoter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

/// @title Quoter Interface
/// @notice Supports quoting the calculated amounts from exact input or exact output swaps
/// @dev These functions are not marked view because they rely on calling non-view functions and reverting
/// to compute the result. They are also not gas efficient and should not be called on-chain.
interface IQuoter {
    /// @notice Returns the amount out received for a given exact input swap without executing the swap
    /// @param path The path of the swap, i.e. each token pair and the pool fee
    /// @param amountIn The amount of the first token to swap
    /// @return amountOut The amount of the last token that would be received
    function quoteExactInput(bytes memory path, uint256 amountIn) external returns (uint256 amountOut);

    /// @notice Returns the amount out received for a given exact input but for a swap of a single pool
    /// @param tokenIn The token being swapped in
    /// @param tokenOut The token being swapped out
    /// @param fee The fee of the token pool to consider for the pair
    /// @param amountIn The desired input amount
    /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
    /// @return amountOut The amount of `tokenOut` that would be received
    function quoteExactInputSingle(
        address tokenIn,
        address tokenOut,
        uint24 fee,
        uint256 amountIn,
        uint160 sqrtPriceLimitX96
    ) external returns (uint256 amountOut);

    /// @notice Returns the amount in required for a given exact output swap without executing the swap
    /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order
    /// @param amountOut The amount of the last token to receive
    /// @return amountIn The amount of first token required to be paid
    function quoteExactOutput(bytes memory path, uint256 amountOut) external returns (uint256 amountIn);

    /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool
    /// @param tokenIn The token being swapped in
    /// @param tokenOut The token being swapped out
    /// @param fee The fee of the token pool to consider for the pair
    /// @param amountOut The desired output amount
    /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
    /// @return amountIn The amount required as the input for the swap in order to receive `amountOut`
    function quoteExactOutputSingle(
        address tokenIn,
        address tokenOut,
        uint24 fee,
        uint256 amountOut,
        uint160 sqrtPriceLimitX96
    ) external returns (uint256 amountIn);
}

File 4 of 19 : 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 5 of 19 : IUniswapV3Factory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory {
    /// @notice Emitted when the owner of the factory is changed
    /// @param oldOwner The owner before the owner was changed
    /// @param newOwner The owner after the owner was changed
    event OwnerChanged(address indexed oldOwner, address indexed newOwner);

    /// @notice Emitted when a pool is created
    /// @param token0 The first token of the pool by address sort order
    /// @param token1 The second token of the pool by address sort order
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks
    /// @param pool The address of the created pool
    event PoolCreated(
        address indexed token0,
        address indexed token1,
        uint24 indexed fee,
        int24 tickSpacing,
        address pool
    );

    /// @notice Emitted when a new fee amount is enabled for pool creation via the factory
    /// @param fee The enabled fee, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
    event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);

    /// @notice Returns the current owner of the factory
    /// @dev Can be changed by the current owner via setOwner
    /// @return The address of the factory owner
    function owner() external view returns (address);

    /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled
    /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context
    /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee
    /// @return The tick spacing
    function feeAmountTickSpacing(uint24 fee) external view returns (int24);

    /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The contract address of either token0 or token1
    /// @param tokenB The contract address of the other token
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @return pool The pool address
    function getPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external view returns (address pool);

    /// @notice Creates a pool for the given two tokens and fee
    /// @param tokenA One of the two tokens in the desired pool
    /// @param tokenB The other of the two tokens in the desired pool
    /// @param fee The desired fee for the pool
    /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved
    /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments
    /// are invalid.
    /// @return pool The address of the newly created pool
    function createPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external returns (address pool);

    /// @notice Updates the owner of the factory
    /// @dev Must be called by the current owner
    /// @param _owner The new owner of the factory
    function setOwner(address _owner) external;

    /// @notice Enables a fee amount with the given tickSpacing
    /// @dev Fee amounts may never be removed once enabled
    /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)
    /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount
    function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
}

File 6 of 19 : IUniswapV2Router01.sol
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 7 of 19 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

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

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

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 8 of 19 : IUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

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

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 9 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.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 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 10 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 12 of 19 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

File 13 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

File 14 of 19 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 15 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/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.
 */
abstract 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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 16 of 19 : TransferHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.8.9;

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0x095ea7b3, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "TransferHelper::safeApprove: approve failed"
        );
    }

    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0xa9059cbb, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "TransferHelper::safeTransfer: transfer failed"
        );
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0x23b872dd, from, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "TransferHelper::transferFrom: transferFrom failed"
        );
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(
            success,
            "TransferHelper::safeTransferETH: ETH transfer failed"
        );
    }
}

File 17 of 19 : Libraries.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.9;
pragma experimental ABIEncoderV2;

library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

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

library DataTypes {
    // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties.
    struct ReserveData {
        //stores the reserve configuration
        ReserveConfigurationMap configuration;
        //the liquidity index. Expressed in ray
        uint128 liquidityIndex;
        //variable borrow index. Expressed in ray
        uint128 variableBorrowIndex;
        //the current supply rate. Expressed in ray
        uint128 currentLiquidityRate;
        //the current variable borrow rate. Expressed in ray
        uint128 currentVariableBorrowRate;
        //the current stable borrow rate. Expressed in ray
        uint128 currentStableBorrowRate;
        uint40 lastUpdateTimestamp;
        //tokens addresses
        address aTokenAddress;
        address stableDebtTokenAddress;
        address variableDebtTokenAddress;
        //address of the interest rate strategy
        address interestRateStrategyAddress;
        //the id of the reserve. Represents the position in the list of the active reserves
        uint8 id;
    }

    struct ReserveConfigurationMap {
        //bit 0-15: LTV
        //bit 16-31: Liq. threshold
        //bit 32-47: Liq. bonus
        //bit 48-55: Decimals
        //bit 56: Reserve is active
        //bit 57: reserve is frozen
        //bit 58: borrowing is enabled
        //bit 59: stable rate borrowing enabled
        //bit 60-63: reserved
        //bit 64-79: reserve factor
        uint256 data;
    }

    struct UserConfigurationMap {
        uint256 data;
    }

    enum InterestRateMode {
        NONE,
        STABLE,
        VARIABLE
    }
}

File 18 of 19 : Interfaces.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.9;
pragma experimental ABIEncoderV2;

import {DataTypes} from "../libraries/Libraries.sol";

interface IFlashLoanReceiver {
    function executeOperation(
        address[] calldata assets,
        uint256[] calldata amounts,
        uint256[] calldata premiums,
        address initiator,
        bytes calldata params
    ) external returns (bool);
}

/**
 * @title LendingPoolAddressesProvider contract
 * @dev Main registry of addresses part of or connected to the protocol, including permissioned roles
 * - Acting also as factory of proxies and admin of those, so with right to change its implementations
 * - Owned by the Aave Governance
 * @author Aave
 **/
interface ILendingPoolAddressesProvider {
    event LendingPoolUpdated(address indexed newAddress);
    event ConfigurationAdminUpdated(address indexed newAddress);
    event EmergencyAdminUpdated(address indexed newAddress);
    event LendingPoolConfiguratorUpdated(address indexed newAddress);
    event LendingPoolCollateralManagerUpdated(address indexed newAddress);
    event PriceOracleUpdated(address indexed newAddress);
    event LendingRateOracleUpdated(address indexed newAddress);
    event ProxyCreated(bytes32 id, address indexed newAddress);
    event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);

    function setAddress(bytes32 id, address newAddress) external;

    function setAddressAsProxy(bytes32 id, address impl) external;

    function getAddress(bytes32 id) external view returns (address);

    function getLendingPool() external view returns (address);

    function setLendingPoolImpl(address pool) external;

    function getLendingPoolConfigurator() external view returns (address);

    function setLendingPoolConfiguratorImpl(address configurator) external;

    function getLendingPoolCollateralManager() external view returns (address);

    function setLendingPoolCollateralManager(address manager) external;

    function getPoolAdmin() external view returns (address);

    function setPoolAdmin(address admin) external;

    function getEmergencyAdmin() external view returns (address);

    function setEmergencyAdmin(address admin) external;

    function getPriceOracle() external view returns (address);

    function setPriceOracle(address priceOracle) external;

    function getLendingRateOracle() external view returns (address);

    function setLendingRateOracle(address lendingRateOracle) external;
}

interface ILendingPool {
    /**
     * @dev Emitted on deposit()
     * @param reserve The address of the underlying asset of the reserve
     * @param user The address initiating the deposit
     * @param onBehalfOf The beneficiary of the deposit, receiving the aTokens
     * @param amount The amount deposited
     * @param referral The referral code used
     **/
    event Deposit(
        address indexed reserve,
        address user,
        address indexed onBehalfOf,
        uint256 amount,
        uint16 indexed referral
    );

    /**
     * @dev Emitted on withdraw()
     * @param reserve The address of the underlyng asset being withdrawn
     * @param user The address initiating the withdrawal, owner of aTokens
     * @param to Address that will receive the underlying
     * @param amount The amount to be withdrawn
     **/
    event Withdraw(
        address indexed reserve,
        address indexed user,
        address indexed to,
        uint256 amount
    );

    /**
     * @dev Emitted on borrow() and flashLoan() when debt needs to be opened
     * @param reserve The address of the underlying asset being borrowed
     * @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just
     * initiator of the transaction on flashLoan()
     * @param onBehalfOf The address that will be getting the debt
     * @param amount The amount borrowed out
     * @param borrowRateMode The rate mode: 1 for Stable, 2 for Variable
     * @param borrowRate The numeric rate at which the user has borrowed
     * @param referral The referral code used
     **/
    event Borrow(
        address indexed reserve,
        address user,
        address indexed onBehalfOf,
        uint256 amount,
        uint256 borrowRateMode,
        uint256 borrowRate,
        uint16 indexed referral
    );

    /**
     * @dev Emitted on repay()
     * @param reserve The address of the underlying asset of the reserve
     * @param user The beneficiary of the repayment, getting his debt reduced
     * @param repayer The address of the user initiating the repay(), providing the funds
     * @param amount The amount repaid
     **/
    event Repay(
        address indexed reserve,
        address indexed user,
        address indexed repayer,
        uint256 amount
    );

    /**
     * @dev Emitted on swapBorrowRateMode()
     * @param reserve The address of the underlying asset of the reserve
     * @param user The address of the user swapping his rate mode
     * @param rateMode The rate mode that the user wants to swap to
     **/
    event Swap(address indexed reserve, address indexed user, uint256 rateMode);

    /**
     * @dev Emitted on setUserUseReserveAsCollateral()
     * @param reserve The address of the underlying asset of the reserve
     * @param user The address of the user enabling the usage as collateral
     **/
    event ReserveUsedAsCollateralEnabled(
        address indexed reserve,
        address indexed user
    );

    /**
     * @dev Emitted on setUserUseReserveAsCollateral()
     * @param reserve The address of the underlying asset of the reserve
     * @param user The address of the user enabling the usage as collateral
     **/
    event ReserveUsedAsCollateralDisabled(
        address indexed reserve,
        address indexed user
    );

    /**
     * @dev Emitted on rebalanceStableBorrowRate()
     * @param reserve The address of the underlying asset of the reserve
     * @param user The address of the user for which the rebalance has been executed
     **/
    event RebalanceStableBorrowRate(
        address indexed reserve,
        address indexed user
    );

    /**
     * @dev Emitted on flashLoan()
     * @param target The address of the flash loan receiver contract
     * @param initiator The address initiating the flash loan
     * @param asset The address of the asset being flash borrowed
     * @param amount The amount flash borrowed
     * @param premium The fee flash borrowed
     * @param referralCode The referral code used
     **/
    event FlashLoan(
        address indexed target,
        address indexed initiator,
        address indexed asset,
        uint256 amount,
        uint256 premium,
        uint16 referralCode
    );

    /**
     * @dev Emitted when the pause is triggered.
     */
    event Paused();

    /**
     * @dev Emitted when the pause is lifted.
     */
    event Unpaused();

    /**
     * @dev Emitted when a borrower is liquidated. This event is emitted by the LendingPool via
     * LendingPoolCollateral manager using a DELEGATECALL
     * This allows to have the events in the generated ABI for LendingPool.
     * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
     * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
     * @param user The address of the borrower getting liquidated
     * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
     * @param liquidatedCollateralAmount The amount of collateral received by the liiquidator
     * @param liquidator The address of the liquidator
     * @param receiveAToken `true` if the liquidators wants to receive the collateral aTokens, `false` if he wants
     * to receive the underlying collateral asset directly
     **/
    event LiquidationCall(
        address indexed collateralAsset,
        address indexed debtAsset,
        address indexed user,
        uint256 debtToCover,
        uint256 liquidatedCollateralAmount,
        address liquidator,
        bool receiveAToken
    );

    /**
     * @dev Emitted when the state of a reserve is updated. NOTE: This event is actually declared
     * in the ReserveLogic library and emitted in the updateInterestRates() function. Since the function is internal,
     * the event will actually be fired by the LendingPool contract. The event is therefore replicated here so it
     * gets added to the LendingPool ABI
     * @param reserve The address of the underlying asset of the reserve
     * @param liquidityRate The new liquidity rate
     * @param stableBorrowRate The new stable borrow rate
     * @param variableBorrowRate The new variable borrow rate
     * @param liquidityIndex The new liquidity index
     * @param variableBorrowIndex The new variable borrow index
     **/
    event ReserveDataUpdated(
        address indexed reserve,
        uint256 liquidityRate,
        uint256 stableBorrowRate,
        uint256 variableBorrowRate,
        uint256 liquidityIndex,
        uint256 variableBorrowIndex
    );

    /**
     * @dev Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
     * - E.g. User deposits 100 USDC and gets in return 100 aUSDC
     * @param asset The address of the underlying asset to deposit
     * @param amount The amount to be deposited
     * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
     *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
     *   is a different wallet
     * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
     *   0 if the action is executed directly by the user, without any middle-man
     **/
    function deposit(
        address asset,
        uint256 amount,
        address onBehalfOf,
        uint16 referralCode
    ) external;

    /**
     * @dev Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
     * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
     * @param asset The address of the underlying asset to withdraw
     * @param amount The underlying amount to be withdrawn
     *   - Send the value type(uint256).max in order to withdraw the whole aToken balance
     * @param to Address that will receive the underlying, same as msg.sender if the user
     *   wants to receive it on his own wallet, or a different address if the beneficiary is a
     *   different wallet
     **/
    function withdraw(
        address asset,
        uint256 amount,
        address to
    ) external;

    /**
     * @dev Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
     * already deposited enough collateral, or he was given enough allowance by a credit delegator on the
     * corresponding debt token (StableDebtToken or VariableDebtToken)
     * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet
     *   and 100 stable/variable debt tokens, depending on the `interestRateMode`
     * @param asset The address of the underlying asset to borrow
     * @param amount The amount to be borrowed
     * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
     * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
     *   0 if the action is executed directly by the user, without any middle-man
     * @param onBehalfOf Address of the user who will receive the debt. Should be the address of the borrower itself
     * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
     * if he has been given credit delegation allowance
     **/
    function borrow(
        address asset,
        uint256 amount,
        uint256 interestRateMode,
        uint16 referralCode,
        address onBehalfOf
    ) external;

    /**
     * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
     * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
     * @param asset The address of the borrowed underlying asset previously borrowed
     * @param amount The amount to repay
     * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
     * @param rateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
     * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
     * user calling the function if he wants to reduce/remove his own debt, or the address of any other
     * other borrower whose debt should be removed
     **/
    function repay(
        address asset,
        uint256 amount,
        uint256 rateMode,
        address onBehalfOf
    ) external;

    /**
     * @dev Allows a borrower to swap his debt between stable and variable mode, or viceversa
     * @param asset The address of the underlying asset borrowed
     * @param rateMode The rate mode that the user wants to swap to
     **/
    function swapBorrowRateMode(address asset, uint256 rateMode) external;

    /**
     * @dev Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.
     * - Users can be rebalanced if the following conditions are satisfied:
     *     1. Usage ratio is above 95%
     *     2. the current deposit APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too much has been
     *        borrowed at a stable rate and depositors are not earning enough
     * @param asset The address of the underlying asset borrowed
     * @param user The address of the user to be rebalanced
     **/
    function rebalanceStableBorrowRate(address asset, address user) external;

    /**
     * @dev Allows depositors to enable/disable a specific deposited asset as collateral
     * @param asset The address of the underlying asset deposited
     * @param useAsCollateral `true` if the user wants to use the deposit as collateral, `false` otherwise
     **/
    function setUserUseReserveAsCollateral(address asset, bool useAsCollateral)
        external;

    /**
     * @dev Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1
     * - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives
     *   a proportionally amount of the `collateralAsset` plus a bonus to cover market risk
     * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
     * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
     * @param user The address of the borrower getting liquidated
     * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
     * @param receiveAToken `true` if the liquidators wants to receive the collateral aTokens, `false` if he wants
     * to receive the underlying collateral asset directly
     **/
    function liquidationCall(
        address collateralAsset,
        address debtAsset,
        address user,
        uint256 debtToCover,
        bool receiveAToken
    ) external;

    /**
     * @dev Allows smartcontracts to access the liquidity of the pool within one transaction,
     * as long as the amount taken plus a fee is returned.
     * IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration.
     * For further details please visit https://developers.aave.com
     * @param receiverAddress The address of the contract receiving the funds, implementing the IFlashLoanReceiver interface
     * @param assets The addresses of the assets being flash-borrowed
     * @param amounts The amounts amounts being flash-borrowed
     * @param modes Types of the debt to open if the flash loan is not returned:
     *   0 -> Don't open any debt, just revert if funds can't be transferred from the receiver
     *   1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
     *   2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
     * @param onBehalfOf The address  that will receive the debt in the case of using on `modes` 1 or 2
     * @param params Variadic packed params to pass to the receiver as extra information
     * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
     *   0 if the action is executed directly by the user, without any middle-man
     **/
    function flashLoan(
        address receiverAddress,
        address[] calldata assets,
        uint256[] calldata amounts,
        uint256[] calldata modes,
        address onBehalfOf,
        bytes calldata params,
        uint16 referralCode
    ) external;

    /**
     * @dev Returns the user account data across all the reserves
     * @param user The address of the user
     * @return totalCollateralETH the total collateral in ETH of the user
     * @return totalDebtETH the total debt in ETH of the user
     * @return availableBorrowsETH the borrowing power left of the user
     * @return currentLiquidationThreshold the liquidation threshold of the user
     * @return ltv the loan to value of the user
     * @return healthFactor the current health factor of the user
     **/
    function getUserAccountData(address user)
        external
        view
        returns (
            uint256 totalCollateralETH,
            uint256 totalDebtETH,
            uint256 availableBorrowsETH,
            uint256 currentLiquidationThreshold,
            uint256 ltv,
            uint256 healthFactor
        );

    function initReserve(
        address reserve,
        address aTokenAddress,
        address stableDebtAddress,
        address variableDebtAddress,
        address interestRateStrategyAddress
    ) external;

    function setReserveInterestRateStrategyAddress(
        address reserve,
        address rateStrategyAddress
    ) external;

    function setConfiguration(address reserve, uint256 configuration) external;

    /**
     * @dev Returns the configuration of the reserve
     * @param asset The address of the underlying asset of the reserve
     * @return The configuration of the reserve
     **/
    function getConfiguration(address asset)
        external
        view
        returns (DataTypes.ReserveConfigurationMap memory);

    /**
     * @dev Returns the configuration of the user across all the reserves
     * @param user The user address
     * @return The configuration of the user
     **/
    function getUserConfiguration(address user)
        external
        view
        returns (DataTypes.UserConfigurationMap memory);

    /**
     * @dev Returns the normalized income normalized income of the reserve
     * @param asset The address of the underlying asset of the reserve
     * @return The reserve's normalized income
     */
    function getReserveNormalizedIncome(address asset)
        external
        view
        returns (uint256);

    /**
     * @dev Returns the normalized variable debt per unit of asset
     * @param asset The address of the underlying asset of the reserve
     * @return The reserve normalized variable debt
     */
    function getReserveNormalizedVariableDebt(address asset)
        external
        view
        returns (uint256);

    /**
     * @dev Returns the state and configuration of the reserve
     * @param asset The address of the underlying asset of the reserve
     * @return The state of the reserve
     **/
    function getReserveData(address asset)
        external
        view
        returns (DataTypes.ReserveData memory);

    function finalizeTransfer(
        address asset,
        address from,
        address to,
        uint256 amount,
        uint256 balanceFromAfter,
        uint256 balanceToBefore
    ) external;

    function getReservesList() external view returns (address[] memory);

    function getAddressesProvider()
        external
        view
        returns (ILendingPoolAddressesProvider);

    function setPause(bool val) external;

    function paused() external view returns (bool);
}

File 19 of 19 : IWETH.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.9;

interface IWETH {
    function deposit() external payable;

    function transfer(address to, uint256 value) external returns (bool);

    function withdraw(uint256) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_addressProvider","type":"address"},{"internalType":"address","name":"_mevUser","type":"address"},{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"},{"internalType":"uint24","name":"_fee","type":"uint24"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"initiator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountInvested","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountGained","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"premium","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"profit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ExecuteSwap","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":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountWithdraw","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addressProvider","outputs":[{"internalType":"contract ILendingPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenBalance","outputs":[{"internalType":"uint256","name":"_balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"byteRouterB","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"byteRouterC","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"premiums","type":"uint256[]"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"flashArb","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPool","outputs":[{"internalType":"contract ILendingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mevUser","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minProfit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minProfitEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minerNumerator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolA","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolB","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn0","type":"uint256"}],"name":"swapWithoutLoan","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"updateDeadline","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"updateMEVUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minProfit","type":"uint256"}],"name":"updateMinProft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minerNumerator","type":"uint256"}],"name":"updateMinerNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slippage","type":"uint256"}],"name":"updateSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040526801158e460913d000006002556040518060400160405280600581526020017f307830303100000000000000000000000000000000000000000000000000000081525060099081620000579190620008ed565b506040518060400160405280600581526020017f3078303032000000000000000000000000000000000000000000000000000000815250600a90816200009e9190620008ed565b5073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101f4600d556064600e556032600f553480156200011157600080fd5b5060405162003c5c38038062003c5c833981810160405281019062000137919062000a7e565b620001576200014b620005a760201b60201c565b620005af60201b60201c565b6001808190555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505060805173ffffffffffffffffffffffffffffffffffffffff16630261bf8b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000221573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000247919062000b06565b73ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601060006101000a81548162ffffff021916908362ffffff160217905550731f98431c8ad98523631ae4a59f267346ea31f98473ffffffffffffffffffffffffffffffffffffffff16631698ee828484846040518463ffffffff1660e01b81526004016200036e9392919062000b5a565b602060405180830381865afa1580156200038c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003b2919062000b06565b600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac73ffffffffffffffffffffffffffffffffffffffff1663e6a4390584846040518363ffffffff1660e01b81526004016200044392919062000b97565b602060405180830381865afa15801562000461573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000487919062000b06565b600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a4390584846040518363ffffffff1660e01b81526004016200051892919062000b97565b602060405180830381865afa15801562000536573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200055c919062000b06565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050505062000bc4565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620006f557607f821691505b6020821081036200070b576200070a620006ad565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620007757fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000736565b62000781868362000736565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620007ce620007c8620007c28462000799565b620007a3565b62000799565b9050919050565b6000819050919050565b620007ea83620007ad565b62000802620007f982620007d5565b84845462000743565b825550505050565b600090565b620008196200080a565b62000826818484620007df565b505050565b5b818110156200084e57620008426000826200080f565b6001810190506200082c565b5050565b601f8211156200089d57620008678162000711565b620008728462000726565b8101602085101562000882578190505b6200089a620008918562000726565b8301826200082b565b50505b505050565b600082821c905092915050565b6000620008c260001984600802620008a2565b1980831691505092915050565b6000620008dd8383620008af565b9150826002028217905092915050565b620008f88262000673565b67ffffffffffffffff8111156200091457620009136200067e565b5b620009208254620006dc565b6200092d82828562000852565b600060209050601f83116001811462000965576000841562000950578287015190505b6200095c8582620008cf565b865550620009cc565b601f198416620009758662000711565b60005b828110156200099f5784890151825560018201915060208501945060208101905062000978565b86831015620009bf5784890151620009bb601f891682620008af565b8355505b6001600288020188555050505b505050505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000a0682620009d9565b9050919050565b62000a1881620009f9565b811462000a2457600080fd5b50565b60008151905062000a388162000a0d565b92915050565b600062ffffff82169050919050565b62000a588162000a3e565b811462000a6457600080fd5b50565b60008151905062000a788162000a4d565b92915050565b600080600080600060a0868803121562000a9d5762000a9c620009d4565b5b600062000aad8882890162000a27565b955050602062000ac08882890162000a27565b945050604062000ad38882890162000a27565b935050606062000ae68882890162000a27565b925050608062000af98882890162000a67565b9150509295509295909350565b60006020828403121562000b1f5762000b1e620009d4565b5b600062000b2f8482850162000a27565b91505092915050565b62000b4381620009f9565b82525050565b62000b548162000a3e565b82525050565b600060608201905062000b71600083018662000b38565b62000b80602083018562000b38565b62000b8f604083018462000b49565b949350505050565b600060408201905062000bae600083018562000b38565b62000bbd602083018462000b38565b9392505050565b60805160a05161306462000bf860003960008181610a6901528181610c430152610db7015260006106f901526130646000f3fe608060405234801561001057600080fd5b50600436106101d95760003560e01c80639c61a72911610104578063cbbf425f116100a2578063d5dd093a11610071578063d5dd093a146104da578063da0ccc2b146104f8578063ddca3f4314610528578063f2fde38b14610546576101d9565b8063cbbf425f14610464578063cf466e7114610482578063d21220a71461049e578063d4a2aa33146104bc576101d9565b8063ad5c4648116100de578063ad5c4648146103ec578063b0f000e71461040a578063c39111d414610428578063c4456d6714610446576101d9565b80639c61a72914610394578063a45fff7e146103b0578063a59a9973146103ce576101d9565b806342af18841161017c57806389935bf31161014b57806389935bf31461030c5780638da5cb5b146103285780638f87ff1c14610346578063920f5c8414610364576101d9565b806342af1884146102aa5780635b3de3e7146102c6578063715018a6146102e457806375c81ad0146102ee576101d9565b80632954018c116101b85780632954018c1461023457806329dcb0cf146102525780633e032a3b1461027057806341060e0e1461028e576101d9565b8062f714ce146101de5780630dfe1681146101fa57806315b0d49614610218575b600080fd5b6101f860048036038101906101f39190611dff565b610562565b005b6102026106bf565b60405161020f9190611e4e565b60405180910390f35b610232600480360381019061022d9190611e69565b6106e5565b005b61023c6106f7565b6040516102499190611ef5565b60405180910390f35b61025a61071b565b6040516102679190611f1f565b60405180910390f35b610278610721565b6040516102859190611f1f565b60405180910390f35b6102a860048036038101906102a39190611f3a565b610727565b005b6102c460048036038101906102bf9190611e69565b610773565b005b6102ce610785565b6040516102db9190611ff7565b60405180910390f35b6102ec610813565b005b6102f6610827565b6040516103039190611f1f565b60405180910390f35b6103266004803603810190610321919061214e565b61082d565b005b610330610b08565b60405161033d9190611e4e565b60405180910390f35b61034e610b31565b60405161035b9190611f1f565b60405180910390f35b61037e600480360381019061037991906122b6565b610bd4565b60405161038b91906123cd565b60405180910390f35b6103ae60048036038101906103a99190611e69565b610d15565b005b6103b8610d27565b6040516103c59190611ff7565b60405180910390f35b6103d6610db5565b6040516103e39190612409565b60405180910390f35b6103f4610dd9565b6040516104019190611e4e565b60405180910390f35b610412610dff565b60405161041f9190611f1f565b60405180910390f35b610430610e05565b60405161043d9190611e4e565b60405180910390f35b61044e610e2b565b60405161045b9190611e4e565b60405180910390f35b61046c610e51565b6040516104799190611e4e565b60405180910390f35b61049c60048036038101906104979190611e69565b610e77565b005b6104a6610e89565b6040516104b39190611e4e565b60405180910390f35b6104c4610eaf565b6040516104d19190611e4e565b60405180910390f35b6104e2610ed5565b6040516104ef91906123cd565b60405180910390f35b610512600480360381019061050d9190611e69565b610ee8565b60405161051f9190611f1f565b60405180910390f35b610530611027565b60405161053d9190612442565b60405180910390f35b610560600480360381019061055b9190611f3a565b61103c565b005b61056a6110bf565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105a59190611e4e565b602060405180830381865afa1580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e69190612472565b90508083111580156105f85750600081115b610637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062e906124fc565b60405180910390fd5b600081111561066c5761066b33848473ffffffffffffffffffffffffffffffffffffffff1661113d9092919063ffffffff16565b5b3373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364846040516106b29190611f1f565b60405180910390a2505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106ed6110bf565b80600f8190555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b600f5481565b61072f6110bf565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61077b6110bf565b8060028190555050565b600a80546107929061254b565b80601f01602080910402602001604051908101604052809291908181526020018280546107be9061254b565b801561080b5780601f106107e05761010080835404028352916020019161080b565b820191906000526020600020905b8154815290600101906020018083116107ee57829003601f168201915b505050505081565b61081b6110bf565b61082560006111c3565b565b600c5481565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b4906125c8565b60405180910390fd5b60003090506000600167ffffffffffffffff8111156108df576108de612023565b5b60405190808252806020026020018201604052801561090d5781602001602082028036833780820191505090505b509050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110610947576109466125e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000600167ffffffffffffffff81111561099e5761099d612023565b5b6040519080825280602002602001820160405280156109cc5781602001602082028036833780820191505090505b50905084816000815181106109e4576109e36125e8565b5b6020026020010181815250506000600167ffffffffffffffff811115610a0d57610a0c612023565b5b604051908082528060200260200182016040528015610a3b5781602001602082028036833780820191505090505b509050600081600081518110610a5457610a536125e8565b5b602002602001018181525050600030905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ab9c4b5d87878787878d886040518863ffffffff1660e01b8152600401610acc97969594939291906127b0565b600060405180830381600087803b158015610ae657600080fd5b505af1158015610afa573d6000803e3d6000fd5b505050505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b8e9190611e4e565b602060405180830381865afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf9190612472565b905090565b600080610bfb89896000818110610bee57610bed6125e8565b5b9050602002013530611287565b90508a8a6000818110610c1157610c106125e8565b5b9050602002016020810190610c269190611f3a565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f000000000000000000000000000000000000000000000000000000000000000089896000818110610c7657610c756125e8565b5b905060200201358c8c6000818110610c9157610c906125e8565b5b90506020020135610ca2919061286a565b6040518363ffffffff1660e01b8152600401610cbf92919061289e565b6020604051808303816000875af1158015610cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0291906128f3565b5060019150509998505050505050505050565b610d1d6110bf565b80600c8190555050565b60098054610d349061254b565b80601f0160208091040260200160405190810160405280929190818152602001828054610d609061254b565b8015610dad5780601f10610d8257610100808354040283529160200191610dad565b820191906000526020600020905b815481529060010190602001808311610d9057829003601f168201915b505050505081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e7f6110bf565b80600d8190555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60149054906101000a900460ff1681565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f71906125c8565b60405180910390fd5b610fc9333084600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661185e909392919063ffffffff16565b610fd38233611287565b90506110223382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661113d9092919063ffffffff16565b919050565b601060009054906101000a900462ffffff1681565b6110446110bf565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110aa90612992565b60405180910390fd5b6110bc816111c3565b50565b6110c76118e7565b73ffffffffffffffffffffffffffffffffffffffff166110e5610b08565b73ffffffffffffffffffffffffffffffffffffffff161461113b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611132906129fe565b60405180910390fd5b565b6111be8363a9059cbb60e01b848460405160240161115c92919061289e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118ef565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611291611d20565b6112df600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166119b6565b9050600060019050600080604051806101000160405280600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001601060009054906101000a900462ffffff1662ffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff16815260200160025481526020018881526020018481526020018373ffffffffffffffffffffffffffffffffffffffff168152509050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e592427a0aece92de3edee1f18e0157c05861564896040518363ffffffff1660e01b815260040161144b92919061289e565b6020604051808303816000875af115801561146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148e91906128f3565b50600073e592427a0aece92de3edee1f18e0157c0586156473ffffffffffffffffffffffffffffffffffffffff1663414bf389836040518263ffffffff1660e01b81526004016114de9190612ade565b6020604051808303816000875af11580156114fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115219190612472565b905073d9e1ce17f2641f24ae83637ab66a2cca9c378b9f73ffffffffffffffffffffffffffffffffffffffff1663054d50d482876040015188602001516040518463ffffffff1660e01b815260040161157c93929190612afa565b602060405180830381865afa158015611599573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bd9190612472565b95506000600267ffffffffffffffff8111156115dc576115db612023565b5b60405190808252806020026020018201604052801561160a5781602001602082028036833780820191505090505b509050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611644576116436125e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106116b5576116b46125e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b373d9e1ce17f2641f24ae83637ab66a2cca9c378b9f846040518363ffffffff1660e01b815260040161176092919061289e565b6020604051808303816000875af115801561177f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a391906128f3565b50600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed17398389848c6002546040518663ffffffff1660e01b8152600401611809959493929190612b31565b6000604051808303816000875af1158015611828573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906118519190612c4e565b5050505050505092915050565b6118e1846323b872dd60e01b85858560405160240161187f93929190612c97565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118ef565b50505050565b600033905090565b6000611951826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b6a9092919063ffffffff16565b90506000815111156119b1578080602001905181019061197191906128f3565b6119b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a790612d40565b60405180910390fd5b5b505050565b6119be611d20565b6000808473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a309190612de2565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008573ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac69190612e4a565b905085846000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611b4c578284602001818152505081846040018181525050611b61565b82846040018181525050818460200181815250505b50505092915050565b6060611b798484600085611b82565b90509392505050565b606082471015611bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbe90612ee9565b60405180910390fd5b611bd085611c96565b611c0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0690612f55565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611c389190612fb1565b60006040518083038185875af1925050503d8060008114611c75576040519150601f19603f3d011682016040523d82523d6000602084013e611c7a565b606091505b5091509150611c8a828286611cb9565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315611cc957829050611d19565b600083511115611cdc5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d10919061300c565b60405180910390fd5b9392505050565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b611d7e81611d6b565b8114611d8957600080fd5b50565b600081359050611d9b81611d75565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611dcc82611da1565b9050919050565b611ddc81611dc1565b8114611de757600080fd5b50565b600081359050611df981611dd3565b92915050565b60008060408385031215611e1657611e15611d61565b5b6000611e2485828601611d8c565b9250506020611e3585828601611dea565b9150509250929050565b611e4881611dc1565b82525050565b6000602082019050611e636000830184611e3f565b92915050565b600060208284031215611e7f57611e7e611d61565b5b6000611e8d84828501611d8c565b91505092915050565b6000819050919050565b6000611ebb611eb6611eb184611da1565b611e96565b611da1565b9050919050565b6000611ecd82611ea0565b9050919050565b6000611edf82611ec2565b9050919050565b611eef81611ed4565b82525050565b6000602082019050611f0a6000830184611ee6565b92915050565b611f1981611d6b565b82525050565b6000602082019050611f346000830184611f10565b92915050565b600060208284031215611f5057611f4f611d61565b5b6000611f5e84828501611dea565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611fa1578082015181840152602081019050611f86565b60008484015250505050565b6000601f19601f8301169050919050565b6000611fc982611f67565b611fd38185611f72565b9350611fe3818560208601611f83565b611fec81611fad565b840191505092915050565b600060208201905081810360008301526120118184611fbe565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61205b82611fad565b810181811067ffffffffffffffff8211171561207a57612079612023565b5b80604052505050565b600061208d611d57565b90506120998282612052565b919050565b600067ffffffffffffffff8211156120b9576120b8612023565b5b6120c282611fad565b9050602081019050919050565b82818337600083830152505050565b60006120f16120ec8461209e565b612083565b90508281526020810184848401111561210d5761210c61201e565b5b6121188482856120cf565b509392505050565b600082601f83011261213557612134612019565b5b81356121458482602086016120de565b91505092915050565b6000806040838503121561216557612164611d61565b5b600061217385828601611d8c565b925050602083013567ffffffffffffffff81111561219457612193611d66565b5b6121a085828601612120565b9150509250929050565b600080fd5b600080fd5b60008083601f8401126121ca576121c9612019565b5b8235905067ffffffffffffffff8111156121e7576121e66121aa565b5b602083019150836020820283011115612203576122026121af565b5b9250929050565b60008083601f8401126122205761221f612019565b5b8235905067ffffffffffffffff81111561223d5761223c6121aa565b5b602083019150836020820283011115612259576122586121af565b5b9250929050565b60008083601f84011261227657612275612019565b5b8235905067ffffffffffffffff811115612293576122926121aa565b5b6020830191508360018202830111156122af576122ae6121af565b5b9250929050565b600080600080600080600080600060a08a8c0312156122d8576122d7611d61565b5b60008a013567ffffffffffffffff8111156122f6576122f5611d66565b5b6123028c828d016121b4565b995099505060208a013567ffffffffffffffff81111561232557612324611d66565b5b6123318c828d0161220a565b975097505060408a013567ffffffffffffffff81111561235457612353611d66565b5b6123608c828d0161220a565b955095505060606123738c828d01611dea565b93505060808a013567ffffffffffffffff81111561239457612393611d66565b5b6123a08c828d01612260565b92509250509295985092959850929598565b60008115159050919050565b6123c7816123b2565b82525050565b60006020820190506123e260008301846123be565b92915050565b60006123f382611ec2565b9050919050565b612403816123e8565b82525050565b600060208201905061241e60008301846123fa565b92915050565b600062ffffff82169050919050565b61243c81612424565b82525050565b60006020820190506124576000830184612433565b92915050565b60008151905061246c81611d75565b92915050565b60006020828403121561248857612487611d61565b5b60006124968482850161245d565b91505092915050565b600082825260208201905092915050565b7f496e76616c696420616d6f756e74000000000000000000000000000000000000600082015250565b60006124e6600e8361249f565b91506124f1826124b0565b602082019050919050565b60006020820190508181036000830152612515816124d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256357607f821691505b6020821081036125765761257561251c565b5b50919050565b7f4d4556557365723a2063616c6c6572206973206e6f7420746865207573657200600082015250565b60006125b2601f8361249f565b91506125bd8261257c565b602082019050919050565b600060208201905081810360008301526125e1816125a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61264c81611dc1565b82525050565b600061265e8383612643565b60208301905092915050565b6000602082019050919050565b600061268282612617565b61268c8185612622565b935061269783612633565b8060005b838110156126c85781516126af8882612652565b97506126ba8361266a565b92505060018101905061269b565b5085935050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61270a81611d6b565b82525050565b600061271c8383612701565b60208301905092915050565b6000602082019050919050565b6000612740826126d5565b61274a81856126e0565b9350612755836126f1565b8060005b8381101561278657815161276d8882612710565b975061277883612728565b925050600181019050612759565b5085935050505092915050565b600061ffff82169050919050565b6127aa81612793565b82525050565b600060e0820190506127c5600083018a611e3f565b81810360208301526127d78189612677565b905081810360408301526127eb8188612735565b905081810360608301526127ff8187612735565b905061280e6080830186611e3f565b81810360a08301526128208185611fbe565b905061282f60c08301846127a1565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061287582611d6b565b915061288083611d6b565b92508282019050808211156128985761289761283b565b5b92915050565b60006040820190506128b36000830185611e3f565b6128c06020830184611f10565b9392505050565b6128d0816123b2565b81146128db57600080fd5b50565b6000815190506128ed816128c7565b92915050565b60006020828403121561290957612908611d61565b5b6000612917848285016128de565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061297c60268361249f565b915061298782612920565b604082019050919050565b600060208201905081810360008301526129ab8161296f565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006129e860208361249f565b91506129f3826129b2565b602082019050919050565b60006020820190508181036000830152612a17816129db565b9050919050565b612a2781612424565b82525050565b612a3681611da1565b82525050565b61010082016000820151612a536000850182612643565b506020820151612a666020850182612643565b506040820151612a796040850182612a1e565b506060820151612a8c6060850182612643565b506080820151612a9f6080850182612701565b5060a0820151612ab260a0850182612701565b5060c0820151612ac560c0850182612701565b5060e0820151612ad860e0850182612a2d565b50505050565b600061010082019050612af46000830184612a3c565b92915050565b6000606082019050612b0f6000830186611f10565b612b1c6020830185611f10565b612b296040830184611f10565b949350505050565b600060a082019050612b466000830188611f10565b612b536020830187611f10565b8181036040830152612b658186612677565b9050612b746060830185611e3f565b612b816080830184611f10565b9695505050505050565b600067ffffffffffffffff821115612ba657612ba5612023565b5b602082029050602081019050919050565b6000612bca612bc584612b8b565b612083565b90508083825260208201905060208402830185811115612bed57612bec6121af565b5b835b81811015612c165780612c02888261245d565b845260208401935050602081019050612bef565b5050509392505050565b600082601f830112612c3557612c34612019565b5b8151612c45848260208601612bb7565b91505092915050565b600060208284031215612c6457612c63611d61565b5b600082015167ffffffffffffffff811115612c8257612c81611d66565b5b612c8e84828501612c20565b91505092915050565b6000606082019050612cac6000830186611e3f565b612cb96020830185611e3f565b612cc66040830184611f10565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612d2a602a8361249f565b9150612d3582612cce565b604082019050919050565b60006020820190508181036000830152612d5981612d1d565b9050919050565b60006dffffffffffffffffffffffffffff82169050919050565b612d8381612d60565b8114612d8e57600080fd5b50565b600081519050612da081612d7a565b92915050565b600063ffffffff82169050919050565b612dbf81612da6565b8114612dca57600080fd5b50565b600081519050612ddc81612db6565b92915050565b600080600060608486031215612dfb57612dfa611d61565b5b6000612e0986828701612d91565b9350506020612e1a86828701612d91565b9250506040612e2b86828701612dcd565b9150509250925092565b600081519050612e4481611dd3565b92915050565b600060208284031215612e6057612e5f611d61565b5b6000612e6e84828501612e35565b91505092915050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612ed360268361249f565b9150612ede82612e77565b604082019050919050565b60006020820190508181036000830152612f0281612ec6565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612f3f601d8361249f565b9150612f4a82612f09565b602082019050919050565b60006020820190508181036000830152612f6e81612f32565b9050919050565b600081905092915050565b6000612f8b82611f67565b612f958185612f75565b9350612fa5818560208601611f83565b80840191505092915050565b6000612fbd8284612f80565b915081905092915050565b600081519050919050565b6000612fde82612fc8565b612fe8818561249f565b9350612ff8818560208601611f83565b61300181611fad565b840191505092915050565b600060208201905081810360008301526130268184612fd3565b90509291505056fea2646970667358221220a3b546715e642dd3dd3235a0e257b4ed46a63479dff281ac8d3c966702c541c864736f6c63430008100033000000000000000000000000b53c1a33016b2dc2ff3653530bff1848a515c8c5000000000000000000000000cdb1c8bd7f31f6efaede6b616d669561292d9ea5000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f4

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101d95760003560e01c80639c61a72911610104578063cbbf425f116100a2578063d5dd093a11610071578063d5dd093a146104da578063da0ccc2b146104f8578063ddca3f4314610528578063f2fde38b14610546576101d9565b8063cbbf425f14610464578063cf466e7114610482578063d21220a71461049e578063d4a2aa33146104bc576101d9565b8063ad5c4648116100de578063ad5c4648146103ec578063b0f000e71461040a578063c39111d414610428578063c4456d6714610446576101d9565b80639c61a72914610394578063a45fff7e146103b0578063a59a9973146103ce576101d9565b806342af18841161017c57806389935bf31161014b57806389935bf31461030c5780638da5cb5b146103285780638f87ff1c14610346578063920f5c8414610364576101d9565b806342af1884146102aa5780635b3de3e7146102c6578063715018a6146102e457806375c81ad0146102ee576101d9565b80632954018c116101b85780632954018c1461023457806329dcb0cf146102525780633e032a3b1461027057806341060e0e1461028e576101d9565b8062f714ce146101de5780630dfe1681146101fa57806315b0d49614610218575b600080fd5b6101f860048036038101906101f39190611dff565b610562565b005b6102026106bf565b60405161020f9190611e4e565b60405180910390f35b610232600480360381019061022d9190611e69565b6106e5565b005b61023c6106f7565b6040516102499190611ef5565b60405180910390f35b61025a61071b565b6040516102679190611f1f565b60405180910390f35b610278610721565b6040516102859190611f1f565b60405180910390f35b6102a860048036038101906102a39190611f3a565b610727565b005b6102c460048036038101906102bf9190611e69565b610773565b005b6102ce610785565b6040516102db9190611ff7565b60405180910390f35b6102ec610813565b005b6102f6610827565b6040516103039190611f1f565b60405180910390f35b6103266004803603810190610321919061214e565b61082d565b005b610330610b08565b60405161033d9190611e4e565b60405180910390f35b61034e610b31565b60405161035b9190611f1f565b60405180910390f35b61037e600480360381019061037991906122b6565b610bd4565b60405161038b91906123cd565b60405180910390f35b6103ae60048036038101906103a99190611e69565b610d15565b005b6103b8610d27565b6040516103c59190611ff7565b60405180910390f35b6103d6610db5565b6040516103e39190612409565b60405180910390f35b6103f4610dd9565b6040516104019190611e4e565b60405180910390f35b610412610dff565b60405161041f9190611f1f565b60405180910390f35b610430610e05565b60405161043d9190611e4e565b60405180910390f35b61044e610e2b565b60405161045b9190611e4e565b60405180910390f35b61046c610e51565b6040516104799190611e4e565b60405180910390f35b61049c60048036038101906104979190611e69565b610e77565b005b6104a6610e89565b6040516104b39190611e4e565b60405180910390f35b6104c4610eaf565b6040516104d19190611e4e565b60405180910390f35b6104e2610ed5565b6040516104ef91906123cd565b60405180910390f35b610512600480360381019061050d9190611e69565b610ee8565b60405161051f9190611f1f565b60405180910390f35b610530611027565b60405161053d9190612442565b60405180910390f35b610560600480360381019061055b9190611f3a565b61103c565b005b61056a6110bf565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105a59190611e4e565b602060405180830381865afa1580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e69190612472565b90508083111580156105f85750600081115b610637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062e906124fc565b60405180910390fd5b600081111561066c5761066b33848473ffffffffffffffffffffffffffffffffffffffff1661113d9092919063ffffffff16565b5b3373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364846040516106b29190611f1f565b60405180910390a2505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106ed6110bf565b80600f8190555050565b7f000000000000000000000000b53c1a33016b2dc2ff3653530bff1848a515c8c581565b60025481565b600f5481565b61072f6110bf565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61077b6110bf565b8060028190555050565b600a80546107929061254b565b80601f01602080910402602001604051908101604052809291908181526020018280546107be9061254b565b801561080b5780601f106107e05761010080835404028352916020019161080b565b820191906000526020600020905b8154815290600101906020018083116107ee57829003601f168201915b505050505081565b61081b6110bf565b61082560006111c3565b565b600c5481565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b4906125c8565b60405180910390fd5b60003090506000600167ffffffffffffffff8111156108df576108de612023565b5b60405190808252806020026020018201604052801561090d5781602001602082028036833780820191505090505b509050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110610947576109466125e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000600167ffffffffffffffff81111561099e5761099d612023565b5b6040519080825280602002602001820160405280156109cc5781602001602082028036833780820191505090505b50905084816000815181106109e4576109e36125e8565b5b6020026020010181815250506000600167ffffffffffffffff811115610a0d57610a0c612023565b5b604051908082528060200260200182016040528015610a3b5781602001602082028036833780820191505090505b509050600081600081518110610a5457610a536125e8565b5b602002602001018181525050600030905060007f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a973ffffffffffffffffffffffffffffffffffffffff1663ab9c4b5d87878787878d886040518863ffffffff1660e01b8152600401610acc97969594939291906127b0565b600060405180830381600087803b158015610ae657600080fd5b505af1158015610afa573d6000803e3d6000fd5b505050505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b8e9190611e4e565b602060405180830381865afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf9190612472565b905090565b600080610bfb89896000818110610bee57610bed6125e8565b5b9050602002013530611287565b90508a8a6000818110610c1157610c106125e8565b5b9050602002016020810190610c269190611f3a565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a989896000818110610c7657610c756125e8565b5b905060200201358c8c6000818110610c9157610c906125e8565b5b90506020020135610ca2919061286a565b6040518363ffffffff1660e01b8152600401610cbf92919061289e565b6020604051808303816000875af1158015610cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0291906128f3565b5060019150509998505050505050505050565b610d1d6110bf565b80600c8190555050565b60098054610d349061254b565b80601f0160208091040260200160405190810160405280929190818152602001828054610d609061254b565b8015610dad5780601f10610d8257610100808354040283529160200191610dad565b820191906000526020600020905b815481529060010190602001808311610d9057829003601f168201915b505050505081565b7f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a981565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e7f6110bf565b80600d8190555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60149054906101000a900460ff1681565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f71906125c8565b60405180910390fd5b610fc9333084600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661185e909392919063ffffffff16565b610fd38233611287565b90506110223382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661113d9092919063ffffffff16565b919050565b601060009054906101000a900462ffffff1681565b6110446110bf565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110aa90612992565b60405180910390fd5b6110bc816111c3565b50565b6110c76118e7565b73ffffffffffffffffffffffffffffffffffffffff166110e5610b08565b73ffffffffffffffffffffffffffffffffffffffff161461113b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611132906129fe565b60405180910390fd5b565b6111be8363a9059cbb60e01b848460405160240161115c92919061289e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118ef565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611291611d20565b6112df600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166119b6565b9050600060019050600080604051806101000160405280600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001601060009054906101000a900462ffffff1662ffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff16815260200160025481526020018881526020018481526020018373ffffffffffffffffffffffffffffffffffffffff168152509050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e592427a0aece92de3edee1f18e0157c05861564896040518363ffffffff1660e01b815260040161144b92919061289e565b6020604051808303816000875af115801561146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148e91906128f3565b50600073e592427a0aece92de3edee1f18e0157c0586156473ffffffffffffffffffffffffffffffffffffffff1663414bf389836040518263ffffffff1660e01b81526004016114de9190612ade565b6020604051808303816000875af11580156114fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115219190612472565b905073d9e1ce17f2641f24ae83637ab66a2cca9c378b9f73ffffffffffffffffffffffffffffffffffffffff1663054d50d482876040015188602001516040518463ffffffff1660e01b815260040161157c93929190612afa565b602060405180830381865afa158015611599573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bd9190612472565b95506000600267ffffffffffffffff8111156115dc576115db612023565b5b60405190808252806020026020018201604052801561160a5781602001602082028036833780820191505090505b509050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611644576116436125e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106116b5576116b46125e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b373d9e1ce17f2641f24ae83637ab66a2cca9c378b9f846040518363ffffffff1660e01b815260040161176092919061289e565b6020604051808303816000875af115801561177f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a391906128f3565b50600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed17398389848c6002546040518663ffffffff1660e01b8152600401611809959493929190612b31565b6000604051808303816000875af1158015611828573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906118519190612c4e565b5050505050505092915050565b6118e1846323b872dd60e01b85858560405160240161187f93929190612c97565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118ef565b50505050565b600033905090565b6000611951826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b6a9092919063ffffffff16565b90506000815111156119b1578080602001905181019061197191906128f3565b6119b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a790612d40565b60405180910390fd5b5b505050565b6119be611d20565b6000808473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a309190612de2565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008573ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac69190612e4a565b905085846000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611b4c578284602001818152505081846040018181525050611b61565b82846040018181525050818460200181815250505b50505092915050565b6060611b798484600085611b82565b90509392505050565b606082471015611bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbe90612ee9565b60405180910390fd5b611bd085611c96565b611c0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0690612f55565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611c389190612fb1565b60006040518083038185875af1925050503d8060008114611c75576040519150601f19603f3d011682016040523d82523d6000602084013e611c7a565b606091505b5091509150611c8a828286611cb9565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315611cc957829050611d19565b600083511115611cdc5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d10919061300c565b60405180910390fd5b9392505050565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b611d7e81611d6b565b8114611d8957600080fd5b50565b600081359050611d9b81611d75565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611dcc82611da1565b9050919050565b611ddc81611dc1565b8114611de757600080fd5b50565b600081359050611df981611dd3565b92915050565b60008060408385031215611e1657611e15611d61565b5b6000611e2485828601611d8c565b9250506020611e3585828601611dea565b9150509250929050565b611e4881611dc1565b82525050565b6000602082019050611e636000830184611e3f565b92915050565b600060208284031215611e7f57611e7e611d61565b5b6000611e8d84828501611d8c565b91505092915050565b6000819050919050565b6000611ebb611eb6611eb184611da1565b611e96565b611da1565b9050919050565b6000611ecd82611ea0565b9050919050565b6000611edf82611ec2565b9050919050565b611eef81611ed4565b82525050565b6000602082019050611f0a6000830184611ee6565b92915050565b611f1981611d6b565b82525050565b6000602082019050611f346000830184611f10565b92915050565b600060208284031215611f5057611f4f611d61565b5b6000611f5e84828501611dea565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611fa1578082015181840152602081019050611f86565b60008484015250505050565b6000601f19601f8301169050919050565b6000611fc982611f67565b611fd38185611f72565b9350611fe3818560208601611f83565b611fec81611fad565b840191505092915050565b600060208201905081810360008301526120118184611fbe565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61205b82611fad565b810181811067ffffffffffffffff8211171561207a57612079612023565b5b80604052505050565b600061208d611d57565b90506120998282612052565b919050565b600067ffffffffffffffff8211156120b9576120b8612023565b5b6120c282611fad565b9050602081019050919050565b82818337600083830152505050565b60006120f16120ec8461209e565b612083565b90508281526020810184848401111561210d5761210c61201e565b5b6121188482856120cf565b509392505050565b600082601f83011261213557612134612019565b5b81356121458482602086016120de565b91505092915050565b6000806040838503121561216557612164611d61565b5b600061217385828601611d8c565b925050602083013567ffffffffffffffff81111561219457612193611d66565b5b6121a085828601612120565b9150509250929050565b600080fd5b600080fd5b60008083601f8401126121ca576121c9612019565b5b8235905067ffffffffffffffff8111156121e7576121e66121aa565b5b602083019150836020820283011115612203576122026121af565b5b9250929050565b60008083601f8401126122205761221f612019565b5b8235905067ffffffffffffffff81111561223d5761223c6121aa565b5b602083019150836020820283011115612259576122586121af565b5b9250929050565b60008083601f84011261227657612275612019565b5b8235905067ffffffffffffffff811115612293576122926121aa565b5b6020830191508360018202830111156122af576122ae6121af565b5b9250929050565b600080600080600080600080600060a08a8c0312156122d8576122d7611d61565b5b60008a013567ffffffffffffffff8111156122f6576122f5611d66565b5b6123028c828d016121b4565b995099505060208a013567ffffffffffffffff81111561232557612324611d66565b5b6123318c828d0161220a565b975097505060408a013567ffffffffffffffff81111561235457612353611d66565b5b6123608c828d0161220a565b955095505060606123738c828d01611dea565b93505060808a013567ffffffffffffffff81111561239457612393611d66565b5b6123a08c828d01612260565b92509250509295985092959850929598565b60008115159050919050565b6123c7816123b2565b82525050565b60006020820190506123e260008301846123be565b92915050565b60006123f382611ec2565b9050919050565b612403816123e8565b82525050565b600060208201905061241e60008301846123fa565b92915050565b600062ffffff82169050919050565b61243c81612424565b82525050565b60006020820190506124576000830184612433565b92915050565b60008151905061246c81611d75565b92915050565b60006020828403121561248857612487611d61565b5b60006124968482850161245d565b91505092915050565b600082825260208201905092915050565b7f496e76616c696420616d6f756e74000000000000000000000000000000000000600082015250565b60006124e6600e8361249f565b91506124f1826124b0565b602082019050919050565b60006020820190508181036000830152612515816124d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256357607f821691505b6020821081036125765761257561251c565b5b50919050565b7f4d4556557365723a2063616c6c6572206973206e6f7420746865207573657200600082015250565b60006125b2601f8361249f565b91506125bd8261257c565b602082019050919050565b600060208201905081810360008301526125e1816125a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61264c81611dc1565b82525050565b600061265e8383612643565b60208301905092915050565b6000602082019050919050565b600061268282612617565b61268c8185612622565b935061269783612633565b8060005b838110156126c85781516126af8882612652565b97506126ba8361266a565b92505060018101905061269b565b5085935050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61270a81611d6b565b82525050565b600061271c8383612701565b60208301905092915050565b6000602082019050919050565b6000612740826126d5565b61274a81856126e0565b9350612755836126f1565b8060005b8381101561278657815161276d8882612710565b975061277883612728565b925050600181019050612759565b5085935050505092915050565b600061ffff82169050919050565b6127aa81612793565b82525050565b600060e0820190506127c5600083018a611e3f565b81810360208301526127d78189612677565b905081810360408301526127eb8188612735565b905081810360608301526127ff8187612735565b905061280e6080830186611e3f565b81810360a08301526128208185611fbe565b905061282f60c08301846127a1565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061287582611d6b565b915061288083611d6b565b92508282019050808211156128985761289761283b565b5b92915050565b60006040820190506128b36000830185611e3f565b6128c06020830184611f10565b9392505050565b6128d0816123b2565b81146128db57600080fd5b50565b6000815190506128ed816128c7565b92915050565b60006020828403121561290957612908611d61565b5b6000612917848285016128de565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061297c60268361249f565b915061298782612920565b604082019050919050565b600060208201905081810360008301526129ab8161296f565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006129e860208361249f565b91506129f3826129b2565b602082019050919050565b60006020820190508181036000830152612a17816129db565b9050919050565b612a2781612424565b82525050565b612a3681611da1565b82525050565b61010082016000820151612a536000850182612643565b506020820151612a666020850182612643565b506040820151612a796040850182612a1e565b506060820151612a8c6060850182612643565b506080820151612a9f6080850182612701565b5060a0820151612ab260a0850182612701565b5060c0820151612ac560c0850182612701565b5060e0820151612ad860e0850182612a2d565b50505050565b600061010082019050612af46000830184612a3c565b92915050565b6000606082019050612b0f6000830186611f10565b612b1c6020830185611f10565b612b296040830184611f10565b949350505050565b600060a082019050612b466000830188611f10565b612b536020830187611f10565b8181036040830152612b658186612677565b9050612b746060830185611e3f565b612b816080830184611f10565b9695505050505050565b600067ffffffffffffffff821115612ba657612ba5612023565b5b602082029050602081019050919050565b6000612bca612bc584612b8b565b612083565b90508083825260208201905060208402830185811115612bed57612bec6121af565b5b835b81811015612c165780612c02888261245d565b845260208401935050602081019050612bef565b5050509392505050565b600082601f830112612c3557612c34612019565b5b8151612c45848260208601612bb7565b91505092915050565b600060208284031215612c6457612c63611d61565b5b600082015167ffffffffffffffff811115612c8257612c81611d66565b5b612c8e84828501612c20565b91505092915050565b6000606082019050612cac6000830186611e3f565b612cb96020830185611e3f565b612cc66040830184611f10565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612d2a602a8361249f565b9150612d3582612cce565b604082019050919050565b60006020820190508181036000830152612d5981612d1d565b9050919050565b60006dffffffffffffffffffffffffffff82169050919050565b612d8381612d60565b8114612d8e57600080fd5b50565b600081519050612da081612d7a565b92915050565b600063ffffffff82169050919050565b612dbf81612da6565b8114612dca57600080fd5b50565b600081519050612ddc81612db6565b92915050565b600080600060608486031215612dfb57612dfa611d61565b5b6000612e0986828701612d91565b9350506020612e1a86828701612d91565b9250506040612e2b86828701612dcd565b9150509250925092565b600081519050612e4481611dd3565b92915050565b600060208284031215612e6057612e5f611d61565b5b6000612e6e84828501612e35565b91505092915050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612ed360268361249f565b9150612ede82612e77565b604082019050919050565b60006020820190508181036000830152612f0281612ec6565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612f3f601d8361249f565b9150612f4a82612f09565b602082019050919050565b60006020820190508181036000830152612f6e81612f32565b9050919050565b600081905092915050565b6000612f8b82611f67565b612f958185612f75565b9350612fa5818560208601611f83565b80840191505092915050565b6000612fbd8284612f80565b915081905092915050565b600081519050919050565b6000612fde82612fc8565b612fe8818561249f565b9350612ff8818560208601611f83565b61300181611fad565b840191505092915050565b600060208201905081810360008301526130268184612fd3565b90509291505056fea2646970667358221220a3b546715e642dd3dd3235a0e257b4ed46a63479dff281ac8d3c966702c541c864736f6c63430008100033

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

000000000000000000000000b53c1a33016b2dc2ff3653530bff1848a515c8c5000000000000000000000000cdb1c8bd7f31f6efaede6b616d669561292d9ea5000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f4

-----Decoded View---------------
Arg [0] : _addressProvider (address): 0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5
Arg [1] : _mevUser (address): 0xCDB1c8BD7f31f6EfaeDe6B616d669561292D9Ea5
Arg [2] : _token0 (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [3] : _token1 (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [4] : _fee (uint24): 500

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000b53c1a33016b2dc2ff3653530bff1848a515c8c5
Arg [1] : 000000000000000000000000cdb1c8bd7f31f6efaede6b616d669561292d9ea5
Arg [2] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [3] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [4] : 00000000000000000000000000000000000000000000000000000000000001f4


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.