ETH Price: $3,252.51 (-0.05%)
Gas: 1 Gwei

Contract

0xBC28FC02568EB3A74f84E21b8976cC8DE34a315F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Swap Tokens With...203050732024-07-14 13:34:4712 days ago1720964087IN
0xBC28FC02...DE34a315F
0 ETH0.000563672.195692
Swap Tokens With...202959792024-07-13 7:05:4713 days ago1720854347IN
0xBC28FC02...DE34a315F
0.065 ETH0.000577032.16646578
Swap Tokens With...202670642024-07-09 6:11:1117 days ago1720505471IN
0xBC28FC02...DE34a315F
0.064 ETH0.000667722.5
Swap Tokens202564352024-07-07 18:30:3519 days ago1720377035IN
0xBC28FC02...DE34a315F
0 ETH0.001121162.5
Swap Tokens With...202528922024-07-07 6:37:4719 days ago1720334267IN
0xBC28FC02...DE34a315F
0 ETH0.000301931.25
Swap Tokens With...202489612024-07-06 17:27:5920 days ago1720286879IN
0xBC28FC02...DE34a315F
0.0001 ETH0.000721072.55955394
Swap Tokens With...202054282024-06-30 15:34:3526 days ago1719761675IN
0xBC28FC02...DE34a315F
0.001 ETH0.001317335.21246041
Swap Tokens With...201993512024-06-29 19:12:3527 days ago1719688355IN
0xBC28FC02...DE34a315F
0 ETH0.000416931.61947062
Swap Tokens With...201993382024-06-29 19:09:5927 days ago1719688199IN
0xBC28FC02...DE34a315F
0 ETH0.000504962.06305573
Swap Tokens With...201955762024-06-29 6:32:4727 days ago1719642767IN
0xBC28FC02...DE34a315F
0 ETH0.000588562.40254758
Swap Tokens With...201950722024-06-29 4:51:2327 days ago1719636683IN
0xBC28FC02...DE34a315F
0.001 ETH0.000089951.29
Swap Tokens With...201878972024-06-28 4:48:3528 days ago1719550115IN
0xBC28FC02...DE34a315F
0 ETH0.000611152.5
Swap Tokens With...201878892024-06-28 4:46:5928 days ago1719550019IN
0xBC28FC02...DE34a315F
0 ETH0.000648642.5
Swap Tokens With...201878792024-06-28 4:44:5928 days ago1719549899IN
0xBC28FC02...DE34a315F
0 ETH0.000612872.5
Swap Tokens With...201878732024-06-28 4:43:4728 days ago1719549827IN
0xBC28FC02...DE34a315F
0 ETH0.000586542.5
Swap Tokens With...201878662024-06-28 4:42:2328 days ago1719549743IN
0xBC28FC02...DE34a315F
0 ETH0.000603862.5
Swap Tokens With...201824512024-06-27 10:32:5929 days ago1719484379IN
0xBC28FC02...DE34a315F
0 ETH0.001048243.75
Swap Tokens With...201814292024-06-27 7:07:3529 days ago1719472055IN
0xBC28FC02...DE34a315F
0 ETH0.000921513.75
Swap Tokens With...201814202024-06-27 7:05:4729 days ago1719471947IN
0xBC28FC02...DE34a315F
0 ETH0.000918723.75
Swap Tokens With...201780132024-06-26 19:41:2330 days ago1719430883IN
0xBC28FC02...DE34a315F
0.02 ETH0.0029655611.25219828
Swap Tokens With...201754842024-06-26 11:12:1130 days ago1719400331IN
0xBC28FC02...DE34a315F
0.000001 ETH0.000659242.5
Swap Tokens With...201743322024-06-26 7:20:3530 days ago1719386435IN
0xBC28FC02...DE34a315F
0 ETH0.000604052.46534023
Swap Tokens With...201743242024-06-26 7:18:5930 days ago1719386339IN
0xBC28FC02...DE34a315F
0.02 ETH0.000616282.47227132
Swap Tokens With...201742762024-06-26 7:09:2330 days ago1719385763IN
0xBC28FC02...DE34a315F
0 ETH0.000744992.87114108
Swap Tokens With...201741852024-06-26 6:50:5930 days ago1719384659IN
0xBC28FC02...DE34a315F
0.045 ETH0.000994613.22992526
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
203050732024-07-14 13:34:4712 days ago1720964087
0xBC28FC02...DE34a315F
0.06504783 ETH
203050732024-07-14 13:34:4712 days ago1720964087
0xBC28FC02...DE34a315F
0.06504783 ETH
202959792024-07-13 7:05:4713 days ago1720854347
0xBC28FC02...DE34a315F
0.065 ETH
202670642024-07-09 6:11:1117 days ago1720505471
0xBC28FC02...DE34a315F
0.064 ETH
202528922024-07-07 6:37:4719 days ago1720334267
0xBC28FC02...DE34a315F
0.00400601 ETH
202528922024-07-07 6:37:4719 days ago1720334267
0xBC28FC02...DE34a315F
0.00400601 ETH
202489612024-07-06 17:27:5920 days ago1720286879
0xBC28FC02...DE34a315F
0.0001 ETH
202054282024-06-30 15:34:3526 days ago1719761675
0xBC28FC02...DE34a315F
0.001 ETH
201993512024-06-29 19:12:3527 days ago1719688355
0xBC28FC02...DE34a315F
0.00100374 ETH
201993512024-06-29 19:12:3527 days ago1719688355
0xBC28FC02...DE34a315F
0.00100374 ETH
201993382024-06-29 19:09:5927 days ago1719688199
0xBC28FC02...DE34a315F
0.00099811 ETH
201993382024-06-29 19:09:5927 days ago1719688199
0xBC28FC02...DE34a315F
0.00099811 ETH
201955762024-06-29 6:32:4727 days ago1719642767
0xBC28FC02...DE34a315F
0.00229008 ETH
201955762024-06-29 6:32:4727 days ago1719642767
0xBC28FC02...DE34a315F
0.00229008 ETH
201950722024-06-29 4:51:2327 days ago1719636683
0xBC28FC02...DE34a315F
0.001 ETH
201878972024-06-28 4:48:3528 days ago1719550115
0xBC28FC02...DE34a315F
0.00628194 ETH
201878972024-06-28 4:48:3528 days ago1719550115
0xBC28FC02...DE34a315F
0.00628194 ETH
201878892024-06-28 4:46:5928 days ago1719550019
0xBC28FC02...DE34a315F
0.00650745 ETH
201878892024-06-28 4:46:5928 days ago1719550019
0xBC28FC02...DE34a315F
0.00650745 ETH
201878792024-06-28 4:44:5928 days ago1719549899
0xBC28FC02...DE34a315F
0.00593298 ETH
201878792024-06-28 4:44:5928 days ago1719549899
0xBC28FC02...DE34a315F
0.00593298 ETH
201878732024-06-28 4:43:4728 days ago1719549827
0xBC28FC02...DE34a315F
0.00477783 ETH
201878732024-06-28 4:43:4728 days ago1719549827
0xBC28FC02...DE34a315F
0.00477783 ETH
201878662024-06-28 4:42:2328 days ago1719549743
0xBC28FC02...DE34a315F
0.00667475 ETH
201878662024-06-28 4:42:2328 days ago1719549743
0xBC28FC02...DE34a315F
0.00667475 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AutoLayerForwarder

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 20 : AutoLayerForwarder.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;


import {AggregatorV3Interface} from "../lib/foundry-chainlink-toolkit/src/interfaces/feeds/AggregatorV3Interface.sol";
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "../lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol";
import {AutoLayerPoints} from "./AutoLayerPoints.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol";

import "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import './utils/AutoLayerUtils.sol';
import "./interfaces/IParaSwap.sol";
import "./interfaces/IBalancer.sol";
import "./interfaces/IGamma.sol";
import "./interfaces/INFTPool.sol";
import "./interfaces/IHipervisor.sol";
import "./interfaces/IGammaUniProxy.sol";

