Contract 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f0x6080604028437632021-11-05 7:44:37874 days 18 hrs ago0x0f3bf5c241b6625c0fa781ed137fde6786b2e66f IN  Create: LemmaRouter0 ETH0.131673850844 ETH1.347326691
[ Download CSV Export 
Latest 6 internal transactions
Parent Txn Hash Block From To Value
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f28437632021-11-05 7:44:37874 days 18 hrs ago 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9 0x4426e7b8bc6fed829c9a310f896a8afbef044ac10 ETH
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f28437632021-11-05 7:44:37874 days 18 hrs ago 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9 0x8b194beae1d3e0788a1a35173978001acdfba6680 ETH
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f28437632021-11-05 7:44:37874 days 18 hrs ago 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9 0x566ea349158b610d1800cb9ec3072931140cbf030 ETH
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f28437632021-11-05 7:44:37874 days 18 hrs ago 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9 Lemma Finance: USD Lemma0 ETH
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f28437632021-11-05 7:44:37874 days 18 hrs ago 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9 Wrapped Ether0 ETH
0xfc4c1ff16c53aacfdbf57b2a871dc18c2c71348a1ffa18dc00f260e72c9e6e9f28437632021-11-05 7:44:37874 days 18 hrs ago 0x9bc0aa456e6caf60b0a1837c3dc8c9019830fcd9 Lemma Finance: xUSDL0 ETH
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
LemmaRouter

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : LemmaRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import {Multicall} from '@uniswap/v3-periphery/contracts/base/Multicall.sol';
import {IWETH9} from '@uniswap/v3-periphery/contracts/interfaces/external/IWETH9.sol';
import {IUSDLemma} from './interfaces/IUSDLemma.sol';
import {IXUSDL} from './interfaces/IXUSDL.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {TransferHelper} from '@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol';
import {IPerpetualWrapper} from './interfaces/IPerpetualWrapper.sol';
import {IUniswapV2Router} from './interfaces/IUniswapV2Router.sol';

/**
    @title Periphery Contract to help with Lemma Contracts
    @author Lemma Finance
*/
contract LemmaRouter is Multicall {
    // ERC20 WETH token address
    IWETH9 public weth;
    // ERC20 USDL token address
    IUSDLemma public usdl;
    // ERC20 xUSDL token address
    IXUSDL public xusdl;
    address public routerSushiswap;

    /**
     * @dev Deploy Lemma Periphery Contract.
            Periphery Contract to help with Lemma Contracts
     * @param _weth WETH ERC20 contract address
     * @param _xusdl XUSDL ERC20 contract address
     * @param _routerSushiswap Sushiswap exchange router contract address
    */
    constructor(
        address _weth,
        address _xusdl,
        address _routerSushiswap
    ) {
        weth = IWETH9(_weth);
        xusdl = IXUSDL(_xusdl);
        usdl = IUSDLemma(address(xusdl.usdl()));
        routerSushiswap = _routerSushiswap;
        TransferHelper.safeApprove(_weth, address(usdl), type(uint256).max);
        TransferHelper.safeApprove(address(usdl), _xusdl, type(uint256).max);
    }

    // To receive ethereum from othre address to this periphery contract
    receive() external payable {}

    /**
     * @dev mint USDL token by depositing collateral and transfer USDL to toAddress
            collateral->USDL 
     * @notice before calling this function,
               user should have to approve this contract for collateral token
     * @param to address where minted usdl will transfer
     * @param amount user want to mint this number of USDL 
     * @param maxCollateralRequired Required collateral should be than than or equal to maxCollateralRequired
     * @param dexIndex Index of perpetual dex, where position will be opened
     * @param collateral collateral token address
    */
    function mintUSDLTo(
        address to,
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral
    ) public {
        uint256 collateralAmountRequired = IPerpetualWrapper(
            usdl.perpetualDEXWrappers(dexIndex, address(collateral))
        ).getCollateralAmountGivenUnderlyingAssetAmount(amount, true);
        TransferHelper.safeTransferFrom(
            address(collateral),
            msg.sender,
            address(this),
            collateralAmountRequired
        );

        usdl.depositTo(to, amount, dexIndex, maxCollateralRequired, collateral);
    }

    /**
     * @dev mint USDL token by depositing weth and transfer USDL to msg.sender
            collateral->USDL 
     * @notice before calling this function,
               user should have to approve this contract for collateral token
     * @param amount user want to mint this number of USDL 
     * @param maxCollateralRequired Required collateral should be less than than or equal to maxCollateralRequired
     * @param dexIndex Index of perpetual dex, where position will be opened
     * @param collateral collateral token address
    */
    function mintUSDL(
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        mintUSDLTo(
            msg.sender,
            amount,
            maxCollateralRequired,
            dexIndex,
            collateral
        );
    }

    /**
     * @dev mint USDL token by depositing weth, and transfer USDL to toAddress
            But before deposit weth, It first convert eth to weth by weth contract address
            ETH->WETH->USDL
     * @param to address where minted usdl will transfer
     * @param amount user want to mint this number of USDL 
     * @param dexIndex Index of perpetual dex, where position will be opened
    */
    function mintUSDLToETH(
        address to,
        uint256 amount,
        uint256 dexIndex
    ) public payable {
        weth.deposit{value: msg.value}();
        usdl.depositTo(to, amount, dexIndex, msg.value, weth);
        weth.withdraw(weth.balanceOf(address(this)));
        TransferHelper.safeTransferETH(msg.sender, address(this).balance);
    }

    /**
     * @dev mint USDL token by depositing weth, and transfer USDL to msg.sender
            But before deposit weth, It first convert eth to weth by weth contract address
            ETH->WETH->USDL
     * @param amount user want to mint this number of USDL 
     * @param dexIndex Index of perpetual dex, where position will be opened
    */
    function mintUSDLETH(uint256 amount, uint256 dexIndex) external payable {
        mintUSDLToETH(msg.sender, amount, dexIndex);
    }

    /**
     * @dev redeemUSDLTo method will burn USDL and will transfer collateral back to toAddress
            USDL->collateral
     * @notice before calling this function,
               user should have to approve this contract for usdl token     
     * @param to toAddress where collateral will transfer
     * @param amount amount of USDL want to redeem for collateral
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack 
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function redeemUSDLTo(
        address to,
        uint256 amount,
        uint256 minCollateralToGetBack,
        uint256 dexIndex,
        IERC20 collateral
    ) public {
        //transfer usdl from user to this address
        TransferHelper.safeTransferFrom(
            address(usdl),
            msg.sender,
            address(this),
            amount
        );
        _redeemUSDL(to, amount, dexIndex, minCollateralToGetBack, collateral);
    }

    /**
     * @dev redeemUSDL method will burn USDL and will transfer collateral back to msg.sender
            USDL->collateral
     * @notice before calling this function,
               user should have to approve this contract for usdl token     
     * @param amount amount of USDL want to redeem for collateral
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack 
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function redeemUSDL(
        uint256 amount,
        uint256 minCollateralToGetBack,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        redeemUSDLTo(
            msg.sender,
            amount,
            minCollateralToGetBack,
            dexIndex,
            collateral
        );
    }

    /**
     * @dev redeemUSDLToETH method will burn USDL and will transfer collateral back to toAddress
            But before withdraw eth, It first convert weth to eth by weth contract address
            USDL->WETH->ETH
            and then send collateral(eth) back to toAddress
     * @notice before calling this function,
               user should have to approve this contract for usdl token     
     * @param to toAddress where collateral will transfer
     * @param amount amount of USDL want to redeem for collateral
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack 
     * @param dexIndex Index of perpetual dex, where position will be closed
    */
    function redeemUSDLToETH(
        address to,
        uint256 amount,
        uint256 minCollateralToGetBack,
        uint256 dexIndex
    ) public {
        TransferHelper.safeTransferFrom(
            address(usdl),
            msg.sender,
            address(this),
            amount
        );
        _redeemUSDL(
            address(this),
            amount,
            dexIndex,
            minCollateralToGetBack,
            weth
        );
        weth.withdraw(weth.balanceOf(address(this)));
        TransferHelper.safeTransferETH(to, address(this).balance);
    }

    /**
     * @dev redeemUSDLTo method will burn USDL and will transfer collateral back to msg.sender
            But before withdraw eth, It first convert weth to eeth by weth contract address
            and then send collateral(eth) back to msg.sender
            USDL->WETH->ETH
     * @notice before calling this function,
               user should have to approve this contract for usdl token     
     * @param amount amount of USDL want to redeem for collateral
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack 
     * @param dexIndex Index of perpetual dex, where position will be closed
    */
    function redeemUSDLETH(
        uint256 amount,
        uint256 minCollateralToGetBack,
        uint256 dexIndex
    ) external {
        redeemUSDLToETH(msg.sender, amount, minCollateralToGetBack, dexIndex);
    }

    /**
     * @dev _redeemUSDL method will burn USDL and will transfer collateral back to toAddress
     * @notice This is the internal method. It will not call by any user
     * @param to toAddress where collateral will transfer
     * @param amount amount of USDL want to redeem for collateral
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack
     * @param collateral collateral token address
     */
    function _redeemUSDL(
        address to,
        uint256 amount,
        uint256 dexIndex,
        uint256 minCollateralToGetBack,
        IERC20 collateral
    ) internal {
        usdl.withdrawTo(
            to,
            amount,
            dexIndex,
            minCollateralToGetBack,
            collateral
        );
    }

    /**
     * @dev swapCollateralForToken method use to swap collateral(eth) for token
     * @notice It is using sushiswap as a router to swap collateral to token.
               It is the internal method.
     * @param collateral collateral is from address to swap
     * @param token specified token is to address for swap
     * @param amountIn collateral amount input
    */
    function swapCollateralForToken(
        address collateral,
        address token,
        uint256 amountIn
    ) internal {
        require(amountIn > 0, 'Nothing to transfer');

        address[] memory path = new address[](2);
        path[0] = collateral;
        path[1] = token;

        uint256 amountOutMin = IUniswapV2Router(routerSushiswap).getAmountsOut(
            amountIn,
            path
        )[1];
        require(amountOutMin > 0, 'No token available');

        // Approve transfer to Sushiswap Router
        require(
            IERC20(collateral).approve(routerSushiswap, amountIn),
            'Approve failed'
        );

        IUniswapV2Router(routerSushiswap).swapExactTokensForTokens(
            amountIn,
            amountOutMin,
            path,
            msg.sender,
            block.timestamp
        );
    }

    /**
     * @dev mintUSDLToUsingToken is used to mint USDL for toAddress
            In this method user can use other tokens to mint usdl
            so tokens will transfer to collateral internally then it will mint usdl
            token->collateral->USDL
     * @notice before calling this function,
               user should have to approve this contract for specified token address   
     * @param token specified token address as collateral and will swap internally token to weth
     * @param tokenAmount is the amount of collateral
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param to transfer minted USDL to toAddress
     * @param amount amount of USDL want to mint
     * @param maxCollateralRequired Required collateral should be less than or equal to max maxCollateralRequired
     * @param dexIndex Index of perpetual dex, where position will be opened
     * @param collateral collateral token address
    */
    function mintUSDLToUsingToken(
        IERC20 token,
        uint256 tokenAmount,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        address to,
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral
    ) public {
        TransferHelper.safeTransferFrom(
            address(token),
            msg.sender,
            address(this),
            tokenAmount
        );
        _swap(token, swapActions, swapDatas, amount, dexIndex, collateral);
        //swap token for collateral
        //mint USDL using the collateral
        usdl.depositTo(to, amount, dexIndex, maxCollateralRequired, collateral);
        //transfer the extra collateral back to user
        swapCollateralForToken(
            address(collateral),
            address(token),
            collateral.balanceOf(address(this))
        );
    }

    /**
     * @dev mintUSDLUsingToken isused to mint USDL for msg.sender
            In this method user can use other tokens to mint usdl
            so tokens will transfer to collateral internally then it will mint usdl
            token->collateral->USDL
     * @notice before calling this function,
               user should have to approve this contract for specified token address   
     * @param token specified token address as collateral and will swap internally token to weth
     * @param tokenAmount is the amount of collateral
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param amount amount of USDL want to mint
     * @param maxCollateralRequired Required collateral should be less than or equal to max maxCollateralRequired
     * @param dexIndex Index of perpetual dex, where position will be opened
     * @param collateral collateral token address
    */
    function mintUSDLUsingToken(
        IERC20 token,
        uint256 tokenAmount,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        TransferHelper.safeTransferFrom(
            address(token),
            msg.sender,
            address(this),
            tokenAmount
        );
        _swap(token, swapActions, swapDatas, amount, dexIndex, collateral);
        //swap token for collateral
        //mint USDL using the collateral
        usdl.depositTo(
            msg.sender,
            amount,
            dexIndex,
            maxCollateralRequired,
            collateral
        );
        //transfer the extra collateral back to user

        swapCollateralForToken(
            address(collateral),
            address(token),
            collateral.balanceOf(address(this))
        );
    }

    /**
     * @dev _swap method is used to swap token for collateral(token -> weth)
     * @notice it is using 1inch protocol to swap
               It is internal method 
     * @param token specified token address as collateral and will swap internally token to weth
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param amount amount of USDL want to mint
     * @param dexIndex Index of perpetual dex, where position will be opened or closed
     * @param collateral collateral token address
    */
    function _swap(
        IERC20 token,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        uint256 amount,
        uint256 dexIndex,
        IERC20 collateral
    ) internal {
        for (uint256 i; i < swapActions.length; i++) {
            (bool success, ) = swapActions[i].call(swapDatas[i]);
            require(success, 'swap failed');
        }
        uint256 collateralAmountRequired = IPerpetualWrapper(
            usdl.perpetualDEXWrappers(dexIndex, address(collateral))
        ).getCollateralAmountGivenUnderlyingAssetAmount(amount, true);

        require(
            collateral.balanceOf(address(this)) >= collateralAmountRequired,
            'swapped amount is less than required'
        );
        require(
            token.balanceOf(address(this)) == 0,
            'all the tokens need to be used'
        );
    }

    /**
     * @dev redeemUSDLToUsingToken is used to redeem USDL from 
            and get back its specied token as a collateral to toAddress
            USDL->collateral->token
     * @notice before calling this function,
               user should have to approve this contract for usdl token
     * @param token specified token address get back after collateral withdraw so will swap internally weth to token
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param to transfer specified tokens to toAddress
     * @param amount amount of USDL want to burn
     * @param minTokenAmount after swap weth to token. tokenAmount should be greater than or equal to minTokenAmount
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function redeemUSDLToUsingToken(
        IERC20 token,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        address to,
        uint256 amount,
        uint256 minTokenAmount,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        TransferHelper.safeTransferFrom(
            address(usdl),
            msg.sender,
            address(this),
            amount
        );

        usdl.withdrawTo(address(this), amount, dexIndex, 0, collateral);

        _swapToToken(token, swapActions, swapDatas, minTokenAmount);

        TransferHelper.safeTransfer(
            address(token),
            to,
            token.balanceOf(address(this))
        );

        swapCollateralForToken(
            address(collateral),
            address(token),
            collateral.balanceOf(address(this))
        );
    }

    /**
     * @dev redeemUSDLUsingToken is used to redeem USDL from 
            and get back its specied token as a collateral to msg.sender
            USDL->collateral->token
     * @notice before calling this function,
               user should have to approve this contract for usdl token
     * @param token specified token address get back after collateral withdraw so will swap internally weth to token
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param amount amount of USDL want to burn
     * @param minTokenAmount after swap weth to token. tokenAmount should be greater than or equal to minTokenAmount
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function redeemUSDLUsingToken(
        IERC20 token,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        uint256 amount,
        uint256 minTokenAmount,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        TransferHelper.safeTransferFrom(
            address(usdl),
            msg.sender,
            address(this),
            amount
        );

        usdl.withdrawTo(address(this), amount, dexIndex, 0, collateral);

        _swapToToken(token, swapActions, swapDatas, minTokenAmount);

        TransferHelper.safeTransfer(
            address(token),
            msg.sender,
            token.balanceOf(address(this))
        );

        swapCollateralForToken(
            address(collateral),
            address(token),
            collateral.balanceOf(address(this))
        );
    }

    /**
     * @dev _swapToToken is usedd to swap collateral(weth) to specified token
     * @notice It is using 1inch protocol to swap
               _swap to token is usedd when user will redeem USDL 
               and user wants its token as collateral instead weth 
     * @param token specified token address get back after swap weth to token
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param minTokenAmount after swap weth to token. tokenAmount should be greater than or equal to minTokenAmount
    */
    function _swapToToken(
        IERC20 token,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        uint256 minTokenAmount
    ) internal {
        for (uint256 i; i < swapActions.length; i++) {
            (bool success, ) = swapActions[i].call(swapDatas[i]);
            require(success, 'swap failed');
        }

        require(
            token.balanceOf(address(this)) >= minTokenAmount,
            'swapped amount is less than token amount required'
        );
    }

    /**
     * @dev stakeUSDL is used to stake USDL in xUSDL contract 
            and msg.sender will get xUSDL as share token
            USDL->xUSDL
     * @notice before calling this function,
               user should have to approve this contract for usdl token
     * @param amount amount od USDL token to stake
    */
    function stakeUSDL(uint256 amount) external {
        TransferHelper.safeTransferFrom(
            address(usdl),
            msg.sender,
            address(this),
            amount
        );
        _stakeUSDLTo(amount, msg.sender);
    }

    /**
     * @dev _stakeUSDLTo is used to stake USDL in xUSDL contract 
            and user address will get xUSDL as share token
            USDL->xUSDL
     * @notice by staking you will get extra USDL as a yield
               _stakeUSDLTo is the internal method
     * @param amount amount od USDL token to stake
     * @param user minted xUSDL tokens to user address
    */
    function _stakeUSDLTo(uint256 amount, address user) internal {
        xusdl.deposit(amount);
        TransferHelper.safeTransfer(
            address(xusdl),
            user,
            xusdl.balanceOf(address(this))
        );
    }

    /**
     * @dev unstakeUSDL is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and msg.sender address will get USDL token get back
            xUSDL->USDL
     * @notice before calling this function,
               msg.sender should have to approve this contract for xUSDL token
     * @param amount amount of xUSDL tokens to burn for withdraw USDL
    */
    function unstakeUSDL(uint256 amount) external {
        unstakeUSDLTo(msg.sender, amount);
    }

    /**
     * @dev unstakeUSDLTo is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and toAddress will get USDL token get back
            xUSDL->USDL
     * @notice before calling this function,
               msg.sender should have to approve this contract for xUSDL token
     * @param to transfer usdl to toAddress
     * @param amount amount of xUSDL tokens to burn for withdraw USDL
    */
    function unstakeUSDLTo(address to, uint256 amount) public {
        TransferHelper.safeTransferFrom(
            address(xusdl),
            msg.sender,
            address(this),
            amount
        );
        xusdl.withdrawTo(to, amount);
    }

    /**
     * @dev mint USDL token by depositing weth, and transfer USDL to address(this)
            But before deposit weth, It first convert eth to weth by weth contract address
            and once contract mint USDL it will stake USDL in xUSDL contract 
            and msg.sender address will get xUSDL as share token
            ETH->WETH->USDL->xUSDL
     * @notice msg.sender should have the eth in his wallet
     * @param amount the amount of collateral tokens
     * @param dexIndex Index of perpetual dex, where position will be opened
    */
    function mintForEthAndStake(uint256 amount, uint256 dexIndex)
        external
        payable
    {
        mintUSDLToETH(address(this), amount, dexIndex);
        _stakeUSDLTo(amount, msg.sender);
    }

    /**
     * @dev mint USDL token by depositing collateral(weth) and transfer USDL to this contract address
            and once contract mint USDL it will stake USDL in xUSDL contract 
            and msg.sender address will get xUSDL as share token
            collateral->USDL->xUSDL
     * @notice before calling this function,
               user should have to approve this contract for collateral token
     * @param amount the amount of collateral tokens
     * @param dexIndex Index of perpetual dex, where position will be opened
     * @param maxCollateralRequired Required collateral should be less than or equal to max maxCollateralRequired
     * @param collateral collateral token address
    */
    function mintAndStake(
        uint256 amount,
        uint256 dexIndex,
        uint256 maxCollateralRequired,
        IERC20 collateral
    ) external {
        mintUSDLTo(
            address(this),
            amount,
            maxCollateralRequired,
            dexIndex,
            collateral
        );
        _stakeUSDLTo(amount, msg.sender);
    }

    /**
     * @dev mintUsingTokenAndStake is mint USDL for address(this).
            In this method user can use other tokens to mint usdl,
            so tokens will transfer to collateral internally then it will mint usdl.
            and once contract mint USDL it will stake USDL in xUSDL contract 
            and msg.sender address will get xUSDL as share token
            token->collateral->USDL->xUSDL
     * @notice before calling this function,
               user should have to approve this contract for specified token address  
     * @param token specified token address as collateral and will swap internally token to weth
     * @param tokenAmount is the amount of collateral 
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param amount amount of USDL want to mint
     * @param maxCollateralRequired Required collateral should be less than or equal to max maxCollateralRequired
     * @param dexIndex Index of perpetual dex, where position will be opened
     * @param collateral collateral token address
    */
    function mintUsingTokenAndStake(
        IERC20 token,
        uint256 tokenAmount,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        mintUSDLToUsingToken(
            token,
            tokenAmount,
            swapActions,
            swapDatas,
            address(this),
            amount,
            maxCollateralRequired,
            dexIndex,
            collateral
        );
        _stakeUSDLTo(amount, msg.sender);
    }

    /**
     * @dev unstakeAndRedeemUSDLForEth is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and address(this) will get USDL token get back
            and once USDL token withdraw, then calling `usdl.withdrawTo` to withdraw weth collateral back
            and swap weth to eth by weth contract and transfer to msg.sender
            xUSDL->USDL->WETH->ETH
     * @notice before calling this function,
               msg.sender should have to approve this contract for xusdl address
     * @param amount the amount of xUSDL tokend to burn and withdraw USDL tokens
     * @param dexIndex Index of perpetual dex, where position will be closed
    */
    function unstakeAndRedeemUSDLForEth(
        uint256 amount,
        uint256 dexIndex,
        uint256 minETHToGetBack
    ) external {
        unstakeAndRedeemUSDLForEthTo(
            msg.sender,
            amount,
            dexIndex,
            minETHToGetBack
        );
    }

    /**
     * @dev unstakeAndRedeemUSDLForEthTo is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and address(this) will get USDL token get back
            and once USDL token withdraw, then calling `usdl.withdrawTo` to withdraw weth collateral back
            and swap weth to eth by weth contract and transfer toAddress
            xUSDL->USDL->WETH->ETH
     * @notice before calling this function,
               msg.sender should have to approve this contract for xusdl address
     * @param to transfer collateral(eth) to toAddress
     * @param amount the amount of xUSDL tokend to burn and withdraw USDL tokens
     * @param dexIndex Index of perpetual dex, where position will be closed
    */
    function unstakeAndRedeemUSDLForEthTo(
        address to,
        uint256 amount,
        uint256 dexIndex,
        uint256 minETHToGetBack
    ) public {
        TransferHelper.safeTransferFrom(
            address(xusdl),
            msg.sender,
            address(this),
            amount
        );
        xusdl.withdraw(amount);
        usdl.withdrawTo(
            address(this),
            usdl.balanceOf(address(this)),
            dexIndex,
            minETHToGetBack,
            weth
        );
        weth.withdraw(weth.balanceOf(address(this)));
        TransferHelper.safeTransferETH(to, address(this).balance);
    }

    /**
     * @dev unstakeAndRedeemUSDL is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and address(this) will get USDL token get back 
            and once USDL token withdraw, _redeemUSDL method will burn USDL and will transfer collateral back to msg.sender
            xUSDL->USDL->collateral
     * @notice before calling this function,
               msg.sender should have to approve this contract for xusdl address
     * @param amount the amount of xUSDL tokens to burn and withdraw USDL tokens
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack 
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function unstakeAndRedeemUSDL(
        uint256 amount,
        uint256 minCollateralToGetBack,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        unstakeAndRedeemUSDLTo(
            msg.sender,
            amount,
            minCollateralToGetBack,
            dexIndex,
            collateral
        );
    }

    /**
     * @dev unstakeAndRedeemUSDL is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and address(this) will get USDL token get back 
            and once USDL token withdraw, _redeemUSDL method will burn USDL and will transfer collateral back toAddress
            xUSDL->USDL->collateral
     * @notice before calling this function,
               msg.sender should have to approve this contract for xusdl address
     * @param to transfer collateral to toAddress
     * @param amount the amount of xUSDL tokens to burn and withdraw USDL tokens
     * @param minCollateralToGetBack collateralAmountToGetBack should be greater than equal to minCollateralToGetBack 
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function unstakeAndRedeemUSDLTo(
        address to,
        uint256 amount,
        uint256 minCollateralToGetBack,
        uint256 dexIndex,
        IERC20 collateral
    ) public {
        TransferHelper.safeTransferFrom(
            address(xusdl),
            msg.sender,
            address(this),
            amount
        );
        xusdl.withdraw(amount);
        _redeemUSDL(
            to,
            usdl.balanceOf(address(this)),
            dexIndex,
            minCollateralToGetBack,
            collateral
        );
    }

    /**
     * @dev unstakeAndRedeemToken is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and address(this) will get USDL token get back 
            and once USDL token withdraw, then calling `usdl.withdrawTo` to withdraw weth collateral back
            and swap weth to specified token by _swapToToken and tranfer specified token to msg.sender
            xUSDL->USDL->collateral->token
     * @notice before calling this function,
               msg.sender should have to approve this contract for xusdl address
     * @param token specified token address get back after collateral withdraw so will swap internally weth to token
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param amount amount of xUSDL want to burn
     * @param minTokenAmount after swap weth to token. tokenAmount should be greater than or equal to minTokenAmount
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function unstakeAndRedeemToken(
        IERC20 token,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        uint256 amount,
        uint256 minTokenAmount,
        uint256 dexIndex,
        IERC20 collateral
    ) external {
        unstakeAndRedeemToToken(
            token,
            swapActions,
            swapDatas,
            msg.sender,
            amount,
            minTokenAmount,
            dexIndex,
            collateral
        );
    }

    /**
     * @dev unstakeAndRedeemToToken is used to withdraw USDL by giving back xUSDL token to xUSDL contract
            and address(this) will get USDL token get back 
            and once USDL token withdraw, then calling `usdl.withdrawTo` to withdraw weth collateral back
            and swap weth to specified token by _swapToToken and tranfer specified token to toAddress
            xUSDL->USDL->collateral->token
     * @notice before calling this function,
               msg.sender should have to approve this contract for xusdl address
     * @param token specified token address get back after collateral withdraw so will swap internally weth to token
     * @param swapActions it is the contract address of dex aggregator of 1inch
     * @param swapDatas it is the function signature which needs to call
     * @param to transfer specified tokens to toAddress
     * @param amount amount of xUSDL want to burn
     * @param minTokenAmount after swap weth to token. tokenAmount should be greater than or equal to minTokenAmount
     * @param dexIndex Index of perpetual dex, where position will be closed
     * @param collateral collateral token address
    */
    function unstakeAndRedeemToToken(
        IERC20 token,
        address[] memory swapActions,
        bytes[] memory swapDatas,
        address to,
        uint256 amount,
        uint256 minTokenAmount,
        uint256 dexIndex,
        IERC20 collateral
    ) public {
        TransferHelper.safeTransferFrom(
            address(xusdl),
            msg.sender,
            address(this),
            amount
        );

        xusdl.withdraw(amount);

        usdl.withdrawTo(
            address(this),
            usdl.balanceOf(address(this)),
            dexIndex,
            0,
            collateral
        );

        _swapToToken(token, swapActions, swapDatas, minTokenAmount);

        TransferHelper.safeTransfer(
            address(token),
            to,
            token.balanceOf(address(this))
        );

        swapCollateralForToken(
            address(collateral),
            address(token),
            collateral.balanceOf(address(this))
        );
    }
}

File 2 of 10 : Multicall.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;

import '../interfaces/IMulticall.sol';

/// @title Multicall
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract Multicall is IMulticall {
    /// @inheritdoc IMulticall
    function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            (bool success, bytes memory result) = address(this).delegatecall(data[i]);

            if (!success) {
                // Next 5 lines from https://ethereum.stackexchange.com/a/83577
                if (result.length < 68) revert();
                assembly {
                    result := add(result, 0x04)
                }
                revert(abi.decode(result, (string)));
            }

            results[i] = result;
        }
    }
}