contract AutoLayerForwarder is Ownable, IERC721Receiver {
    using SafeERC20 for IERC20;

    AutoLayerPoints autoLayerPoints;
    AggregatorV3Interface priceFeed;
    address router;
    IBalancer balancerVault;
    IGamma gammaProxy;
    address tokenProxy;
    mapping(address => bool) isTokenWhitelisted;
    mapping(address => uint8) public tokenBoost;

    constructor(address autoLayerPointsAddress_, address routerAddress_, address ETHUSDPriceFeedAdress_, address balancerVaultAddress_, address tokenProxyAddress_, address gammaProxyAddress_) Ownable(msg.sender) {
        autoLayerPoints = AutoLayerPoints(autoLayerPointsAddress_);
        priceFeed = AggregatorV3Interface(ETHUSDPriceFeedAdress_);
        router = routerAddress_;
        balancerVault = IBalancer(balancerVaultAddress_);
        tokenProxy = tokenProxyAddress_;
        gammaProxy = IGamma(gammaProxyAddress_);
    }

    function swapTokensWithETH(bytes calldata swapData_) external payable returns(uint256 swappedAmount) {
        bytes memory dataWithoutFunctionSelector_ = bytes(swapData_[4:]);
        (Utils.SellData memory sellData_) = abi.decode(dataWithoutFunctionSelector_, (Utils.SellData));

        address toToken_ = address(sellData_.path[sellData_.path.length - 1].to);
        require(sellData_.fromToken != toToken_, "Swapping to same token is not allowed");

        if (sellData_.fromToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) require(msg.value == sellData_.fromAmount, "Amount not matching");
        else {
            IERC20(sellData_.fromToken).safeTransferFrom(msg.sender, address(this), sellData_.fromAmount);
            IERC20(sellData_.fromToken).approve(tokenProxy, sellData_.fromAmount);
        }

        uint256 balanceBefore_;
        if (toToken_ != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            balanceBefore_ = IERC20(toToken_).balanceOf(address(this));
        } else balanceBefore_ = address(this).balance;

        (bool success, ) = router.call{value: msg.value}(swapData_);
        require(success, "Swap failed");

        uint256 balanceAfter_;
        if (toToken_ != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) balanceAfter_ = IERC20(toToken_).balanceOf(address(this));
        else balanceAfter_ = address(this).balance;
        swappedAmount = balanceAfter_ - balanceBefore_;

        if(isTokenWhitelisted[toToken_]) {
            uint8 tokenBoost_ = tokenBoost[toToken_];
            addUserPoints(swappedAmount, tokenBoost_);
        }

        if (toToken_ != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) IERC20(toToken_).safeTransfer(msg.sender, swappedAmount);
        else {
            (bool success_, ) = msg.sender.call{value: swappedAmount}("");
            require(success_, "ETH send failed");
        }
    }

    function swapTokens(bytes calldata swapData_) external returns(uint256 swappedAmount) {
        bytes memory dataWithoutFunctionSelector_ = bytes(swapData_[4:]);
        (Utils.SellData memory sellData_) = abi.decode(dataWithoutFunctionSelector_, (Utils.SellData));

        address toToken_ = address(sellData_.path[sellData_.path.length - 1].to);
        require(sellData_.fromToken != toToken_, "Swapping to same token is not allowed");

        IERC20(sellData_.fromToken).safeTransferFrom(msg.sender, address(this), sellData_.fromAmount);
        uint256 balanceBefore_ = IERC20(toToken_).balanceOf(address(this));

        IERC20(sellData_.fromToken).approve(tokenProxy, sellData_.fromAmount);
        (bool success, ) = router.call(swapData_);
        require(success, "Swap failed");
        uint256 balanceAfter_ = IERC20(toToken_).balanceOf(address(this));
        swappedAmount = balanceAfter_ - balanceBefore_;

        if(isTokenWhitelisted[toToken_]) {
            uint8 tokenBoost_ = tokenBoost[toToken_];
            addUserPoints(swappedAmount, tokenBoost_);
        }
        IERC20(toToken_).safeTransfer(msg.sender, swappedAmount);
    }

    function addLiquidityToBalancer(bytes calldata swapData_, address[] memory tokens_, address[] memory tokensWithBpt_, bytes32 poolId_) external payable returns (uint256 bptAmount_){
        (uint256 fromAmount, uint256 swappedAmount, address fromToken_, address toToken_) = internalSwap(swapData_);

        if (fromToken_ == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) require(fromAmount == msg.value, "Incorrect ETH amount");

        address bptAddress = getBptAddress(poolId_);
        uint256[] memory amountsWithBPT = AutoLayerUtils.generateAmounts(swappedAmount, tokensWithBpt_, toToken_);
        uint256[] memory amountsWithoutBPT = AutoLayerUtils.generateAmounts(swappedAmount, tokens_, toToken_);
        bytes memory userDataEncoded_ = abi.encode(1, amountsWithoutBPT);
        JoinPoolRequest memory joinRequest_ = JoinPoolRequest(tokensWithBpt_, amountsWithBPT, userDataEncoded_, false);

        uint256 bptAmountBeforeDeposit_ = IERC20(bptAddress).balanceOf(address(this));
        IERC20(toToken_).approve(address(balancerVault), swappedAmount);
        balancerVault.joinPool(poolId_, address(this), address(this), joinRequest_);
        bptAmount_ = IERC20(bptAddress).balanceOf(address(this)) - bptAmountBeforeDeposit_;

        IERC20(bptAddress).safeTransfer(msg.sender, bptAmount_);
    }

    function removeLiquidityFromBalancer(bytes32 poolId_, address bptToken_, address tokenOut_, address[] memory tokens_, uint256[] memory minAmountsOut_, uint256 bptAmount_) external {
        require(tokens_.length == minAmountsOut_.length, "Not matching lengths");

        IERC20(bptToken_).safeTransferFrom(msg.sender, address(this), bptAmount_);
        IERC20(bptToken_).approve(address(balancerVault), bptAmount_);

        bytes memory userDataEncoded_ = abi.encode(0, bptAmount_, 0);
        IAsset[] memory assets_ = AutoLayerUtils.tokensToAssets(tokens_);
        ExitPoolRequest memory request_ = ExitPoolRequest(assets_, minAmountsOut_, userDataEncoded_, false);

        uint256 balanceBefore_ = IERC20(tokenOut_).balanceOf(address(this));
        balancerVault.exitPool(poolId_, address(this), payable(address(this)), request_);
        uint256 balanceAfter_ = IERC20(tokenOut_).balanceOf(address(this));

        IERC20(tokenOut_).safeTransfer(msg.sender, balanceAfter_ - balanceBefore_);
    }

    function addLiquidityToCamelot(bytes calldata swapData0_, bytes calldata swapData1_, address pos, uint256[4] memory minIn, address nftPool, uint256 lockDuration) public payable {
        (uint256 fromAmount0, uint256 swappedAmount0, address fromToken_0, address toToken_0) = internalSwap(swapData0_);
        (uint256 fromAmount1, uint256 swappedAmount1, address fromToken_1, address toToken_1) = internalSwap(swapData1_);

        if (fromToken_0 == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) require(fromAmount0 + fromAmount1 == msg.value, "Incorrect ETH amount");

        address gammaUniProxyAddress = gammaProxy.gammaUniProxy();
        (uint256 requiredSecondLow, uint256 requiredSecondHigh) = IGammaUniProxy(gammaUniProxyAddress).getDepositAmount(pos, toToken_0, swappedAmount0);
        (uint256 requiredFirstLow, uint256 requiredFirstHigh) = IGammaUniProxy(gammaUniProxyAddress).getDepositAmount(pos, toToken_1, swappedAmount1);

        uint256 finalAmount0;
        uint256 finalAmount1;
        uint256 resendAmount;
        address resendToken;
        if (swappedAmount0 >= requiredFirstLow && swappedAmount0 <= requiredFirstHigh) {
            finalAmount0 = swappedAmount0;
            finalAmount1 = swappedAmount1;
        } else if (swappedAmount0 > requiredFirstHigh) {
            finalAmount0 = requiredFirstHigh;
            finalAmount1 = swappedAmount1;
            resendAmount = swappedAmount0 - requiredFirstHigh;
            resendToken = toToken_0;
        } else if (swappedAmount1 > requiredSecondHigh) {
            finalAmount0 = swappedAmount0;
            finalAmount1 = requiredSecondHigh;
            resendAmount = swappedAmount1 - requiredSecondHigh;
            resendToken = toToken_1;
        } else {
            revert("Incorrect swapped amounts");
        }

        IERC20(toToken_0).approve(address(gammaProxy), swappedAmount0);
        IERC20(toToken_1).approve(address(gammaProxy), swappedAmount1);

        uint256 NFTId = INFTPool(nftPool).lastTokenId();
        gammaProxy.deposit(toToken_0, toToken_1, finalAmount0, finalAmount1, pos, minIn, nftPool, lockDuration);
        IERC721(nftPool).safeTransferFrom(address(this), msg.sender, NFTId + 1);
        if (resendAmount != 0) IERC20(resendToken).safeTransfer(msg.sender, resendAmount);
    }

    function withdrawFromCamelotPosition(address nftPool, uint256 tokenId, uint256 amountToWithdraw) public {
        INFTPool(nftPool).withdrawFromPosition(tokenId, amountToWithdraw);
    }

    function unbindCamelotPosition(address positionAddress, uint256 sharesAmount, uint256[4] memory minAmounts) external {
        IERC20(positionAddress).safeTransferFrom(msg.sender, address(this), sharesAmount);
        IHipervisor(positionAddress).withdraw(sharesAmount, msg.sender, address(this), minAmounts);
    }

    function internalSwap(bytes calldata swapData_) internal returns(uint256 fromAmount, uint256 swappedAmount, address fromToken, address toToken) {
        bytes memory dataWithoutFunctionSelector_ = bytes(swapData_[4:]);
        (Utils.SellData memory sellData_) = abi.decode(dataWithoutFunctionSelector_, (Utils.SellData));

        fromToken = sellData_.fromToken;
        toToken = address(sellData_.path[sellData_.path.length - 1].to);

        require(fromToken != toToken, "Swapping to same token is not allowed");
        if (fromToken != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            IERC20(fromToken).safeTransferFrom(msg.sender, address(this), sellData_.fromAmount);
            IERC20(fromToken).approve(tokenProxy, sellData_.fromAmount);
        }

        fromAmount = sellData_.fromAmount;

        uint256 balanceBefore_;
        if (toToken != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            balanceBefore_ = IERC20(toToken).balanceOf(address(this));
        } else balanceBefore_ = address(this).balance;

        bool success;
        if (fromToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            (success, ) = router.call{value: fromAmount}(swapData_);
        } else (success, ) = router.call(swapData_);

        require(success, "Swap failed");

        uint256 balanceAfter_;
        if (toToken != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) balanceAfter_ = IERC20(toToken).balanceOf(address(this));
        else balanceAfter_ = address(this).balance;
        swappedAmount = balanceAfter_ - balanceBefore_;

        if(isTokenWhitelisted[toToken]) {
            uint8 tokenBoost_ = tokenBoost[toToken];
            addUserPoints(swappedAmount, tokenBoost_);
        }
    }

    function getBptAddress(bytes32 poolId_) public view returns(address bptAddress) {
        (bptAddress, ) = balancerVault.getPool(poolId_);
    }


    function addUserPoints(uint256 ETHAmount_, uint8 tokenBoost_) internal {
        uint256 ETHCurrentPrice = retrieveETHPrice() / (10 ** priceFeed.decimals());
        uint256 points = ETHAmount_ * ETHCurrentPrice;
        autoLayerPoints.addPoints(msg.sender, points * tokenBoost_);
    }

    function retrieveETHPrice() internal view returns(uint256 answer_) {
       (, int answer,,,) = priceFeed.latestRoundData();

       if (answer < 0) return 0;
       else return uint256(answer);
    }

    function whitelistTokens(address[] memory tokenAddresses_) external onlyOwner() {
        for (uint8 i; i < tokenAddresses_.length; i++) {
            isTokenWhitelisted[tokenAddresses_[i]] = true;
            tokenBoost[tokenAddresses_[i]] = 1;
        }
    }

    function blackListTokens(address[] memory tokenAddresses_) external onlyOwner() {
        for (uint8 i; i < tokenAddresses_.length; i++) {
            isTokenWhitelisted[tokenAddresses_[i]] = false;
        }
    }

    function changeTokenBoost(address tokenAddress_, uint8 newBoost) external onlyOwner() {
        require(isTokenWhitelisted[tokenAddress_], "Token is not whitelisted");
        tokenBoost[tokenAddress_] = newBoost;
    }

    receive() external virtual payable {

    }

    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external pure override returns (bytes4) {
        return this.onERC721Received.selector;
    }

}

File 2 of 20 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);
  function description() external view returns (string memory);
  function version() external view returns (uint256);
  function getRoundData(uint80 _roundId) external view returns (
    uint80 roundId,
    int256 answer,
    uint256 startedAt,
    uint256 updatedAt,
    uint80 answeredInRound
  );
  function latestRoundData() external view returns (
    uint80 roundId,
    int256 answer,
    uint256 startedAt,
    uint256 updatedAt,
    uint80 answeredInRound
  );
}

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 4 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

File 5 of 20 : AutoLayerPoints.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";

contract AutoLayerPoints is Ownable {

    mapping(address => uint256) public userPoints;
    mapping(address => bool) public isAllowed;

    event AutoLayerPointsAdded(address user, uint256 pointsAdded);
    event AutoLayerPointsRemoved(address user, uint256 pointsAdded);

    modifier onlyAllowed() {
        require(isAllowed[msg.sender] || msg.sender == owner(), "Not allowed forwarder");
        _;
    }

    constructor() Ownable(msg.sender) {}

    function setAllowed(address allowedAddress_) public onlyOwner() {
        isAllowed[allowedAddress_] = true;
    }

    function removeAllowed(address notAllowedAddress_) public onlyOwner() {
        isAllowed[notAllowedAddress_] = false;
    }

    function addPoints(address userAddress_, uint256 pointsAmount_) public onlyAllowed() {
        userPoints[userAddress_] += pointsAmount_;
        emit AutoLayerPointsAdded(userAddress_, pointsAmount_);
    }

    function removePoints(address userAddress_, uint256 pointsAmount_) public onlyAllowed() {
        userPoints[userAddress_] -= pointsAmount_;
        emit AutoLayerPointsRemoved(userAddress_, pointsAmount_);
    }
}

File 6 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be
     * reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 7 of 20 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 20 : AutoLayerUtils.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "../interfaces/IBalancer.sol";

library AutoLayerUtils {
    function generateAmounts(uint256 swappedAmount, address[] memory tokens_, address depositedToken) internal pure returns (uint256[] memory amounts) {
        amounts = new uint256[](tokens_.length);
        for (uint i = 0; i < tokens_.length; i++) {
            if (tokens_[i] == depositedToken) amounts[i] = swappedAmount;
            else amounts[i] = 0;
        }
    }

    function tokensToAssets(address[] memory tokens_) internal pure returns(IAsset[] memory assets) {
        assets = new IAsset[](tokens_.length);
        for (uint8 i = 0; i < tokens_.length; i++) {
            assets[i] = IAsset(tokens_[i]);
        }
    }
}

File 10 of 20 : IParaSwap.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.6;

library Utils {

struct SimpleData {
    address fromToken;
    address toToken;
    uint256 fromAmount;
    uint256 toAmount;
    uint256 expectedAmount;
    address[] callees;
    bytes exchangeData;
    uint256[] startIndexes;
    uint256[] values;
    address payable beneficiary;
    address payable partner;
    uint256 feePercent;
    bytes permit;
    uint256 deadline;
    bytes16 uuid;
}

struct SellData {
    address fromToken;
    uint256 fromAmount;
    uint256 toAmount;
    uint256 expectedAmount;
    address payable beneficiary;
    Utils.Path[] path;
    address payable partner;
    uint256 feePercent;
    bytes permit;
    uint256 deadline;
    bytes16 uuid;
}

struct Path {
    address to;
    uint256 totalNetworkFee; //NOT USED - Network fee is associated with 0xv3 trades
    Adapter[] adapters;
}

struct Adapter {
    address payable adapter;
    uint256 percent;
    uint256 networkFee; //NOT USED
    Route[] route;
}

struct Route {
    uint256 index; //Adapter at which index needs to be used
    address targetExchange;
    uint256 percent;
    bytes payload;
    uint256 networkFee; //NOT USED - Network fee is associated with 0xv3 trades
}
}

File 11 of 20 : IBalancer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

import "./IAsset.sol";

enum SwapKind {
    GIVEN_IN,
    GIVEN_OUT
}

struct BatchSwapStep {
    bytes32 poolId;
    uint256 assetInIndex;
    uint256 assetOutIndex;
    uint256 amount;
    bytes userData;
}

struct BatchSwap {
    SwapKind kind;
    BatchSwapStep[] swaps;
    IAsset[] assets;
    FundManagement funds;
    int256[] limits;
    uint256 deadline;
}

struct Swap {
    SingleSwap singleSwap;
    FundManagement funds;
    uint256 limit;
    uint256 deadline;
}

struct FundManagement {
    address sender;
    bool fromInternalBalance;
    address recipient;
    bool toInternalBalance;
}

struct SingleSwap {
    bytes32 poolId;
    uint8 kind;
    address assetIn;
    address assetOut;
    uint256 amount;
    bytes userData;
}

struct JoinPoolRequest {
    address[] assets;
    uint256[] maxAmountsIn;
    bytes userData;
    bool fromInternalBalance;
}

struct ExitPoolRequest {
    IAsset[] assets;
    uint256[] minAmountsOut;
    bytes userData;
    bool toInternalBalance;
}

enum PoolSpecialization {
    GENERAL,
    MINIMAL_SWAP_INFO,
    TWO_TOKEN
}

interface IBalancer {
    function joinPool(
        bytes32 poolId,
        address sender,
        address recipient,
        JoinPoolRequest memory request
    ) external;

    function exitPool(
        bytes32 poolId,
        address sender,
        address payable recipient,
        ExitPoolRequest memory request
    ) external;

    function getPool(
        bytes32 poolId
    ) external view returns (address, PoolSpecialization);
}

File 12 of 20 : IGamma.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IGamma {
    function depositETH(address token0, address token1, uint256 deposit0, uint256 deposit1, address pos, uint256[4] memory minIn, address nftPool, uint256 lockDuration) external payable;
    function deposit(address token0, address token1, uint256 deposit0, uint256 deposit1, address pos, uint256[4] memory minIn, address nftPool, uint256 lockDuration) external;
    function gammaUniProxy() external returns(address);
}

File 13 of 20 : INFTPool.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface INFTPool {

function lastTokenId() external view returns (uint256);
function withdrawFromPosition(uint256 tokenId, uint256 amountToWithdraw) external;
function getPoolInfo() external returns(address, address, address, uint256, uint256, uint256, uint256, uint256);
function getStakingPosition(uint256 tokenId) external returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256);
}

File 14 of 20 : IHipervisor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IHipervisor {
    function withdraw(uint256 shares, address to, address from, uint256[4] memory minAmounts) external;
}

File 15 of 20 : IGammaUniProxy.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IGammaUniProxy {
    function getDepositAmount(address pos, address token, uint256 _deposit) external returns(uint256 amountStart, uint256 amountEnd);
}

File 16 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

File 17 of 20 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

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

pragma solidity ^0.8.20;

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

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

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

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

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

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

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 20 of 20 : IAsset.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev This is an empty interface used to represent either ERC20-conforming token contracts or ETH (using the zero
 * address sentinel value). We're just relying on the fact that `interface` can be used to declare new address-like
 * types.
 *
 * This concept is unrelated to a Pool's Asset Managers.
 */
interface IAsset {
    // solhint-disable-previous-line no-empty-blocks
}