File 3 of 10 : IWETH9.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;

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

/// @title Interface for WETH9
interface IWETH9 is IERC20 {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256) external;
}

File 4 of 10 : IUSDLemma.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

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

interface IUSDLemma is IERC20 {
    function depositTo(
        address to,
        uint256 amount,
        uint256 perpetualDEXIndex,
        uint256 maxCollateralRequired,
        IERC20 collateral
    ) external;

    function withdrawTo(
        address to,
        uint256 amount,
        uint256 perpetualDEXIndex,
        uint256 minCollateralToGetBack,
        IERC20 collateral
    ) external;

    function perpetualDEXWrappers(uint256 perpetualDEXIndex, address collateral)
        external
        view
        returns (address);
}

File 5 of 10 : IXUSDL.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IXUSDL is IERC20 {
    
    function usdl() external view returns (IERC20); 

    /// @notice Balance of USDL in xUSDL contract
    /// @return Amount of USDL
    function balance() external view returns (uint256);

    /// @notice Minimum blocks user funds need to be locked in contract
    /// @return Minimum blocks for which USDL will be locked
    function MINIMUM_LOCK() external view returns (uint256);

    /// @notice Deposit and mint xUSDL in exchange of USDL
    /// @param amount of USDL to deposit
    /// @return Amount of xUSDL minted
    function deposit(uint256 amount) external returns (uint256);

    /// @notice Withdraw USDL and burn xUSDL
    /// @param shares of xUSDL to burn
    /// @return Amount of USDL withdrawn
    function withdraw(uint256 shares) external returns (uint256);

    /// @notice Withdraw USDL and burn xUSDL
    /// @param user address to withdraw usdl to
    /// @param shares of xUSDL to burn
    /// @return Amount of USDL withdrawn
    function withdrawTo(address user, uint256 shares) external returns (uint256);

    /// @notice Price per share in terms of USDL
    /// @return Price of 1 xUSDL in terms of USDL
    function pricePerShare() external view returns (uint256);

    /// @notice Block number after which user can withdraw USDL
    /// @return Block number after which user can withdraw USDL 
    function userUnlockBlock(address usr) external view returns (uint256);

    function updatePeriphery(address _periphery) external;

}

File 6 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

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

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

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

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

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

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

File 8 of 10 : IPerpetualWrapper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IPerpetualWrapper {
    function open(uint256 amount) external;

    function close(uint256 amount) external;

    function getCollateralAmountGivenUnderlyingAssetAmount(uint256 amount, bool isShorting)
        external
        returns (uint256 collateralAmountRequired);

    function reBalance(
        address _reBalancer,
        int256 amount,
        bytes calldata data
    ) external returns (bool);

    function getAmountInCollateralDecimals(uint256 amount, bool roundUp) external view returns (uint256);
}

File 9 of 10 : IUniswapV2Router.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IUniswapV2Router {
  function getAmountsOut(uint256 amountIn, address[] memory path)
    external
    view
    returns (uint256[] memory amounts);
  
  function swapExactTokensForTokens(
  
    //amount of tokens we are sending in
    uint256 amountIn,
    //the minimum amount of tokens we want out of the trade
    uint256 amountOutMin,
    //list of token addresses we are going to trade in.  this is necessary to calculate amounts
    address[] calldata path,
    //this is the address we are going to send the output tokens to
    address to,
    //the last time that the trade is valid for
    uint256 deadline
  ) external returns (uint256[] memory amounts);
}

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

/// @title Multicall interface
/// @notice Enables calling multiple methods in a single call to the contract
interface IMulticall {
    /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed
    /// @dev The `msg.value` should not be trusted for any method callable from multicall.
    /// @param data The encoded function data for each of the calls to make to this contract
    /// @return results The results from each of the calls passed in via data
    function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_xusdl","type":"address"},{"internalType":"address","name":"_routerSushiswap","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"uint256","name":"maxCollateralRequired","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"mintAndStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"}],"name":"mintForEthAndStake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxCollateralRequired","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"mintUSDL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"}],"name":"mintUSDLETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxCollateralRequired","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"mintUSDLTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"}],"name":"mintUSDLToETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxCollateralRequired","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"mintUSDLToUsingToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxCollateralRequired","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"mintUSDLUsingToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxCollateralRequired","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"mintUsingTokenAndStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minCollateralToGetBack","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"redeemUSDL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minCollateralToGetBack","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"}],"name":"redeemUSDLETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minCollateralToGetBack","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"redeemUSDLTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minCollateralToGetBack","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"}],"name":"redeemUSDLToETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minTokenAmount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"redeemUSDLToUsingToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minTokenAmount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"redeemUSDLUsingToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"routerSushiswap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stakeUSDL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minTokenAmount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"unstakeAndRedeemToToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address[]","name":"swapActions","type":"address[]"},{"internalType":"bytes[]","name":"swapDatas","type":"bytes[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minTokenAmount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"unstakeAndRedeemToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minCollateralToGetBack","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"unstakeAndRedeemUSDL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"uint256","name":"minETHToGetBack","type":"uint256"}],"name":"unstakeAndRedeemUSDLForEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"uint256","name":"minETHToGetBack","type":"uint256"}],"name":"unstakeAndRedeemUSDLForEthTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minCollateralToGetBack","type":"uint256"},{"internalType":"uint256","name":"dexIndex","type":"uint256"},{"internalType":"contract IERC20","name":"collateral","type":"address"}],"name":"unstakeAndRedeemUSDLTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstakeUSDL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstakeUSDLTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdl","outputs":[{"internalType":"contract IUSDLemma","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xusdl","outputs":[{"internalType":"contract IXUSDL","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b50604051620030b8380380620030b88339810160408190526200003491620002aa565b600080546001600160a01b038086166001600160a01b031992831617909255600280548584169216919091179081905560408051637839b2c560e11b81529051919092169163f073658a916004808301926020929190829003018186803b1580156200009f57600080fd5b505afa158015620000b4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000da9190620002fd565b600180546001600160a01b03199081166001600160a01b03938416179182905560038054909116848416179055620001249185911660001962000154602090811b620014f917901c565b6001546200014b906001600160a01b03168360001962000154602090811b620014f917901c565b5050506200033c565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b60208310620001d25780518252601f199092019160209182019101620001b1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811462000236576040519150601f19603f3d011682016040523d82523d6000602084013e6200023b565b606091505b50915091508180156200026c5750805115806200026c57508080602001905160208110156200026957600080fd5b50515b620002a3576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b5050505050565b600080600060608486031215620002bf578283fd5b8351620002cc8162000323565b6020850151909350620002df8162000323565b6040850151909250620002f28162000323565b809150509250925092565b6000602082840312156200030f578081fd5b81516200031c8162000323565b9392505050565b6001600160a01b03811681146200033957600080fd5b50565b612d6c806200034c6000396000f3fe6080604052600436106101c65760003560e01c80638f798e8a116100f7578063e18b186511610095578063ef5a7fb611610064578063ef5a7fb6146104cf578063f073658a146104e2578063f26ebaba146104f7578063f2c25a0414610517576101cd565b8063e18b18651461045a578063e20dde0b1461047a578063e87067a61461049a578063e8c3d001146104ba576101cd565b8063ac9650d8116100d1578063ac9650d8146103e7578063baf9aa9014610407578063cda4115a14610427578063dba9160c14610447576101cd565b80638f798e8a1461038757806391a63e0c146103a75780639e3e3555146103c7576101cd565b80633fc8cef3116101645780634ede79891161013e5780634ede79891461031257806363af710f146103325780637129a33a146103475780637950258414610367576101cd565b80633fc8cef3146102a757806341e99849146102d25780634b462284146102f2576101cd565b806326655b80116101a057806326655b80146102275780632b6e171b1461024757806336589122146102675780633ad8fa7d14610287576101cd565b80630e7ab924146101d257806322282137146101e7578063260aa35c14610207576101cd565b366101cd57005b600080fd5b6101e56101e0366004612311565b610537565b005b3480156101f357600080fd5b506101e561020236600461281f565b6106f2565b34801561021357600080fd5b506101e561022236600461237f565b610717565b34801561023357600080fd5b506101e56102423660046125ab565b61089a565b34801561025357600080fd5b506101e56102623660046122e6565b610a3e565b34801561027357600080fd5b506101e5610282366004612650565b610ada565b34801561029357600080fd5b506101e56102a23660046124f3565b610b9a565b3480156102b357600080fd5b506102bc610c95565b6040516102c99190612976565b60405180910390f35b3480156102de57600080fd5b506101e56102ed36600461237f565b610ca4565b3480156102fe57600080fd5b506101e561030d36600461237f565b610dd4565b34801561031e57600080fd5b506101e561032d366004612345565b610df9565b34801561033e57600080fd5b506102bc610f14565b34801561035357600080fd5b506101e561036236600461289b565b610f23565b34801561037357600080fd5b506101e561038236600461281f565b610f30565b34801561039357600080fd5b506101e56103a236600461270e565b610f3a565b3480156103b357600080fd5b506101e56103c23660046125ab565b610fef565b3480156103d357600080fd5b506101e56103e236600461270e565b610fff565b6103fa6103f53660046123d4565b61101a565b6040516102c991906129d3565b34801561041357600080fd5b506101e561042236600461289b565b611163565b34801561043357600080fd5b506101e5610442366004612870565b61117a565b6101e561045536600461284f565b611186565b34801561046657600080fd5b506101e561047536600461289b565b611195565b34801561048657600080fd5b506101e56104953660046124f3565b6111a2565b3480156104a657600080fd5b506101e56104b5366004612345565b6112eb565b3480156104c657600080fd5b506102bc6114ad565b6101e56104dd36600461284f565b6114bc565b3480156104ee57600080fd5b506102bc6114d1565b34801561050357600080fd5b506101e5610512366004612870565b6114e0565b34801561052357600080fd5b506101e561053236600461289b565b6114ec565b60008054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561058557600080fd5b505af1158015610599573d6000803e3d6000fd5b50506001546000546040516318787a0f60e01b81526001600160a01b0392831695506318787a0f94506105db935088928892889234929091169060040161298a565b600060405180830381600087803b1580156105f557600080fd5b505af1158015610609573d6000803e3d6000fd5b50506000546040516370a0823160e01b81526001600160a01b039091169250632e1a7d4d915082906370a0823190610645903090600401612976565b60206040518083038186803b15801561065d57600080fd5b505afa158015610671573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106959190612837565b6040518263ffffffff1660e01b81526004016106b19190612bb8565b600060405180830381600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050506106ed3347611640565b505050565b60015461070a906001600160a01b031633308461172f565b6107148133611887565b50565b600154604051633cd9561160e01b81526000916001600160a01b031690633cd956119061074a9086908690600401612bc1565b60206040518083038186803b15801561076257600080fd5b505afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906122c3565b6001600160a01b03166392f72def8660016040518363ffffffff1660e01b81526004016107c8929190612bf9565b602060405180830381600087803b1580156107e257600080fd5b505af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190612837565b90506108288233308461172f565b6001546040516318787a0f60e01b81526001600160a01b03909116906318787a0f90610860908990899088908a90899060040161298a565b600060405180830381600087803b15801561087a57600080fd5b505af115801561088e573d6000803e3d6000fd5b50505050505050505050565b6001546108b2906001600160a01b031633308761172f565b60015460405163a9fae5fd60e01b81526001600160a01b039091169063a9fae5fd906108eb90309088908790600090889060040161298a565b600060405180830381600087803b15801561090557600080fd5b505af1158015610919573d6000803e3d6000fd5b5050505061092987878786611940565b6109af8733896001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161095a9190612976565b60206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190612837565b611a95565b610a358188836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b60206040518083038186803b1580156109f857600080fd5b505afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190612837565b611bdc565b50505050505050565b600254610a56906001600160a01b031633308461172f565b60025460405163040b850f60e31b81526001600160a01b039091169063205c287890610a8890859085906004016129ba565b602060405180830381600087803b158015610aa257600080fd5b505af1158015610ab6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ed9190612837565b610ae68933308b61172f565b610af4898888878686611e57565b6001546040516318787a0f60e01b81526001600160a01b03909116906318787a0f90610b2c908890889087908990889060040161298a565b600060405180830381600087803b158015610b4657600080fd5b505af1158015610b5a573d6000803e3d6000fd5b50505050610b8f818a836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b505050505050505050565b600154610bb2906001600160a01b031633308761172f565b60015460405163a9fae5fd60e01b81526001600160a01b039091169063a9fae5fd90610beb90309088908790600090889060040161298a565b600060405180830381600087803b158015610c0557600080fd5b505af1158015610c19573d6000803e3d6000fd5b50505050610c2988888886611940565b610c5a88868a6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161095a9190612976565b610c8b8189836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b5050505050505050565b6000546001600160a01b031681565b600254610cbc906001600160a01b031633308761172f565b600254604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d90610cec908790600401612bb8565b602060405180830381600087803b158015610d0657600080fd5b505af1158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190612837565b506001546040516370a0823160e01b8152610dcd9187916001600160a01b03909116906370a0823190610d75903090600401612976565b60206040518083038186803b158015610d8d57600080fd5b505afa158015610da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc59190612837565b848685612149565b5050505050565b600154610dec906001600160a01b031633308761172f565b610dcd8585848685612149565b600154610e11906001600160a01b031633308661172f565b600054610e2e9030908590849086906001600160a01b0316612149565b6000546040516370a0823160e01b81526001600160a01b0390911690632e1a7d4d9082906370a0823190610e66903090600401612976565b60206040518083038186803b158015610e7e57600080fd5b505afa158015610e92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb69190612837565b6040518263ffffffff1660e01b8152600401610ed29190612bb8565b600060405180830381600087803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050610f0e8447611640565b50505050565b6003546001600160a01b031681565b610f0e3385858585610ca4565b6107143382610a3e565b610f468833308a61172f565b610f54888787878686611e57565b6001546040516318787a0f60e01b81526001600160a01b03909116906318787a0f90610f8c903390889087908990889060040161298a565b600060405180830381600087803b158015610fa657600080fd5b505af1158015610fba573d6000803e3d6000fd5b50505050610c8b8189836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b610a3587878733888888886111a2565b611010888888883089898989610ada565b610c8b8433611887565b60608167ffffffffffffffff8111801561103357600080fd5b5060405190808252806020026020018201604052801561106757816020015b60608152602001906001900390816110525790505b50905060005b8281101561115c576000803086868581811061108557fe5b90506020028101906110979190612c45565b6040516110a592919061294a565b600060405180830381855af49150503d80600081146110e0576040519150601f19603f3d011682016040523d82523d6000602084013e6110e5565b606091505b50915091508161113a576044815110156110fe57600080fd5b6004810190508080602001905181019061111891906127ac565b60405162461bcd60e51b81526004016111319190612a33565b60405180910390fd5b8084848151811061114757fe5b6020908102919091010152505060010161106d565b5092915050565b6111703085848685610717565b610f0e8433611887565b6106ed33848484610df9565b611191338383610537565b5050565b610f0e3385858585610717565b6002546111ba906001600160a01b031633308761172f565b600254604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d906111ea908790600401612bb8565b602060405180830381600087803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123c9190612837565b506001546040516370a0823160e01b81526001600160a01b039091169063a9fae5fd90309083906370a0823190611277908490600401612976565b60206040518083038186803b15801561128f57600080fd5b505afa1580156112a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c79190612837565b856000866040518663ffffffff1660e01b8152600401610beb95949392919061298a565b600254611303906001600160a01b031633308661172f565b600254604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d90611333908690600401612bb8565b602060405180830381600087803b15801561134d57600080fd5b505af1158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190612837565b506001546040516370a0823160e01b81526001600160a01b039091169063a9fae5fd90309083906370a08231906113c0908490600401612976565b60206040518083038186803b1580156113d857600080fd5b505afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114109190612837565b6000546040516001600160e01b031960e086901b168152611443939291889188916001600160a01b03169060040161298a565b600060405180830381600087803b15801561145d57600080fd5b505af1158015611471573d6000803e3d6000fd5b50506000546040516370a0823160e01b81526001600160a01b039091169250632e1a7d4d915082906370a0823190610e66903090600401612976565b6002546001600160a01b031681565b6114c7308383610537565b6111918233611887565b6001546001600160a01b031681565b6106ed338484846112eb565b610f0e3385858585610dd4565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b602083106115755780518252601f199092019160209182019101611556565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146115d7576040519150601f19603f3d011682016040523d82523d6000602084013e6115dc565b606091505b509150915081801561160a57508051158061160a575080806020019051602081101561160757600080fd5b50515b610dcd576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b6020831061168c5780518252601f19909201916020918201910161166d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146116ee576040519150601f19603f3d011682016040523d82523d6000602084013e6116f3565b606091505b50509050806106ed576040805162461bcd60e51b815260206004820152600360248201526253544560e81b604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b178152925182516000948594938a169392918291908083835b602083106117b35780518252601f199092019160209182019101611794565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611815576040519150601f19603f3d011682016040523d82523d6000602084013e61181a565b606091505b5091509150818015611848575080511580611848575080806020019051602081101561184557600080fd5b50515b61187f576040805162461bcd60e51b815260206004820152600360248201526229aa2360e91b604482015290519081900360640190fd5b505050505050565b60025460405163b6b55f2560e01b81526001600160a01b039091169063b6b55f25906118b7908590600401612bb8565b602060405180830381600087803b1580156118d157600080fd5b505af11580156118e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119099190612837565b506002546040516370a0823160e01b8152611191916001600160a01b031690839082906370a082319061095a903090600401612976565b60005b83518110156119f857600084828151811061195a57fe5b60200260200101516001600160a01b031684838151811061197757fe5b602002602001015160405161198c919061295a565b6000604051808303816000865af19150503d80600081146119c9576040519150601f19603f3d011682016040523d82523d6000602084013e6119ce565b606091505b50509050806119ef5760405162461bcd60e51b815260040161113190612b93565b50600101611943565b506040516370a0823160e01b815281906001600160a01b038616906370a0823190611a27903090600401612976565b60206040518083038186803b158015611a3f57600080fd5b505afa158015611a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a779190612837565b1015610f0e5760405162461bcd60e51b815260040161113190612a9a565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310611b115780518252601f199092019160209182019101611af2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611b73576040519150601f19603f3d011682016040523d82523d6000602084013e611b78565b606091505b5091509150818015611ba6575080511580611ba65750808060200190516020811015611ba357600080fd5b50515b610dcd576040805162461bcd60e51b815260206004820152600260248201526114d560f21b604482015290519081900360640190fd5b60008111611bfc5760405162461bcd60e51b815260040161113190612aeb565b6040805160028082526060820183526000926020830190803683370190505090508381600081518110611c2b57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110611c5957fe5b6001600160a01b03928316602091820292909201015260035460405163d06ca61f60e01b8152600092919091169063d06ca61f90611c9d9086908690600401612bd8565b60006040518083038186803b158015611cb557600080fd5b505afa158015611cc9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611cf19190810190612443565b600181518110611cfd57fe5b6020026020010151905060008111611d275760405162461bcd60e51b815260040161113190612a46565b60035460405163095ea7b360e01b81526001600160a01b038781169263095ea7b392611d5b929091169087906004016129ba565b602060405180830381600087803b158015611d7557600080fd5b505af1158015611d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dad91906124d3565b611dc95760405162461bcd60e51b815260040161113190612a72565b6003546040516338ed173960e01b81526001600160a01b03909116906338ed173990611e019086908590879033904290600401612c09565b600060405180830381600087803b158015611e1b57600080fd5b505af1158015611e2f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261187f9190810190612443565b60005b8551811015611f0f576000868281518110611e7157fe5b60200260200101516001600160a01b0316868381518110611e8e57fe5b6020026020010151604051611ea3919061295a565b6000604051808303816000865af19150503d8060008114611ee0576040519150601f19603f3d011682016040523d82523d6000602084013e611ee5565b606091505b5050905080611f065760405162461bcd60e51b815260040161113190612b93565b50600101611e5a565b50600154604051633cd9561160e01b81526000916001600160a01b031690633cd9561190611f439086908690600401612bc1565b60206040518083038186803b158015611f5b57600080fd5b505afa158015611f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9391906122c3565b6001600160a01b03166392f72def8560016040518363ffffffff1660e01b8152600401611fc1929190612bf9565b602060405180830381600087803b158015611fdb57600080fd5b505af1158015611fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120139190612837565b905080826001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016120429190612976565b60206040518083038186803b15801561205a57600080fd5b505afa15801561206e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120929190612837565b10156120b05760405162461bcd60e51b815260040161113190612b4f565b6040516370a0823160e01b81526001600160a01b038816906370a08231906120dc903090600401612976565b60206040518083038186803b1580156120f457600080fd5b505afa158015612108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212c9190612837565b15610a355760405162461bcd60e51b815260040161113190612b18565b60015460405163a9fae5fd60e01b81526001600160a01b039091169063a9fae5fd90612181908890889088908890889060040161298a565b600060405180830381600087803b15801561219b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b80356121ba81612d21565b919050565b600082601f8301126121cf578081fd5b813560206121e46121df83612cb5565b612c91565b8281528181019085830183850287018401881015612200578586fd5b855b8581101561222757813561221581612d21565b84529284019290840190600101612202565b5090979650505050505050565b600082601f830112612244578081fd5b813560206122546121df83612cb5565b82815281810190858301855b85811015612227578135880189603f82011261227a578788fd5b85810135604061228c6121df83612cd3565b8281528c8284860101111561229f578a8bfd5b828285018a83013791820188018a9052508552509284019290840190600101612260565b6000602082840312156122d4578081fd5b81516122df81612d21565b9392505050565b600080604083850312156122f8578081fd5b823561230381612d21565b946020939093013593505050565b600080600060608486031215612325578081fd5b833561233081612d21565b95602085013595506040909401359392505050565b6000806000806080858703121561235a578081fd5b843561236581612d21565b966020860135965060408601359560600135945092505050565b600080600080600060a08688031215612396578081fd5b85356123a181612d21565b945060208601359350604086013592506060860135915060808601356123c681612d21565b809150509295509295909350565b600080602083850312156123e6578182fd5b823567ffffffffffffffff808211156123fd578384fd5b818501915085601f830112612410578384fd5b81358181111561241e578485fd5b8660208083028501011115612431578485fd5b60209290920196919550909350505050565b60006020808385031215612455578182fd5b825167ffffffffffffffff81111561246b578283fd5b8301601f8101851361247b578283fd5b80516124896121df82612cb5565b81815283810190838501858402850186018910156124a5578687fd5b8694505b838510156124c75780518352600194909401939185019185016124a9565b50979650505050505050565b6000602082840312156124e4578081fd5b815180151581146122df578182fd5b600080600080600080600080610100898b03121561250f578586fd5b883561251a81612d21565b9750602089013567ffffffffffffffff80821115612536578788fd5b6125428c838d016121bf565b985060408b0135915080821115612557578788fd5b506125648b828c01612234565b965050606089013561257581612d21565b94506080890135935060a0890135925060c0890135915060e089013561259a81612d21565b809150509295985092959890939650565b600080600080600080600060e0888a0312156125c5578081fd5b87356125d081612d21565b9650602088013567ffffffffffffffff808211156125ec578283fd5b6125f88b838c016121bf565b975060408a013591508082111561260d578283fd5b5061261a8a828b01612234565b955050606088013593506080880135925060a0880135915060c088013561264081612d21565b8091505092959891949750929550565b60008060008060008060008060006101208a8c03121561266e578283fd5b893561267981612d21565b985060208a0135975060408a013567ffffffffffffffff8082111561269c578485fd5b6126a88d838e016121bf565b985060608c01359150808211156126bd578485fd5b506126ca8c828d01612234565b96505060808a01356126db81612d21565b945060a08a0135935060c08a0135925060e08a013591506126ff6101008b016121af565b90509295985092959850929598565b600080600080600080600080610100898b03121561272a578182fd5b883561273581612d21565b975060208901359650604089013567ffffffffffffffff80821115612758578384fd5b6127648c838d016121bf565b975060608b0135915080821115612779578384fd5b506127868b828c01612234565b9550506080890135935060a0890135925060c0890135915060e089013561259a81612d21565b6000602082840312156127bd578081fd5b815167ffffffffffffffff8111156127d3578182fd5b8201601f810184136127e3578182fd5b80516127f16121df82612cd3565b818152856020838501011115612805578384fd5b612816826020830160208601612cf5565b95945050505050565b600060208284031215612830578081fd5b5035919050565b600060208284031215612848578081fd5b5051919050565b60008060408385031215612861578182fd5b50508035926020909101359150565b600080600060608486031215612884578081fd5b505081359360208301359350604090920135919050565b600080600080608085870312156128b0578182fd5b84359350602085013592506040850135915060608501356128d081612d21565b939692955090935050565b6000815180845260208085019450808401835b838110156129135781516001600160a01b0316875295820195908201906001016128ee565b509495945050505050565b60008151808452612936816020860160208601612cf5565b601f01601f19169290920160200192915050565b6000828483379101908152919050565b6000825161296c818460208701612cf5565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039586168152602081019490945260408401929092526060830152909116608082015260a00190565b6001600160a01b03929092168252602082015260400190565b6000602080830181845280855180835260408601915060408482028701019250838701855b82811015612a2657603f19888603018452612a1485835161291e565b945092850192908501906001016129f8565b5092979650505050505050565b6000602082526122df602083018461291e565b6020808252601290820152714e6f20746f6b656e20617661696c61626c6560701b604082015260600190565b6020808252600e908201526d105c1c1c9bdd994819985a5b195960921b604082015260600190565b60208082526031908201527f7377617070656420616d6f756e74206973206c657373207468616e20746f6b656040820152701b88185b5bdd5b9d081c995c5d5a5c9959607a1b606082015260800190565b6020808252601390820152722737ba3434b733903a37903a3930b739b332b960691b604082015260600190565b6020808252601e908201527f616c6c2074686520746f6b656e73206e65656420746f20626520757365640000604082015260600190565b60208082526024908201527f7377617070656420616d6f756e74206973206c657373207468616e20726571756040820152631a5c995960e21b606082015260800190565b6020808252600b908201526a1cddd85c0819985a5b195960aa1b604082015260600190565b90815260200190565b9182526001600160a01b0316602082015260400190565b600083825260406020830152612bf160408301846128db565b949350505050565b9182521515602082015260400190565b600086825285602083015260a06040830152612c2860a08301866128db565b6001600160a01b0394909416606083015250608001529392505050565b6000808335601e19843603018112612c5b578283fd5b83018035915067ffffffffffffffff821115612c75578283fd5b602001915036819003821315612c8a57600080fd5b9250929050565b60405181810167ffffffffffffffff81118282101715612cad57fe5b604052919050565b600067ffffffffffffffff821115612cc957fe5b5060209081020190565b600067ffffffffffffffff821115612ce757fe5b50601f01601f191660200190565b60005b83811015612d10578181015183820152602001612cf8565b83811115610f0e5750506000910152565b6001600160a01b038116811461071457600080fdfea2646970667358221220f1e29dc0ed522bb3fb538e664ecf4b4e92e6fd789dd062bc2fb1aae5c6d9513f64736f6c6343000706003300000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000057c7e0d43c05bce429ce030132ca40f6fa5839d70000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b47997506

Deployed Bytecode

0x6080604052600436106101c65760003560e01c80638f798e8a116100f7578063e18b186511610095578063ef5a7fb611610064578063ef5a7fb6146104cf578063f073658a146104e2578063f26ebaba146104f7578063f2c25a0414610517576101cd565b8063e18b18651461045a578063e20dde0b1461047a578063e87067a61461049a578063e8c3d001146104ba576101cd565b8063ac9650d8116100d1578063ac9650d8146103e7578063baf9aa9014610407578063cda4115a14610427578063dba9160c14610447576101cd565b80638f798e8a1461038757806391a63e0c146103a75780639e3e3555146103c7576101cd565b80633fc8cef3116101645780634ede79891161013e5780634ede79891461031257806363af710f146103325780637129a33a146103475780637950258414610367576101cd565b80633fc8cef3146102a757806341e99849146102d25780634b462284146102f2576101cd565b806326655b80116101a057806326655b80146102275780632b6e171b1461024757806336589122146102675780633ad8fa7d14610287576101cd565b80630e7ab924146101d257806322282137146101e7578063260aa35c14610207576101cd565b366101cd57005b600080fd5b6101e56101e0366004612311565b610537565b005b3480156101f357600080fd5b506101e561020236600461281f565b6106f2565b34801561021357600080fd5b506101e561022236600461237f565b610717565b34801561023357600080fd5b506101e56102423660046125ab565b61089a565b34801561025357600080fd5b506101e56102623660046122e6565b610a3e565b34801561027357600080fd5b506101e5610282366004612650565b610ada565b34801561029357600080fd5b506101e56102a23660046124f3565b610b9a565b3480156102b357600080fd5b506102bc610c95565b6040516102c99190612976565b60405180910390f35b3480156102de57600080fd5b506101e56102ed36600461237f565b610ca4565b3480156102fe57600080fd5b506101e561030d36600461237f565b610dd4565b34801561031e57600080fd5b506101e561032d366004612345565b610df9565b34801561033e57600080fd5b506102bc610f14565b34801561035357600080fd5b506101e561036236600461289b565b610f23565b34801561037357600080fd5b506101e561038236600461281f565b610f30565b34801561039357600080fd5b506101e56103a236600461270e565b610f3a565b3480156103b357600080fd5b506101e56103c23660046125ab565b610fef565b3480156103d357600080fd5b506101e56103e236600461270e565b610fff565b6103fa6103f53660046123d4565b61101a565b6040516102c991906129d3565b34801561041357600080fd5b506101e561042236600461289b565b611163565b34801561043357600080fd5b506101e5610442366004612870565b61117a565b6101e561045536600461284f565b611186565b34801561046657600080fd5b506101e561047536600461289b565b611195565b34801561048657600080fd5b506101e56104953660046124f3565b6111a2565b3480156104a657600080fd5b506101e56104b5366004612345565b6112eb565b3480156104c657600080fd5b506102bc6114ad565b6101e56104dd36600461284f565b6114bc565b3480156104ee57600080fd5b506102bc6114d1565b34801561050357600080fd5b506101e5610512366004612870565b6114e0565b34801561052357600080fd5b506101e561053236600461289b565b6114ec565b60008054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561058557600080fd5b505af1158015610599573d6000803e3d6000fd5b50506001546000546040516318787a0f60e01b81526001600160a01b0392831695506318787a0f94506105db935088928892889234929091169060040161298a565b600060405180830381600087803b1580156105f557600080fd5b505af1158015610609573d6000803e3d6000fd5b50506000546040516370a0823160e01b81526001600160a01b039091169250632e1a7d4d915082906370a0823190610645903090600401612976565b60206040518083038186803b15801561065d57600080fd5b505afa158015610671573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106959190612837565b6040518263ffffffff1660e01b81526004016106b19190612bb8565b600060405180830381600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050506106ed3347611640565b505050565b60015461070a906001600160a01b031633308461172f565b6107148133611887565b50565b600154604051633cd9561160e01b81526000916001600160a01b031690633cd956119061074a9086908690600401612bc1565b60206040518083038186803b15801561076257600080fd5b505afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906122c3565b6001600160a01b03166392f72def8660016040518363ffffffff1660e01b81526004016107c8929190612bf9565b602060405180830381600087803b1580156107e257600080fd5b505af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190612837565b90506108288233308461172f565b6001546040516318787a0f60e01b81526001600160a01b03909116906318787a0f90610860908990899088908a90899060040161298a565b600060405180830381600087803b15801561087a57600080fd5b505af115801561088e573d6000803e3d6000fd5b50505050505050505050565b6001546108b2906001600160a01b031633308761172f565b60015460405163a9fae5fd60e01b81526001600160a01b039091169063a9fae5fd906108eb90309088908790600090889060040161298a565b600060405180830381600087803b15801561090557600080fd5b505af1158015610919573d6000803e3d6000fd5b5050505061092987878786611940565b6109af8733896001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161095a9190612976565b60206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190612837565b611a95565b610a358188836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b60206040518083038186803b1580156109f857600080fd5b505afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190612837565b611bdc565b50505050505050565b600254610a56906001600160a01b031633308461172f565b60025460405163040b850f60e31b81526001600160a01b039091169063205c287890610a8890859085906004016129ba565b602060405180830381600087803b158015610aa257600080fd5b505af1158015610ab6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ed9190612837565b610ae68933308b61172f565b610af4898888878686611e57565b6001546040516318787a0f60e01b81526001600160a01b03909116906318787a0f90610b2c908890889087908990889060040161298a565b600060405180830381600087803b158015610b4657600080fd5b505af1158015610b5a573d6000803e3d6000fd5b50505050610b8f818a836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b505050505050505050565b600154610bb2906001600160a01b031633308761172f565b60015460405163a9fae5fd60e01b81526001600160a01b039091169063a9fae5fd90610beb90309088908790600090889060040161298a565b600060405180830381600087803b158015610c0557600080fd5b505af1158015610c19573d6000803e3d6000fd5b50505050610c2988888886611940565b610c5a88868a6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161095a9190612976565b610c8b8189836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b5050505050505050565b6000546001600160a01b031681565b600254610cbc906001600160a01b031633308761172f565b600254604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d90610cec908790600401612bb8565b602060405180830381600087803b158015610d0657600080fd5b505af1158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190612837565b506001546040516370a0823160e01b8152610dcd9187916001600160a01b03909116906370a0823190610d75903090600401612976565b60206040518083038186803b158015610d8d57600080fd5b505afa158015610da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc59190612837565b848685612149565b5050505050565b600154610dec906001600160a01b031633308761172f565b610dcd8585848685612149565b600154610e11906001600160a01b031633308661172f565b600054610e2e9030908590849086906001600160a01b0316612149565b6000546040516370a0823160e01b81526001600160a01b0390911690632e1a7d4d9082906370a0823190610e66903090600401612976565b60206040518083038186803b158015610e7e57600080fd5b505afa158015610e92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb69190612837565b6040518263ffffffff1660e01b8152600401610ed29190612bb8565b600060405180830381600087803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050610f0e8447611640565b50505050565b6003546001600160a01b031681565b610f0e3385858585610ca4565b6107143382610a3e565b610f468833308a61172f565b610f54888787878686611e57565b6001546040516318787a0f60e01b81526001600160a01b03909116906318787a0f90610f8c903390889087908990889060040161298a565b600060405180830381600087803b158015610fa657600080fd5b505af1158015610fba573d6000803e3d6000fd5b50505050610c8b8189836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109e09190612976565b610a3587878733888888886111a2565b611010888888883089898989610ada565b610c8b8433611887565b60608167ffffffffffffffff8111801561103357600080fd5b5060405190808252806020026020018201604052801561106757816020015b60608152602001906001900390816110525790505b50905060005b8281101561115c576000803086868581811061108557fe5b90506020028101906110979190612c45565b6040516110a592919061294a565b600060405180830381855af49150503d80600081146110e0576040519150601f19603f3d011682016040523d82523d6000602084013e6110e5565b606091505b50915091508161113a576044815110156110fe57600080fd5b6004810190508080602001905181019061111891906127ac565b60405162461bcd60e51b81526004016111319190612a33565b60405180910390fd5b8084848151811061114757fe5b6020908102919091010152505060010161106d565b5092915050565b6111703085848685610717565b610f0e8433611887565b6106ed33848484610df9565b611191338383610537565b5050565b610f0e3385858585610717565b6002546111ba906001600160a01b031633308761172f565b600254604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d906111ea908790600401612bb8565b602060405180830381600087803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123c9190612837565b506001546040516370a0823160e01b81526001600160a01b039091169063a9fae5fd90309083906370a0823190611277908490600401612976565b60206040518083038186803b15801561128f57600080fd5b505afa1580156112a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c79190612837565b856000866040518663ffffffff1660e01b8152600401610beb95949392919061298a565b600254611303906001600160a01b031633308661172f565b600254604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d90611333908690600401612bb8565b602060405180830381600087803b15801561134d57600080fd5b505af1158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190612837565b506001546040516370a0823160e01b81526001600160a01b039091169063a9fae5fd90309083906370a08231906113c0908490600401612976565b60206040518083038186803b1580156113d857600080fd5b505afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114109190612837565b6000546040516001600160e01b031960e086901b168152611443939291889188916001600160a01b03169060040161298a565b600060405180830381600087803b15801561145d57600080fd5b505af1158015611471573d6000803e3d6000fd5b50506000546040516370a0823160e01b81526001600160a01b039091169250632e1a7d4d915082906370a0823190610e66903090600401612976565b6002546001600160a01b031681565b6114c7308383610537565b6111918233611887565b6001546001600160a01b031681565b6106ed338484846112eb565b610f0e3385858585610dd4565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b602083106115755780518252601f199092019160209182019101611556565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146115d7576040519150601f19603f3d011682016040523d82523d6000602084013e6115dc565b606091505b509150915081801561160a57508051158061160a575080806020019051602081101561160757600080fd5b50515b610dcd576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b6020831061168c5780518252601f19909201916020918201910161166d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146116ee576040519150601f19603f3d011682016040523d82523d6000602084013e6116f3565b606091505b50509050806106ed576040805162461bcd60e51b815260206004820152600360248201526253544560e81b604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b178152925182516000948594938a169392918291908083835b602083106117b35780518252601f199092019160209182019101611794565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611815576040519150601f19603f3d011682016040523d82523d6000602084013e61181a565b606091505b5091509150818015611848575080511580611848575080806020019051602081101561184557600080fd5b50515b61187f576040805162461bcd60e51b815260206004820152600360248201526229aa2360e91b604482015290519081900360640190fd5b505050505050565b60025460405163b6b55f2560e01b81526001600160a01b039091169063b6b55f25906118b7908590600401612bb8565b602060405180830381600087803b1580156118d157600080fd5b505af11580156118e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119099190612837565b506002546040516370a0823160e01b8152611191916001600160a01b031690839082906370a082319061095a903090600401612976565b60005b83518110156119f857600084828151811061195a57fe5b60200260200101516001600160a01b031684838151811061197757fe5b602002602001015160405161198c919061295a565b6000604051808303816000865af19150503d80600081146119c9576040519150601f19603f3d011682016040523d82523d6000602084013e6119ce565b606091505b50509050806119ef5760405162461bcd60e51b815260040161113190612b93565b50600101611943565b506040516370a0823160e01b815281906001600160a01b038616906370a0823190611a27903090600401612976565b60206040518083038186803b158015611a3f57600080fd5b505afa158015611a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a779190612837565b1015610f0e5760405162461bcd60e51b815260040161113190612a9a565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310611b115780518252601f199092019160209182019101611af2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611b73576040519150601f19603f3d011682016040523d82523d6000602084013e611b78565b606091505b5091509150818015611ba6575080511580611ba65750808060200190516020811015611ba357600080fd5b50515b610dcd576040805162461bcd60e51b815260206004820152600260248201526114d560f21b604482015290519081900360640190fd5b60008111611bfc5760405162461bcd60e51b815260040161113190612aeb565b6040805160028082526060820183526000926020830190803683370190505090508381600081518110611c2b57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110611c5957fe5b6001600160a01b03928316602091820292909201015260035460405163d06ca61f60e01b8152600092919091169063d06ca61f90611c9d9086908690600401612bd8565b60006040518083038186803b158015611cb557600080fd5b505afa158015611cc9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611cf19190810190612443565b600181518110611cfd57fe5b6020026020010151905060008111611d275760405162461bcd60e51b815260040161113190612a46565b60035460405163095ea7b360e01b81526001600160a01b038781169263095ea7b392611d5b929091169087906004016129ba565b602060405180830381600087803b158015611d7557600080fd5b505af1158015611d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dad91906124d3565b611dc95760405162461bcd60e51b815260040161113190612a72565b6003546040516338ed173960e01b81526001600160a01b03909116906338ed173990611e019086908590879033904290600401612c09565b600060405180830381600087803b158015611e1b57600080fd5b505af1158015611e2f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261187f9190810190612443565b60005b8551811015611f0f576000868281518110611e7157fe5b60200260200101516001600160a01b0316868381518110611e8e57fe5b6020026020010151604051611ea3919061295a565b6000604051808303816000865af19150503d8060008114611ee0576040519150601f19603f3d011682016040523d82523d6000602084013e611ee5565b606091505b5050905080611f065760405162461bcd60e51b815260040161113190612b93565b50600101611e5a565b50600154604051633cd9561160e01b81526000916001600160a01b031690633cd9561190611f439086908690600401612bc1565b60206040518083038186803b158015611f5b57600080fd5b505afa158015611f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9391906122c3565b6001600160a01b03166392f72def8560016040518363ffffffff1660e01b8152600401611fc1929190612bf9565b602060405180830381600087803b158015611fdb57600080fd5b505af1158015611fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120139190612837565b905080826001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016120429190612976565b60206040518083038186803b15801561205a57600080fd5b505afa15801561206e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120929190612837565b10156120b05760405162461bcd60e51b815260040161113190612b4f565b6040516370a0823160e01b81526001600160a01b038816906370a08231906120dc903090600401612976565b60206040518083038186803b1580156120f457600080fd5b505afa158015612108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212c9190612837565b15610a355760405162461bcd60e51b815260040161113190612b18565b60015460405163a9fae5fd60e01b81526001600160a01b039091169063a9fae5fd90612181908890889088908890889060040161298a565b600060405180830381600087803b15801561219b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b80356121ba81612d21565b919050565b600082601f8301126121cf578081fd5b813560206121e46121df83612cb5565b612c91565b8281528181019085830183850287018401881015612200578586fd5b855b8581101561222757813561221581612d21565b84529284019290840190600101612202565b5090979650505050505050565b600082601f830112612244578081fd5b813560206122546121df83612cb5565b82815281810190858301855b85811015612227578135880189603f82011261227a578788fd5b85810135604061228c6121df83612cd3565b8281528c8284860101111561229f578a8bfd5b828285018a83013791820188018a9052508552509284019290840190600101612260565b6000602082840312156122d4578081fd5b81516122df81612d21565b9392505050565b600080604083850312156122f8578081fd5b823561230381612d21565b946020939093013593505050565b600080600060608486031215612325578081fd5b833561233081612d21565b95602085013595506040909401359392505050565b6000806000806080858703121561235a578081fd5b843561236581612d21565b966020860135965060408601359560600135945092505050565b600080600080600060a08688031215612396578081fd5b85356123a181612d21565b945060208601359350604086013592506060860135915060808601356123c681612d21565b809150509295509295909350565b600080602083850312156123e6578182fd5b823567ffffffffffffffff808211156123fd578384fd5b818501915085601f830112612410578384fd5b81358181111561241e578485fd5b8660208083028501011115612431578485fd5b60209290920196919550909350505050565b60006020808385031215612455578182fd5b825167ffffffffffffffff81111561246b578283fd5b8301601f8101851361247b578283fd5b80516124896121df82612cb5565b81815283810190838501858402850186018910156124a5578687fd5b8694505b838510156124c75780518352600194909401939185019185016124a9565b50979650505050505050565b6000602082840312156124e4578081fd5b815180151581146122df578182fd5b600080600080600080600080610100898b03121561250f578586fd5b883561251a81612d21565b9750602089013567ffffffffffffffff80821115612536578788fd5b6125428c838d016121bf565b985060408b0135915080821115612557578788fd5b506125648b828c01612234565b965050606089013561257581612d21565b94506080890135935060a0890135925060c0890135915060e089013561259a81612d21565b809150509295985092959890939650565b600080600080600080600060e0888a0312156125c5578081fd5b87356125d081612d21565b9650602088013567ffffffffffffffff808211156125ec578283fd5b6125f88b838c016121bf565b975060408a013591508082111561260d578283fd5b5061261a8a828b01612234565b955050606088013593506080880135925060a0880135915060c088013561264081612d21565b8091505092959891949750929550565b60008060008060008060008060006101208a8c03121561266e578283fd5b893561267981612d21565b985060208a0135975060408a013567ffffffffffffffff8082111561269c578485fd5b6126a88d838e016121bf565b985060608c01359150808211156126bd578485fd5b506126ca8c828d01612234565b96505060808a01356126db81612d21565b945060a08a0135935060c08a0135925060e08a013591506126ff6101008b016121af565b90509295985092959850929598565b600080600080600080600080610100898b03121561272a578182fd5b883561273581612d21565b975060208901359650604089013567ffffffffffffffff80821115612758578384fd5b6127648c838d016121bf565b975060608b0135915080821115612779578384fd5b506127868b828c01612234565b9550506080890135935060a0890135925060c0890135915060e089013561259a81612d21565b6000602082840312156127bd578081fd5b815167ffffffffffffffff8111156127d3578182fd5b8201601f810184136127e3578182fd5b80516127f16121df82612cd3565b818152856020838501011115612805578384fd5b612816826020830160208601612cf5565b95945050505050565b600060208284031215612830578081fd5b5035919050565b600060208284031215612848578081fd5b5051919050565b60008060408385031215612861578182fd5b50508035926020909101359150565b600080600060608486031215612884578081fd5b505081359360208301359350604090920135919050565b600080600080608085870312156128b0578182fd5b84359350602085013592506040850135915060608501356128d081612d21565b939692955090935050565b6000815180845260208085019450808401835b838110156129135781516001600160a01b0316875295820195908201906001016128ee565b509495945050505050565b60008151808452612936816020860160208601612cf5565b601f01601f19169290920160200192915050565b6000828483379101908152919050565b6000825161296c818460208701612cf5565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039586168152602081019490945260408401929092526060830152909116608082015260a00190565b6001600160a01b03929092168252602082015260400190565b6000602080830181845280855180835260408601915060408482028701019250838701855b82811015612a2657603f19888603018452612a1485835161291e565b945092850192908501906001016129f8565b5092979650505050505050565b6000602082526122df602083018461291e565b6020808252601290820152714e6f20746f6b656e20617661696c61626c6560701b604082015260600190565b6020808252600e908201526d105c1c1c9bdd994819985a5b195960921b604082015260600190565b60208082526031908201527f7377617070656420616d6f756e74206973206c657373207468616e20746f6b656040820152701b88185b5bdd5b9d081c995c5d5a5c9959607a1b606082015260800190565b6020808252601390820152722737ba3434b733903a37903a3930b739b332b960691b604082015260600190565b6020808252601e908201527f616c6c2074686520746f6b656e73206e65656420746f20626520757365640000604082015260600190565b60208082526024908201527f7377617070656420616d6f756e74206973206c657373207468616e20726571756040820152631a5c995960e21b606082015260800190565b6020808252600b908201526a1cddd85c0819985a5b195960aa1b604082015260600190565b90815260200190565b9182526001600160a01b0316602082015260400190565b600083825260406020830152612bf160408301846128db565b949350505050565b9182521515602082015260400190565b600086825285602083015260a06040830152612c2860a08301866128db565b6001600160a01b0394909416606083015250608001529392505050565b6000808335601e19843603018112612c5b578283fd5b83018035915067ffffffffffffffff821115612c75578283fd5b602001915036819003821315612c8a57600080fd5b9250929050565b60405181810167ffffffffffffffff81118282101715612cad57fe5b604052919050565b600067ffffffffffffffff821115612cc957fe5b5060209081020190565b600067ffffffffffffffff821115612ce757fe5b50601f01601f191660200190565b60005b83811015612d10578181015183820152602001612cf8565b83811115610f0e5750506000910152565b6001600160a01b038116811461071457600080fdfea2646970667358221220f1e29dc0ed522bb3fb538e664ecf4b4e92e6fd789dd062bc2fb1aae5c6d9513f64736f6c63430007060033

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

00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000057c7e0d43c05bce429ce030132ca40f6fa5839d70000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b47997506

-----Decoded View---------------
Arg [0] : _weth (address): 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1
Arg [1] : _xusdl (address): 0x57c7E0D43C05bCe429ce030132Ca40F6FA5839d7
Arg [2] : _routerSushiswap (address): 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [1] : 00000000000000000000000057c7e0d43c05bce429ce030132ca40f6fa5839d7
Arg [2] : 0000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b47997506


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.