Settings
{
  "remappings": [
    "@chainlink/contracts/=lib/foundry-chainlink-toolkit/",
    "@openzeppelin/=lib/foundry-chainlink-toolkit/lib/openzeppelin-contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "chainlink-brownie-contracts/=lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/v0.6/vendor/@arbitrum/nitro-contracts/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "foundry-chainlink-toolkit/=lib/foundry-chainlink-toolkit/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"autoLayerPointsAddress_","type":"address"},{"internalType":"address","name":"routerAddress_","type":"address"},{"internalType":"address","name":"ETHUSDPriceFeedAdress_","type":"address"},{"internalType":"address","name":"balancerVaultAddress_","type":"address"},{"internalType":"address","name":"tokenProxyAddress_","type":"address"},{"internalType":"address","name":"gammaProxyAddress_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"bytes","name":"swapData_","type":"bytes"},{"internalType":"address[]","name":"tokens_","type":"address[]"},{"internalType":"address[]","name":"tokensWithBpt_","type":"address[]"},{"internalType":"bytes32","name":"poolId_","type":"bytes32"}],"name":"addLiquidityToBalancer","outputs":[{"internalType":"uint256","name":"bptAmount_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"swapData0_","type":"bytes"},{"internalType":"bytes","name":"swapData1_","type":"bytes"},{"internalType":"address","name":"pos","type":"address"},{"internalType":"uint256[4]","name":"minIn","type":"uint256[4]"},{"internalType":"address","name":"nftPool","type":"address"},{"internalType":"uint256","name":"lockDuration","type":"uint256"}],"name":"addLiquidityToCamelot","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokenAddresses_","type":"address[]"}],"name":"blackListTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"uint8","name":"newBoost","type":"uint8"}],"name":"changeTokenBoost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId_","type":"bytes32"}],"name":"getBptAddress","outputs":[{"internalType":"address","name":"bptAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId_","type":"bytes32"},{"internalType":"address","name":"bptToken_","type":"address"},{"internalType":"address","name":"tokenOut_","type":"address"},{"internalType":"address[]","name":"tokens_","type":"address[]"},{"internalType":"uint256[]","name":"minAmountsOut_","type":"uint256[]"},{"internalType":"uint256","name":"bptAmount_","type":"uint256"}],"name":"removeLiquidityFromBalancer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"swapData_","type":"bytes"}],"name":"swapTokens","outputs":[{"internalType":"uint256","name":"swappedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"swapData_","type":"bytes"}],"name":"swapTokensWithETH","outputs":[{"internalType":"uint256","name":"swappedAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenBoost","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"positionAddress","type":"address"},{"internalType":"uint256","name":"sharesAmount","type":"uint256"},{"internalType":"uint256[4]","name":"minAmounts","type":"uint256[4]"}],"name":"unbindCamelotPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokenAddresses_","type":"address[]"}],"name":"whitelistTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftPool","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amountToWithdraw","type":"uint256"}],"name":"withdrawFromCamelotPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080346200015157601f62002b2038819003918201601f19168301916001600160401b03831184841017620001565780849260c09460405283398101031262000151576200004d816200016c565b6200005b602083016200016c565b62000069604084016200016c565b9262000078606082016200016c565b916200009560a06200008d608085016200016c565b93016200016c565b91331562000138576000549560018060a01b03948580948180948160018060a01b03199b8d8d339116176000556040519d823391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3168b6001541617600155168960025416176002551687600354161760035516856004541617600455168360065416176006551690600554161760055561299e9081620001828239f35b604051631e4fbdf760e01b815260006004820152602490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001515756fe61016080604052600436101561001e575b50361561001c57600080fd5b005b600090813560e01c908163150b7a02146118fd57508063155460e6146115d65780633771c1f71461119e5780634cb1e9e3146110f85780635e24387f14610d725780635e8bd76714610ca95780635f5c3d7a14610bfd5780636059d00414610bc057806361fec0f7146105b457806367c6e43014610583578063715018a6146105295780637ed45a63146104a45780638da5cb5b1461047d578063c72533191461040b578063d8d66559146101695763f2fde38b036100105734610166576020366003190112610166576100f0611953565b6100f8612484565b6001600160a01b0390811690811561014d57600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b80fd5b5034610166576020906003198281360112610403576004356001600160401b0381116104075761019d903690600401611995565b92909183600411610403576101bc6101ca913690860160048601611ac9565b858082518301019101611b7c565b60a08101518051600019810194919085116103ef576001600160a01b039485916101f49190612051565b515116946102078686855116141561207b565b848351169461021f88850196875190309033906122cb565b604051956370a0823160e01b9485885230600489015289886024818c5afa9788156103e457908a929188996103b1575b5051600654915160405163095ea7b360e01b81529285166001600160a01b031660048401526024830152909190829084168189816044810103925af180156103a65792868094936102c896938295610379575b506003541692826040519384928337810182815203925af16102c26120ed565b5061211d565b6040519081523060048201528481602481875afa90811561036e57829161033a575b50610317926102f891612044565b9281818593526007865260ff60408220541661031f575b50339061244b565b604051908152f35b60ff6040610334926008895220541683612331565b3861030f565b90508481813d8311610367575b6103518183611a06565b8101031261036257516103176102ea565b600080fd5b503d610347565b6040513d84823e3d90fd5b610398908d803d1061039f575b6103908183611a06565b8101906120d5565b50386102a2565b503d610386565b6040513d88823e3d90fd5b83819394929a503d83116103dd575b6103ca8183611a06565b810103126103625751968991908361024f565b503d6103c0565b6040513d89823e3d90fd5b634e487b7160e01b84526011600452602484fd5b5080fd5b8280fd5b503461016657606036600319011261016657806001600160a01b0361042e611953565b16803b1561047a57818091604460405180948193633cb85acf60e21b83526024356004840152833560248401525af1801561036e5761046a5750f35b610473906119f3565b6101665780f35b50fd5b5034610166578060031936011261016657546040516001600160a01b039091168152602090f35b503461016657602080600319360112610403576004356001600160401b038111610407576104d6903690600401611a3e565b906104df612484565b825b82519060ff81169182101561052557610520916001600160a01b03906105079086612051565b511685526007835260408520805460ff191690556121b0565b6104e1565b8480f35b5034610166578060031936011261016657610542612484565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101665760203660031901126101665760206105a2600435612242565b6040516001600160a01b039091168152f35b50610120366003190112610166576001600160401b03600435818111610407576105e2903690600401611995565b9091602435908111610bbc576105fc903690600401611995565b61060793919361197f565b903660831215610362576040519361061e856119c2565b60e485368211610362576064905b828210610bac57505060e4359290506001600160a01b0383168303610362576106799661066f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee938a976124b0565b9a919490936124b0565b9691946001600160a01b03169091149050610b70575b505060055460405163fe18760f60e01b81529795969495906020908990600490829089906001600160a01b03165af1978815610b65578598610b28575b5060408051635ccfb71d60e01b81526001600160a01b03808a1660048301528b16602482015260448101859052989990898b818981606481015b03926001600160a01b03165af19889156103a6578699610b05575b50604051635ccfb71d60e01b81526001600160a01b038981166004830152868116602483015260448201859052909a168a606481895a94604095f180156103a657869a8791610ad0575b508699879b86101580610ac6575b15610a2c5750506107be8495602085965b60055460405163095ea7b360e01b81526001600160a01b039091166004820152602481019190915292839081906044820190565b03818b6001600160a01b0388165af1908115610a215761081792602092610a04575b5060055460405163095ea7b360e01b81526001600160a01b0391821660048201526024810197909752169491829081906044820190565b03818a885af180156103e4576109e5575b5060405163f84ddf0b60e01b8152976020896004816001600160a01b038c165afa9889156103e45787996109ae575b506005546001600160a01b0316803b156109aa576108bc6101649489979388946040519a8b998a9863b80c37e760e01b8a5260018060a01b031660048a015260248901526044880152606487015260018060a01b0316608486015260a4850190612204565b6001600160a01b038916610124840152610104356101448401525af1801561036e57610992575b50506001820180921161097e578491906001600160a01b0381163b1561040757604051632142170760e11b8152306004820152336024820152604481019290925282908290606490829084906001600160a01b03165af1801561036e5761096a575b505080610950578280f35b6109649133906001600160a01b031661244b565b38808280f35b610973906119f3565b610407578238610945565b634e487b7160e01b85526011600452602485fd5b61099b906119f3565b6109a65784386108e3565b8480fd5b8780fd5b965097506020863d6020116109dd575b816109cb60209383611a06565b81010312610362578a95519738610857565b3d91506109be565b6109fd9060203d60201161039f576103908183611a06565b5038610828565b610a1a90833d851161039f576103908183611a06565b50386107e0565b6040513d8a823e3d90fd5b919599508481959b5011600014610a58575082936107be610a4e84958c612044565b996020839c61078a565b92509350818111600014610a8157889388936107be610a778585612044565b996020819c61078a565b60405162461bcd60e51b815260206004820152601960248201527f496e636f7272656374207377617070656420616d6f756e7473000000000000006044820152606490fd5b5081861115610779565b9050610af5919a5060403d604011610afe575b610aed8183611a06565b81019061222c565b9990993861076b565b503d610ae3565b610b1f91995060403d604011610afe57610aed8183611a06565b90509738610721565b97506020883d602011610b5d575b81610b4360209383611a06565b810103126109a657610b5761070698611b00565b976106cc565b3d9150610b36565b6040513d87823e3d90fd5b90809596975001809411610b96578896610b8c889534146121c1565b969594933861068f565b634e487b7160e01b600052601160045260246000fd5b813581526020918201910161062c565b8380fd5b50346101665760203660031901126101665760209060ff906040906001600160a01b03610beb611953565b16815260088452205416604051908152f35b503461016657604036600319011261016657610c17611953565b6024359060ff821680920361040757610c2e612484565b6001600160a01b03168083526007602052604083205460ff1615610c645782526008602052604082209060ff1982541617905580f35b60405162461bcd60e51b815260206004820152601860248201527f546f6b656e206973206e6f742077686974656c697374656400000000000000006044820152606490fd5b50346101665760c036600319011261016657610cc3611953565b9060243536606312156103625760405190610cdd826119c2565b819360c43660c411610362576044955b818710610d6257509394508493506001600160a01b031691610d11823033866122cb565b823b15610d5d5760e4849283610d4e95604051968795869463542acc3960e11b865260048601523360248601523060448601526064850190612204565b5af1801561036e5761046a5750f35b505050fd5b8635815260209687019601610ced565b506080366003190112610166576001600160401b039060043582811161040357610da0903690600401611995565b90602435848111610bbc57610db9903690600401611a3e565b93604435908111610bbc5790610e51610df9610def73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95943690600401611a3e565b93606435936124b0565b9196919592916001600160a01b03909116146110e7575b50610e1a83612242565b94610e5f610e3486610e2d81868661275a565b9a8461275a565b604051948591600160208401526040808401526060830190612157565b03601f198101855284611a06565b60405191610e6c836119c2565b82526020808301988952604080840194855260608401899052516370a0823160e01b81523060048201529590866024816001600160a01b038b165afa958615610a215788966110b1575b506004805460405163095ea7b360e01b81526001600160a01b039091169181019190915260248101929092526020908290818a81604481015b03926001600160a01b03165af180156103e457611092575b506004546001600160a01b031691823b1561108e57966040519363172b958560e31b855260048501523060248501523060448501526080606485015261010484019082519160806084870152825180915260206101248701930190895b81811061106f5750505092848881819796956060610fa98e8498610f98879b519160831992838983030160a48a0152612157565b9151908683030160c487015261218b565b910151151560e483015203925af1801561036e5761105b575b50506040516370a0823160e01b81523060048201526020816024816001600160a01b0387165afa93841561104f5793611019575b5061100661031791602094612044565b91829033906001600160a01b031661244b565b92506020833d602011611047575b8161103460209383611a06565b8101031261036257915191611006610ff6565b3d9150611027565b604051903d90823e3d90fd5b611064906119f3565b610407578284610fc2565b82516001600160a01b0316855260209485019490920191600101610f64565b8680fd5b6110aa9060203d60201161039f576103908183611a06565b5038610f07565b9095506020813d6020116110df575b816110cd60209383611a06565b81010312610362575194610eef610eb6565b3d91506110c0565b6110f29034146121c1565b38610e10565b503461016657602080600319360112610403576004356001600160401b0381116104075761112a903690600401611a3e565b90611133612484565b825b82519060ff81169182101561052557611199916001600160a01b03908161115c8288612051565b5116875260078552604087209161118160019260ff1994848682541617905588612051565b511687526008855260408720918254161790556121b0565b611135565b50346101665760c0366003190112610166576111b8611969565b6111c061197f565b916001600160401b0390606435828111610403576111e2903690600401611a3e565b9060843592831161016657366023840112156101665782600401359460249361120a87611a27565b966112186040519889611a06565b80885285602089019160051b830101913683116109a6578601905b8282106115c65750505060a43594835187510361158b576112a59060209087906001600160a01b0316611268823033846122cb565b6004805460405163095ea7b360e01b81526001600160a01b0390911691810191909152602481019290925290928391908290879082906044820190565b03925af1801561158057611561575b50604051948260208701526040860152816060860152606085526112d7856119c2565b8251936112e385611a27565b946112f16040519687611a06565b808652611300601f1991611a27565b01366020870137825b845160ff82169081101561134557611340919061133a6001600160a01b03611331838a612051565b51169189612051565b526121b0565b611309565b848785858b8d60405194611358866119c2565b855260208501526040840152836060840152604051926370a0823160e01b8452306004850152602084838160018060a01b0387165afa938415610b6557859461152d575b506004546001600160a01b0316803b1561152957908590604051928391638bdb391360e01b83526004356004840152308684015230604484015260806064840152610104830181519060806084860152815180915260206101248601920190865b8181106115045750505083826060611442889461142d6020869801519160831992838883030160a4890152612157565b906040850151908683030160c487015261218b565b910151151560e483015203925af18015610b65576114f1575b506040516370a0823160e01b8152306004820152906020908290816001600160a01b0386165afa9081156114e65784916114b2575b506114af9261149e91612044565b9033906001600160a01b031661244b565b80f35b90506020813d6020116114de575b816114cd60209383611a06565b8101031261036257516114af611490565b3d91506114c0565b6040513d86823e3d90fd5b6114fd909491946119f3565b928461145b565b82516001600160a01b031684528c9750889650602093840193909201916001016113fd565b8580fd5b9093506020813d602011611559575b8161154960209383611a06565b810103126109a65751928561139c565b3d915061153c565b6115799060203d60201161039f576103908183611a06565b50386112b4565b6040513d85823e3d90fd5b60405162461bcd60e51b815260206004820152601481870152734e6f74206d61746368696e67206c656e6774687360601b6044820152606490fd5b8135815260209182019101611233565b50602090600319908282360112610166576004356001600160401b03811161040357611606903690600401611995565b909281600411610407576101bc611624913690840160048701611ac9565b9260a084015190815191600019830192831161097e576001600160a01b0392839161164f9190612051565b515116946116628684835116141561207b565b805173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee91889185168584820361187457505001513403611839575b85141592848460001461182c57506040516370a0823160e01b815230600482015287816024818a5afa9081156103a6579086929183916117f9575b509282916116f794955b60035416918160405192839283378101848152039134905af16102c26120ed565b81156117ef576040516370a0823160e01b8152306004820152908582602481885afa80156114e65784906117be575b6117309250612044565b9283918184526007865260ff6040852054166117a4575b15611758576103179250339061244b565b5081808092335af16117686120ed565b506103175760405162461bcd60e51b815260048101839052600f60248201526e115512081cd95b990819985a5b1959608a1b6044820152606490fd5b600886526117b960ff60408620541684612331565b611747565b50908581813d83116117e8575b6117d58183611a06565b81010312610bbc57906117309151611726565b503d6117cb565b6117309047612044565b80929350898092503d8311611825575b6118138183611a06565b810103126115295751859190826116cc565b503d611809565b6116f792819247956116d6565b60405162461bcd60e51b8152600481018890526013602482015272416d6f756e74206e6f74206d61746368696e6760681b6044820152606490fd5b8261188c856118cb96950193845190309033906122cb565b51600654925160405163095ea7b360e01b81529389166001600160a01b03166004850152602484015291938492919091169082908a9082906044820190565b03925af180156103a6576118e0575b50611691565b6118f690883d8a1161039f576103908183611a06565b50386118da565b90503461040357608036600319011261040357611918611953565b50611921611969565b50606435916001600160401b03831161016657506119456020923690600401611995565b5050630a85bd0160e11b8152f35b600435906001600160a01b038216820361036257565b602435906001600160a01b038216820361036257565b604435906001600160a01b038216820361036257565b9181601f84011215610362578235916001600160401b038311610362576020838186019501011161036257565b608081019081106001600160401b038211176119dd57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116119dd57604052565b90601f801991011681019081106001600160401b038211176119dd57604052565b6001600160401b0381116119dd5760051b60200190565b9080601f83011215610362576020908235611a5881611a27565b93611a666040519586611a06565b81855260208086019260051b82010192831161036257602001905b828210611a8f575050505090565b81356001600160a01b0381168103610362578152908301908301611a81565b6001600160401b0381116119dd57601f01601f191660200190565b929192611ad582611aae565b91611ae36040519384611a06565b829481845281830111610362578281602093846000960137010152565b51906001600160a01b038216820361036257565b60005b838110611b275750506000910152565b8181015183820152602001611b17565b81601f82011215610362578051611b4d81611aae565b92611b5b6040519485611a06565b8184526020828401011161036257611b799160208085019101611b14565b90565b9061014052602081610140510312610362578051906001600160401b0382116103625701610100526101608061010051610140510312610362576040516101205261012051016101205181106001600160401b038211176119dd57604052611be661010051611b00565b6101205152602061010051015160206101205101526040610100510151604061012051015260606101005101516060610120510152611c2a60806101005101611b00565b608061012051015260a06101005101516080526001600160401b03608051116103625761014051601f60805161010051010112156103625760805161010051015160c052611c8a611c7c60c051611a27565b60405160e05260e051611a06565b60e0515060c05160e05152602060e0510161014051602060c05160051b608051610100510101011161036257602060805161010051010160a0525b602060c05160051b6080516101005101010160a05110611d86575060e05160a0610120510152611cfa60c06101005101611b00565b60c061012051015260e061010051015160e0610120510152610100806101005101516001600160401b038111610362576101405161010051611d3c9201611b37565b90610120510152610120806101005101519061012051015261014080610100510151906fffffffffffffffffffffffffffffffff1982168203610362576101205101526101205190565b60a051516001600160401b038111610362576080516101005101016060601f1982610140510301126103625760405190606082018281106001600160401b0382111761202f57604052611ddb60208201611b00565b8252604081015160208301526060810151906001600160401b0382116103625761014051603f8383010112156103625760208282010151611e1b81611a27565b92611e296040519485611a06565b81845260208401906101405160408460051b83870101011161036257604081850101915b60408460051b83870101018310611e7e57505050505090602092916040820152815201602060a0510160a052611cc5565b82516001600160401b038111610362576080603f198285890101610140510301126103625760405190611eb0826119c2565b611ec0604082868a010101611b00565b82528684018101606081015160208401526080810151604084015260a00151906001600160401b0382116103625761014051605f8383888c0101010112156103625760408282878b0101010151611f1681611a27565b92611f246040519485611a06565b81845260208401926101405160608c84848c8860051b9301010101011161036257606082828a8e01010101935b60608c84848c8860051b9301010101018510611f825750505050509181602093606085940152815201920191611e4d565b84516001600160401b0381116103625783838b8f0101010160a0605f198261014051030112610362576040519160a083018381106001600160401b0382111761202f5760405260608201518352611fdb60808301611b00565b602084015260a0820151604084015260c0820151926001600160401b0384116103625760e060209493612018869560606101405191840101611b37565b606084015201516080820152815201940193611f51565b60246000634e487b7160e01b81526041600452fd5b91908203918211610b9657565b80518210156120655760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b1561208257565b60405162461bcd60e51b815260206004820152602560248201527f5377617070696e6720746f2073616d6520746f6b656e206973206e6f7420616c6044820152641b1bddd95960da1b6064820152608490fd5b90816020910312610362575180151581036103625790565b3d15612118573d906120fe82611aae565b9161210c6040519384611a06565b82523d6000602084013e565b606090565b1561212457565b60405162461bcd60e51b815260206004820152600b60248201526a14ddd85c0819985a5b195960aa1b6044820152606490fd5b90815180825260208080930193019160005b828110612177575050505090565b835185529381019392810192600101612169565b906020916121a481518092818552858086019101611b14565b601f01601f1916010190565b60ff1660ff8114610b965760010190565b156121c857565b60405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0811551208185b5bdd5b9d60621b6044820152606490fd5b6000915b6004831061221557505050565b600190825181526020809101920192019190612208565b9190826040910312610362576020825192015190565b60018060a01b03600454169060408091602482518095819363f6c0092760e01b835260048301525afa9081156122c157600091612280575b50905090565b82813d83116122ba575b6122948183611a06565b8101031261016657600360206122a984611b00565b93015110156101665750803861227a565b503d61228a565b513d6000823e3d90fd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606482019290925261231c9161231782608481015b03601f198101845283611a06565b6127ea565b565b81810292918115918404141715610b9657565b612339612873565b60025460405163313ce56760e01b81526001600160a01b0392916020908290600490829087165afa9081156123ec5760009161240e575b5060ff16604d8111610b9657600a0a9081156123f8576123a59360ff9261239892049061231e565b916001541693169061231e565b90803b156103625760405163507cd30f60e01b815233600482015260248101929092526000908290604490829084905af180156123ec576123e35750565b61231c906119f3565b6040513d6000823e3d90fd5b634e487b7160e01b600052601260045260246000fd5b6020813d602011612443575b8161242760209383611a06565b8101031261040357519060ff82168203610166575060ff612370565b3d915061241a565b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604482019290925261231c916123178260648101612309565b6000546001600160a01b0316330361249857565b60405163118cdaa760e01b8152336004820152602490fd5b91906004818111610362576124cc366003198401868401611ac9565b926124e284519460208080978301019101611b7c565b805160a082015180516001600160a01b03928316969295939291600019820191821161274557869161251391612051565b515116946125238688141561207b565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee98888a89149485156126bc575b015199871415928a846000146126b157506040516370a0823160e01b815230878201528a816024818c5afa80156123ec578c9160009161267e575b50936125b794965b600090156126585750916000939184936003541692826040519384928337810185815203925af16102c26120ed565b1561264d57604051916370a0823160e01b835230908301528582602481875afa80156123ec5760009061261e575b6125ef9250612044565b93826000526007815260ff604060002054166126085750565b6008905261231c60ff6040600020541685612331565b508582813d8311612646575b6126348183611a06565b81010312610362576125ef91516125e5565b503d61262a565b6125ef915047612044565b809492508093916003541692826040519384928337810182815203925af16102c26120ed565b8092508c8092503d83116126aa575b6126978183611a06565b8101031261036257518b906125b7612580565b503d61268d565b6125b7934796612588565b816127109282016126d281518d309033906122cb565b60065490516040805163095ea7b360e01b81529288166001600160a01b03168b84019081526020810192909252919485928e92849260009284920190565b03925af19182156123ec578b92612728575b50612545565b61273e90833d851161039f576103908183611a06565b5038612722565b601185634e487b7160e01b6000525260246000fd5b8151939261276785611a27565b946127756040519687611a06565b808652612784601f1991611a27565b0136602087013760009285845b82518110156127e1576001906001600160a01b03806127b08387612051565b5116908616146000146127d057856127c8828b612051565b525b01612791565b866127db828b612051565b526127ca565b50955050505050565b6000806128139260018060a01b03169360208151910182865af161280c6120ed565b9083612905565b8051908115159182612841575b50506128295750565b60249060405190635274afe760e01b82526004820152fd5b61285492506020809183010191016120d5565b153880612820565b519069ffffffffffffffffffff8216820361036257565b600254604051633fabe5a360e21b81529060a090829060049082906001600160a01b03165afa9081156123ec576000916128b8575b506000811215611b795750600090565b905060a0813d60a0116128fd575b816128d360a09383611a06565b81010312610362576128e48161285c565b506128f660806020830151920161285c565b50386128a8565b3d91506128c6565b9061292c575080511561291a57805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061295f575b61293d575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561293556fea26469706673582212201805febe35b3b1aecd752a8d5fd7bf9865ae2c161c7a27ccb6c1ab869a1a5e3364736f6c634300081800330000000000000000000000009566d8998a47d53c948803744864e63456177353000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee570000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8000000000000000000000000216b4b4ba9f3e719726886d34a177484278bfcae0000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x61016080604052600436101561001e575b50361561001c57600080fd5b005b600090813560e01c908163150b7a02146118fd57508063155460e6146115d65780633771c1f71461119e5780634cb1e9e3146110f85780635e24387f14610d725780635e8bd76714610ca95780635f5c3d7a14610bfd5780636059d00414610bc057806361fec0f7146105b457806367c6e43014610583578063715018a6146105295780637ed45a63146104a45780638da5cb5b1461047d578063c72533191461040b578063d8d66559146101695763f2fde38b036100105734610166576020366003190112610166576100f0611953565b6100f8612484565b6001600160a01b0390811690811561014d57600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b80fd5b5034610166576020906003198281360112610403576004356001600160401b0381116104075761019d903690600401611995565b92909183600411610403576101bc6101ca913690860160048601611ac9565b858082518301019101611b7c565b60a08101518051600019810194919085116103ef576001600160a01b039485916101f49190612051565b515116946102078686855116141561207b565b848351169461021f88850196875190309033906122cb565b604051956370a0823160e01b9485885230600489015289886024818c5afa9788156103e457908a929188996103b1575b5051600654915160405163095ea7b360e01b81529285166001600160a01b031660048401526024830152909190829084168189816044810103925af180156103a65792868094936102c896938295610379575b506003541692826040519384928337810182815203925af16102c26120ed565b5061211d565b6040519081523060048201528481602481875afa90811561036e57829161033a575b50610317926102f891612044565b9281818593526007865260ff60408220541661031f575b50339061244b565b604051908152f35b60ff6040610334926008895220541683612331565b3861030f565b90508481813d8311610367575b6103518183611a06565b8101031261036257516103176102ea565b600080fd5b503d610347565b6040513d84823e3d90fd5b610398908d803d1061039f575b6103908183611a06565b8101906120d5565b50386102a2565b503d610386565b6040513d88823e3d90fd5b83819394929a503d83116103dd575b6103ca8183611a06565b810103126103625751968991908361024f565b503d6103c0565b6040513d89823e3d90fd5b634e487b7160e01b84526011600452602484fd5b5080fd5b8280fd5b503461016657606036600319011261016657806001600160a01b0361042e611953565b16803b1561047a57818091604460405180948193633cb85acf60e21b83526024356004840152833560248401525af1801561036e5761046a5750f35b610473906119f3565b6101665780f35b50fd5b5034610166578060031936011261016657546040516001600160a01b039091168152602090f35b503461016657602080600319360112610403576004356001600160401b038111610407576104d6903690600401611a3e565b906104df612484565b825b82519060ff81169182101561052557610520916001600160a01b03906105079086612051565b511685526007835260408520805460ff191690556121b0565b6104e1565b8480f35b5034610166578060031936011261016657610542612484565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101665760203660031901126101665760206105a2600435612242565b6040516001600160a01b039091168152f35b50610120366003190112610166576001600160401b03600435818111610407576105e2903690600401611995565b9091602435908111610bbc576105fc903690600401611995565b61060793919361197f565b903660831215610362576040519361061e856119c2565b60e485368211610362576064905b828210610bac57505060e4359290506001600160a01b0383168303610362576106799661066f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee938a976124b0565b9a919490936124b0565b9691946001600160a01b03169091149050610b70575b505060055460405163fe18760f60e01b81529795969495906020908990600490829089906001600160a01b03165af1978815610b65578598610b28575b5060408051635ccfb71d60e01b81526001600160a01b03808a1660048301528b16602482015260448101859052989990898b818981606481015b03926001600160a01b03165af19889156103a6578699610b05575b50604051635ccfb71d60e01b81526001600160a01b038981166004830152868116602483015260448201859052909a168a606481895a94604095f180156103a657869a8791610ad0575b508699879b86101580610ac6575b15610a2c5750506107be8495602085965b60055460405163095ea7b360e01b81526001600160a01b039091166004820152602481019190915292839081906044820190565b03818b6001600160a01b0388165af1908115610a215761081792602092610a04575b5060055460405163095ea7b360e01b81526001600160a01b0391821660048201526024810197909752169491829081906044820190565b03818a885af180156103e4576109e5575b5060405163f84ddf0b60e01b8152976020896004816001600160a01b038c165afa9889156103e45787996109ae575b506005546001600160a01b0316803b156109aa576108bc6101649489979388946040519a8b998a9863b80c37e760e01b8a5260018060a01b031660048a015260248901526044880152606487015260018060a01b0316608486015260a4850190612204565b6001600160a01b038916610124840152610104356101448401525af1801561036e57610992575b50506001820180921161097e578491906001600160a01b0381163b1561040757604051632142170760e11b8152306004820152336024820152604481019290925282908290606490829084906001600160a01b03165af1801561036e5761096a575b505080610950578280f35b6109649133906001600160a01b031661244b565b38808280f35b610973906119f3565b610407578238610945565b634e487b7160e01b85526011600452602485fd5b61099b906119f3565b6109a65784386108e3565b8480fd5b8780fd5b965097506020863d6020116109dd575b816109cb60209383611a06565b81010312610362578a95519738610857565b3d91506109be565b6109fd9060203d60201161039f576103908183611a06565b5038610828565b610a1a90833d851161039f576103908183611a06565b50386107e0565b6040513d8a823e3d90fd5b919599508481959b5011600014610a58575082936107be610a4e84958c612044565b996020839c61078a565b92509350818111600014610a8157889388936107be610a778585612044565b996020819c61078a565b60405162461bcd60e51b815260206004820152601960248201527f496e636f7272656374207377617070656420616d6f756e7473000000000000006044820152606490fd5b5081861115610779565b9050610af5919a5060403d604011610afe575b610aed8183611a06565b81019061222c565b9990993861076b565b503d610ae3565b610b1f91995060403d604011610afe57610aed8183611a06565b90509738610721565b97506020883d602011610b5d575b81610b4360209383611a06565b810103126109a657610b5761070698611b00565b976106cc565b3d9150610b36565b6040513d87823e3d90fd5b90809596975001809411610b96578896610b8c889534146121c1565b969594933861068f565b634e487b7160e01b600052601160045260246000fd5b813581526020918201910161062c565b8380fd5b50346101665760203660031901126101665760209060ff906040906001600160a01b03610beb611953565b16815260088452205416604051908152f35b503461016657604036600319011261016657610c17611953565b6024359060ff821680920361040757610c2e612484565b6001600160a01b03168083526007602052604083205460ff1615610c645782526008602052604082209060ff1982541617905580f35b60405162461bcd60e51b815260206004820152601860248201527f546f6b656e206973206e6f742077686974656c697374656400000000000000006044820152606490fd5b50346101665760c036600319011261016657610cc3611953565b9060243536606312156103625760405190610cdd826119c2565b819360c43660c411610362576044955b818710610d6257509394508493506001600160a01b031691610d11823033866122cb565b823b15610d5d5760e4849283610d4e95604051968795869463542acc3960e11b865260048601523360248601523060448601526064850190612204565b5af1801561036e5761046a5750f35b505050fd5b8635815260209687019601610ced565b506080366003190112610166576001600160401b039060043582811161040357610da0903690600401611995565b90602435848111610bbc57610db9903690600401611a3e565b93604435908111610bbc5790610e51610df9610def73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95943690600401611a3e565b93606435936124b0565b9196919592916001600160a01b03909116146110e7575b50610e1a83612242565b94610e5f610e3486610e2d81868661275a565b9a8461275a565b604051948591600160208401526040808401526060830190612157565b03601f198101855284611a06565b60405191610e6c836119c2565b82526020808301988952604080840194855260608401899052516370a0823160e01b81523060048201529590866024816001600160a01b038b165afa958615610a215788966110b1575b506004805460405163095ea7b360e01b81526001600160a01b039091169181019190915260248101929092526020908290818a81604481015b03926001600160a01b03165af180156103e457611092575b506004546001600160a01b031691823b1561108e57966040519363172b958560e31b855260048501523060248501523060448501526080606485015261010484019082519160806084870152825180915260206101248701930190895b81811061106f5750505092848881819796956060610fa98e8498610f98879b519160831992838983030160a48a0152612157565b9151908683030160c487015261218b565b910151151560e483015203925af1801561036e5761105b575b50506040516370a0823160e01b81523060048201526020816024816001600160a01b0387165afa93841561104f5793611019575b5061100661031791602094612044565b91829033906001600160a01b031661244b565b92506020833d602011611047575b8161103460209383611a06565b8101031261036257915191611006610ff6565b3d9150611027565b604051903d90823e3d90fd5b611064906119f3565b610407578284610fc2565b82516001600160a01b0316855260209485019490920191600101610f64565b8680fd5b6110aa9060203d60201161039f576103908183611a06565b5038610f07565b9095506020813d6020116110df575b816110cd60209383611a06565b81010312610362575194610eef610eb6565b3d91506110c0565b6110f29034146121c1565b38610e10565b503461016657602080600319360112610403576004356001600160401b0381116104075761112a903690600401611a3e565b90611133612484565b825b82519060ff81169182101561052557611199916001600160a01b03908161115c8288612051565b5116875260078552604087209161118160019260ff1994848682541617905588612051565b511687526008855260408720918254161790556121b0565b611135565b50346101665760c0366003190112610166576111b8611969565b6111c061197f565b916001600160401b0390606435828111610403576111e2903690600401611a3e565b9060843592831161016657366023840112156101665782600401359460249361120a87611a27565b966112186040519889611a06565b80885285602089019160051b830101913683116109a6578601905b8282106115c65750505060a43594835187510361158b576112a59060209087906001600160a01b0316611268823033846122cb565b6004805460405163095ea7b360e01b81526001600160a01b0390911691810191909152602481019290925290928391908290879082906044820190565b03925af1801561158057611561575b50604051948260208701526040860152816060860152606085526112d7856119c2565b8251936112e385611a27565b946112f16040519687611a06565b808652611300601f1991611a27565b01366020870137825b845160ff82169081101561134557611340919061133a6001600160a01b03611331838a612051565b51169189612051565b526121b0565b611309565b848785858b8d60405194611358866119c2565b855260208501526040840152836060840152604051926370a0823160e01b8452306004850152602084838160018060a01b0387165afa938415610b6557859461152d575b506004546001600160a01b0316803b1561152957908590604051928391638bdb391360e01b83526004356004840152308684015230604484015260806064840152610104830181519060806084860152815180915260206101248601920190865b8181106115045750505083826060611442889461142d6020869801519160831992838883030160a4890152612157565b906040850151908683030160c487015261218b565b910151151560e483015203925af18015610b65576114f1575b506040516370a0823160e01b8152306004820152906020908290816001600160a01b0386165afa9081156114e65784916114b2575b506114af9261149e91612044565b9033906001600160a01b031661244b565b80f35b90506020813d6020116114de575b816114cd60209383611a06565b8101031261036257516114af611490565b3d91506114c0565b6040513d86823e3d90fd5b6114fd909491946119f3565b928461145b565b82516001600160a01b031684528c9750889650602093840193909201916001016113fd565b8580fd5b9093506020813d602011611559575b8161154960209383611a06565b810103126109a65751928561139c565b3d915061153c565b6115799060203d60201161039f576103908183611a06565b50386112b4565b6040513d85823e3d90fd5b60405162461bcd60e51b815260206004820152601481870152734e6f74206d61746368696e67206c656e6774687360601b6044820152606490fd5b8135815260209182019101611233565b50602090600319908282360112610166576004356001600160401b03811161040357611606903690600401611995565b909281600411610407576101bc611624913690840160048701611ac9565b9260a084015190815191600019830192831161097e576001600160a01b0392839161164f9190612051565b515116946116628684835116141561207b565b805173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee91889185168584820361187457505001513403611839575b85141592848460001461182c57506040516370a0823160e01b815230600482015287816024818a5afa9081156103a6579086929183916117f9575b509282916116f794955b60035416918160405192839283378101848152039134905af16102c26120ed565b81156117ef576040516370a0823160e01b8152306004820152908582602481885afa80156114e65784906117be575b6117309250612044565b9283918184526007865260ff6040852054166117a4575b15611758576103179250339061244b565b5081808092335af16117686120ed565b506103175760405162461bcd60e51b815260048101839052600f60248201526e115512081cd95b990819985a5b1959608a1b6044820152606490fd5b600886526117b960ff60408620541684612331565b611747565b50908581813d83116117e8575b6117d58183611a06565b81010312610bbc57906117309151611726565b503d6117cb565b6117309047612044565b80929350898092503d8311611825575b6118138183611a06565b810103126115295751859190826116cc565b503d611809565b6116f792819247956116d6565b60405162461bcd60e51b8152600481018890526013602482015272416d6f756e74206e6f74206d61746368696e6760681b6044820152606490fd5b8261188c856118cb96950193845190309033906122cb565b51600654925160405163095ea7b360e01b81529389166001600160a01b03166004850152602484015291938492919091169082908a9082906044820190565b03925af180156103a6576118e0575b50611691565b6118f690883d8a1161039f576103908183611a06565b50386118da565b90503461040357608036600319011261040357611918611953565b50611921611969565b50606435916001600160401b03831161016657506119456020923690600401611995565b5050630a85bd0160e11b8152f35b600435906001600160a01b038216820361036257565b602435906001600160a01b038216820361036257565b604435906001600160a01b038216820361036257565b9181601f84011215610362578235916001600160401b038311610362576020838186019501011161036257565b608081019081106001600160401b038211176119dd57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116119dd57604052565b90601f801991011681019081106001600160401b038211176119dd57604052565b6001600160401b0381116119dd5760051b60200190565b9080601f83011215610362576020908235611a5881611a27565b93611a666040519586611a06565b81855260208086019260051b82010192831161036257602001905b828210611a8f575050505090565b81356001600160a01b0381168103610362578152908301908301611a81565b6001600160401b0381116119dd57601f01601f191660200190565b929192611ad582611aae565b91611ae36040519384611a06565b829481845281830111610362578281602093846000960137010152565b51906001600160a01b038216820361036257565b60005b838110611b275750506000910152565b8181015183820152602001611b17565b81601f82011215610362578051611b4d81611aae565b92611b5b6040519485611a06565b8184526020828401011161036257611b799160208085019101611b14565b90565b9061014052602081610140510312610362578051906001600160401b0382116103625701610100526101608061010051610140510312610362576040516101205261012051016101205181106001600160401b038211176119dd57604052611be661010051611b00565b6101205152602061010051015160206101205101526040610100510151604061012051015260606101005101516060610120510152611c2a60806101005101611b00565b608061012051015260a06101005101516080526001600160401b03608051116103625761014051601f60805161010051010112156103625760805161010051015160c052611c8a611c7c60c051611a27565b60405160e05260e051611a06565b60e0515060c05160e05152602060e0510161014051602060c05160051b608051610100510101011161036257602060805161010051010160a0525b602060c05160051b6080516101005101010160a05110611d86575060e05160a0610120510152611cfa60c06101005101611b00565b60c061012051015260e061010051015160e0610120510152610100806101005101516001600160401b038111610362576101405161010051611d3c9201611b37565b90610120510152610120806101005101519061012051015261014080610100510151906fffffffffffffffffffffffffffffffff1982168203610362576101205101526101205190565b60a051516001600160401b038111610362576080516101005101016060601f1982610140510301126103625760405190606082018281106001600160401b0382111761202f57604052611ddb60208201611b00565b8252604081015160208301526060810151906001600160401b0382116103625761014051603f8383010112156103625760208282010151611e1b81611a27565b92611e296040519485611a06565b81845260208401906101405160408460051b83870101011161036257604081850101915b60408460051b83870101018310611e7e57505050505090602092916040820152815201602060a0510160a052611cc5565b82516001600160401b038111610362576080603f198285890101610140510301126103625760405190611eb0826119c2565b611ec0604082868a010101611b00565b82528684018101606081015160208401526080810151604084015260a00151906001600160401b0382116103625761014051605f8383888c0101010112156103625760408282878b0101010151611f1681611a27565b92611f246040519485611a06565b81845260208401926101405160608c84848c8860051b9301010101011161036257606082828a8e01010101935b60608c84848c8860051b9301010101018510611f825750505050509181602093606085940152815201920191611e4d565b84516001600160401b0381116103625783838b8f0101010160a0605f198261014051030112610362576040519160a083018381106001600160401b0382111761202f5760405260608201518352611fdb60808301611b00565b602084015260a0820151604084015260c0820151926001600160401b0384116103625760e060209493612018869560606101405191840101611b37565b606084015201516080820152815201940193611f51565b60246000634e487b7160e01b81526041600452fd5b91908203918211610b9657565b80518210156120655760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b1561208257565b60405162461bcd60e51b815260206004820152602560248201527f5377617070696e6720746f2073616d6520746f6b656e206973206e6f7420616c6044820152641b1bddd95960da1b6064820152608490fd5b90816020910312610362575180151581036103625790565b3d15612118573d906120fe82611aae565b9161210c6040519384611a06565b82523d6000602084013e565b606090565b1561212457565b60405162461bcd60e51b815260206004820152600b60248201526a14ddd85c0819985a5b195960aa1b6044820152606490fd5b90815180825260208080930193019160005b828110612177575050505090565b835185529381019392810192600101612169565b906020916121a481518092818552858086019101611b14565b601f01601f1916010190565b60ff1660ff8114610b965760010190565b156121c857565b60405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0811551208185b5bdd5b9d60621b6044820152606490fd5b6000915b6004831061221557505050565b600190825181526020809101920192019190612208565b9190826040910312610362576020825192015190565b60018060a01b03600454169060408091602482518095819363f6c0092760e01b835260048301525afa9081156122c157600091612280575b50905090565b82813d83116122ba575b6122948183611a06565b8101031261016657600360206122a984611b00565b93015110156101665750803861227a565b503d61228a565b513d6000823e3d90fd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606482019290925261231c9161231782608481015b03601f198101845283611a06565b6127ea565b565b81810292918115918404141715610b9657565b612339612873565b60025460405163313ce56760e01b81526001600160a01b0392916020908290600490829087165afa9081156123ec5760009161240e575b5060ff16604d8111610b9657600a0a9081156123f8576123a59360ff9261239892049061231e565b916001541693169061231e565b90803b156103625760405163507cd30f60e01b815233600482015260248101929092526000908290604490829084905af180156123ec576123e35750565b61231c906119f3565b6040513d6000823e3d90fd5b634e487b7160e01b600052601260045260246000fd5b6020813d602011612443575b8161242760209383611a06565b8101031261040357519060ff82168203610166575060ff612370565b3d915061241a565b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604482019290925261231c916123178260648101612309565b6000546001600160a01b0316330361249857565b60405163118cdaa760e01b8152336004820152602490fd5b91906004818111610362576124cc366003198401868401611ac9565b926124e284519460208080978301019101611b7c565b805160a082015180516001600160a01b03928316969295939291600019820191821161274557869161251391612051565b515116946125238688141561207b565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee98888a89149485156126bc575b015199871415928a846000146126b157506040516370a0823160e01b815230878201528a816024818c5afa80156123ec578c9160009161267e575b50936125b794965b600090156126585750916000939184936003541692826040519384928337810185815203925af16102c26120ed565b1561264d57604051916370a0823160e01b835230908301528582602481875afa80156123ec5760009061261e575b6125ef9250612044565b93826000526007815260ff604060002054166126085750565b6008905261231c60ff6040600020541685612331565b508582813d8311612646575b6126348183611a06565b81010312610362576125ef91516125e5565b503d61262a565b6125ef915047612044565b809492508093916003541692826040519384928337810182815203925af16102c26120ed565b8092508c8092503d83116126aa575b6126978183611a06565b8101031261036257518b906125b7612580565b503d61268d565b6125b7934796612588565b816127109282016126d281518d309033906122cb565b60065490516040805163095ea7b360e01b81529288166001600160a01b03168b84019081526020810192909252919485928e92849260009284920190565b03925af19182156123ec578b92612728575b50612545565b61273e90833d851161039f576103908183611a06565b5038612722565b601185634e487b7160e01b6000525260246000fd5b8151939261276785611a27565b946127756040519687611a06565b808652612784601f1991611a27565b0136602087013760009285845b82518110156127e1576001906001600160a01b03806127b08387612051565b5116908616146000146127d057856127c8828b612051565b525b01612791565b866127db828b612051565b526127ca565b50955050505050565b6000806128139260018060a01b03169360208151910182865af161280c6120ed565b9083612905565b8051908115159182612841575b50506128295750565b60249060405190635274afe760e01b82526004820152fd5b61285492506020809183010191016120d5565b153880612820565b519069ffffffffffffffffffff8216820361036257565b600254604051633fabe5a360e21b81529060a090829060049082906001600160a01b03165afa9081156123ec576000916128b8575b506000811215611b795750600090565b905060a0813d60a0116128fd575b816128d360a09383611a06565b81010312610362576128e48161285c565b506128f660806020830151920161285c565b50386128a8565b3d91506128c6565b9061292c575080511561291a57805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061295f575b61293d575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561293556fea26469706673582212201805febe35b3b1aecd752a8d5fd7bf9865ae2c161c7a27ccb6c1ab869a1a5e3364736f6c63430008180033

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

0000000000000000000000009566d8998a47d53c948803744864e63456177353000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee570000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8000000000000000000000000216b4b4ba9f3e719726886d34a177484278bfcae0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : autoLayerPointsAddress_ (address): 0x9566D8998a47D53C948803744864e63456177353
Arg [1] : routerAddress_ (address): 0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57
Arg [2] : ETHUSDPriceFeedAdress_ (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [3] : balancerVaultAddress_ (address): 0xBA12222222228d8Ba445958a75a0704d566BF2C8
Arg [4] : tokenProxyAddress_ (address): 0x216B4B4Ba9F3e719726886d34a177484278Bfcae
Arg [5] : gammaProxyAddress_ (address): 0x0000000000000000000000000000000000000000

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000009566d8998a47d53c948803744864e63456177353
Arg [1] : 000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee57
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [3] : 000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8
Arg [4] : 000000000000000000000000216b4b4ba9f3e719726886d34a177484278bfcae
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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