ETH Price: $3,260.76 (+0.74%)

Contract

0xf42eCDC112365fF79a745B4cf7D4C266bd6E4b25
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Redeem Exact Set...215904472025-01-10 0:17:1124 hrs ago1736468231IN
Indexcoop: Exchange Issuance
0 ETH0.010998675.70567452
Redeem Exact Set...215794462025-01-08 11:26:112 days ago1736335571IN
Indexcoop: Exchange Issuance
0 ETH0.013562985.35554577
Redeem Exact Set...215720642025-01-07 10:42:113 days ago1736246531IN
Indexcoop: Exchange Issuance
0 ETH0.011008365.7125173
Redeem Exact Set...214797982024-12-25 13:30:3516 days ago1735133435IN
Indexcoop: Exchange Issuance
0 ETH0.008501544.39777235
Redeem Exact Set...212608342024-11-24 23:17:3547 days ago1732490255IN
Indexcoop: Exchange Issuance
0 ETH0.016364898.44174857
Redeem Exact Set...212579102024-11-24 13:30:1147 days ago1732455011IN
Indexcoop: Exchange Issuance
0 ETH0.0204119610.5798431
Redeem Exact Set...212491412024-11-23 8:07:4748 days ago1732349267IN
Indexcoop: Exchange Issuance
0 ETH0.0261692911.49678396
Redeem Exact Set...212340422024-11-21 5:33:1150 days ago1732167191IN
Indexcoop: Exchange Issuance
0 ETH0.0277049511.46624993
Redeem Exact Set...211961452024-11-15 22:42:3556 days ago1731710555IN
Indexcoop: Exchange Issuance
0 ETH0.0459186822.09467877
Redeem Exact Set...211881822024-11-14 20:00:4757 days ago1731614447IN
Indexcoop: Exchange Issuance
0 ETH0.0048082925.90188021
Issue Exact Set ...211447822024-11-08 18:41:4763 days ago1731091307IN
Indexcoop: Exchange Issuance
0.54994739 ETH0.0243674620.78507194
Issue Exact Set ...210837652024-10-31 6:16:2371 days ago1730355383IN
Indexcoop: Exchange Issuance
0.11999954 ETH0.008242467.60265723
Redeem Exact Set...210794622024-10-30 15:51:5972 days ago1730303519IN
Indexcoop: Exchange Issuance
0 ETH0.0792143833.02696537
Issue Exact Set ...210722192024-10-29 15:34:4773 days ago1730216087IN
Indexcoop: Exchange Issuance
1.59989734 ETH0.0143233612.86981935
Redeem Exact Set...210703622024-10-29 9:21:3573 days ago1730193695IN
Indexcoop: Exchange Issuance
0 ETH0.0303947210.60162592
Redeem Exact Set...209579252024-10-13 16:44:4789 days ago1728837887IN
Indexcoop: Exchange Issuance
0 ETH0.0308505112.58413134
Redeem Exact Set...209110262024-10-07 3:35:3595 days ago1728272135IN
Indexcoop: Exchange Issuance
0 ETH0.015404086.4825606
Issue Exact Set ...209022652024-10-05 22:16:1197 days ago1728166571IN
Indexcoop: Exchange Issuance
0.48996509 ETH0.00622175.30186613
Redeem Exact Set...208855192024-10-03 14:14:5999 days ago1727964899IN
Indexcoop: Exchange Issuance
0 ETH0.022525711.17616587
Redeem Exact Set...208463132024-09-28 3:01:35104 days ago1727492495IN
Indexcoop: Exchange Issuance
0 ETH0.0259831310.67737149
Redeem Exact Set...206791092024-09-04 18:48:23128 days ago1725475703IN
Indexcoop: Exchange Issuance
0 ETH0.001807769.49281048
Redeem Exact Set...205999732024-08-24 17:32:59139 days ago1724520779IN
Indexcoop: Exchange Issuance
0 ETH0.005541932.72869469
Issue Exact Set ...204912272024-08-09 13:05:11154 days ago1723208711IN
Indexcoop: Exchange Issuance
0.69995189 ETH0.00621565.11116764
Issue Exact Set ...203502362024-07-20 20:49:11174 days ago1721508551IN
Indexcoop: Exchange Issuance
4.29961052 ETH0.005241873.10979427
Issue Exact Set ...203328092024-07-18 10:28:47176 days ago1721298527IN
Indexcoop: Exchange Issuance
0 ETH0.0260217610.72444451
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
215794462025-01-08 11:26:112 days ago1736335571
Indexcoop: Exchange Issuance
25.25553293 ETH
215794462025-01-08 11:26:112 days ago1736335571
Indexcoop: Exchange Issuance
25.25553293 ETH
214797982024-12-25 13:30:3516 days ago1735133435
Indexcoop: Exchange Issuance
2.72389872 ETH
214797982024-12-25 13:30:3516 days ago1735133435
Indexcoop: Exchange Issuance
2.72389872 ETH
213964772024-12-13 22:08:4728 days ago1734127727
Indexcoop: Exchange Issuance
20.03608359 ETH
213964772024-12-13 22:08:4728 days ago1734127727
Indexcoop: Exchange Issuance
20.03608359 ETH
213374792024-12-05 16:26:4736 days ago1733416007
Indexcoop: Exchange Issuance
5.97838479 ETH
213374792024-12-05 16:26:4736 days ago1733416007
Indexcoop: Exchange Issuance
5.97838479 ETH
212608342024-11-24 23:17:3547 days ago1732490255
Indexcoop: Exchange Issuance
1.23543302 ETH
212608342024-11-24 23:17:3547 days ago1732490255
Indexcoop: Exchange Issuance
1.23543302 ETH
212579102024-11-24 13:30:1147 days ago1732455011
Indexcoop: Exchange Issuance
1.18185127 ETH
212579102024-11-24 13:30:1147 days ago1732455011
Indexcoop: Exchange Issuance
1.18185127 ETH
211961452024-11-15 22:42:3556 days ago1731710555
Indexcoop: Exchange Issuance
7.34903403 ETH
211961452024-11-15 22:42:3556 days ago1731710555
Indexcoop: Exchange Issuance
7.34903403 ETH
211881822024-11-14 20:00:4757 days ago1731614447
Indexcoop: Exchange Issuance
1.40956404 ETH
211881822024-11-14 20:00:4757 days ago1731614447
Indexcoop: Exchange Issuance
1.40956404 ETH
211447822024-11-08 18:41:4763 days ago1731091307
Indexcoop: Exchange Issuance
0.00001374 ETH
211447822024-11-08 18:41:4763 days ago1731091307
Indexcoop: Exchange Issuance
0.00001374 ETH
211447822024-11-08 18:41:4763 days ago1731091307
Indexcoop: Exchange Issuance
0.54994739 ETH
210837652024-10-31 6:16:2371 days ago1730355383
Indexcoop: Exchange Issuance
0.00000299 ETH
210837652024-10-31 6:16:2371 days ago1730355383
Indexcoop: Exchange Issuance
0.00000299 ETH
210837652024-10-31 6:16:2371 days ago1730355383
Indexcoop: Exchange Issuance
0.11999954 ETH
210794622024-10-30 15:51:5972 days ago1730303519
Indexcoop: Exchange Issuance
5.3823093 ETH
210794622024-10-30 15:51:5972 days ago1730303519
Indexcoop: Exchange Issuance
5.3823093 ETH
210722192024-10-29 15:34:4773 days ago1730216087
Indexcoop: Exchange Issuance
0.00003999 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ExchangeIssuanceZeroEx

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : ExchangeIssuanceZeroEx.sol
/*
    Copyright 2022 Index Cooperative
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;

import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Math } from "@openzeppelin/contracts/math/Math.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

import { IBasicIssuanceModule } from "../interfaces/IBasicIssuanceModule.sol";
import { IDebtIssuanceModule } from "../interfaces/IDebtIssuanceModule.sol";
import { IController } from "../interfaces/IController.sol";
import { ISetToken } from "../interfaces/ISetToken.sol";
import { IWETH } from "../interfaces/IWETH.sol";
import { PreciseUnitMath } from "../lib/PreciseUnitMath.sol";


contract ExchangeIssuanceZeroEx is Ownable, ReentrancyGuard {

    using Address for address payable;
    using SafeMath for uint256;
    using PreciseUnitMath for uint256;
    using SafeERC20 for IERC20;
    using SafeERC20 for ISetToken;

    struct IssuanceModuleData {
        bool isAllowed;
        bool isDebtIssuanceModule;
    }

    /* ============ Constants ============== */

    // Placeholder address to identify ETH where it is treated as if it was an ERC20 token
    address constant public ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /* ============ State Variables ============ */

    address public immutable WETH;
    IController public immutable setController;
    address public immutable swapTarget;

    /* ============ Events ============ */

    event ExchangeIssue(
        address indexed _recipient,     // The recipient address of the issued SetTokens
        ISetToken indexed _setToken,    // The issued SetToken
        IERC20 indexed _inputToken,     // The address of the input asset(ERC20/ETH) used to issue the SetTokens
        uint256 _amountInputToken,      // The amount of input tokens used for issuance
        uint256 _amountSetIssued        // The amount of SetTokens received by the recipient
    );

    event ExchangeRedeem(
        address indexed _recipient,     // The recipient adress of the output tokens obtained for redemption
        ISetToken indexed _setToken,    // The redeemed SetToken
        IERC20 indexed _outputToken,    // The address of output asset(ERC20/ETH) received by the recipient
        uint256 _amountSetRedeemed,     // The amount of SetTokens redeemed for output tokens
        uint256 _amountOutputToken      // The amount of output tokens received by the recipient
    );

    /* ============ Modifiers ============ */

    modifier isValidModule(address _issuanceModule) {
        require(setController.isModule(_issuanceModule), "ExchangeIssuance: INVALID ISSUANCE MODULE");
         _;
    }

    constructor(
        address _weth,
        IController _setController,
        address _swapTarget
    )
        public
    {
        setController = _setController;

        WETH = _weth;
        swapTarget = _swapTarget;
    }

    /* ============ External Functions ============ */

    /**
     * Withdraw slippage to selected address
     *
     * @param _tokens    Addresses of tokens to withdraw, specifiy ETH_ADDRESS to withdraw ETH
     * @param _to        Address to send the tokens to
     */
    function withdrawTokens(IERC20[] calldata _tokens, address payable _to) external onlyOwner payable {
        for(uint256 i = 0; i < _tokens.length; i++) {
            if(address(_tokens[i]) == ETH_ADDRESS){
                _to.sendValue(address(this).balance);
            }
            else{
                _tokens[i].safeTransfer(_to, _tokens[i].balanceOf(address(this)));
            }
        }
    }

    receive() external payable {
        // required for weth.withdraw() to work properly
        require(msg.sender == WETH, "ExchangeIssuance: Direct deposits not allowed");
    }

    /* ============ Public Functions ============ */


    /**
     * Runs all the necessary approval functions required for a given ERC20 token.
     * This function can be called when a new token is added to a SetToken during a
     * rebalance.
     *
     * @param _token    Address of the token which needs approval
     * @param _spender  Address of the spender which will be approved to spend token. (Must be a whitlisted issuance module)
     */
    function approveToken(IERC20 _token, address _spender) public  isValidModule(_spender) {
        _safeApprove(_token, _spender, type(uint256).max);
    }

    /**
     * Runs all the necessary approval functions required for a list of ERC20 tokens.
     *
     * @param _tokens    Addresses of the tokens which need approval
     * @param _spender   Address of the spender which will be approved to spend token. (Must be a whitlisted issuance module)
     */
    function approveTokens(IERC20[] calldata _tokens, address _spender) external {
        for (uint256 i = 0; i < _tokens.length; i++) {
            approveToken(_tokens[i], _spender);
        }
    }

    /**
     * Runs all the necessary approval functions required before issuing
     * or redeeming a SetToken. This function need to be called only once before the first time
     * this smart contract is used on any particular SetToken.
     *
     * @param _setToken          Address of the SetToken being initialized
     * @param _issuanceModule    Address of the issuance module which will be approved to spend component tokens.
     */
    function approveSetToken(ISetToken _setToken, address _issuanceModule) external {
        address[] memory components = _setToken.getComponents();
        for (uint256 i = 0; i < components.length; i++) {
            approveToken(IERC20(components[i]), _issuanceModule);
        }
    }

    /**
    * Issues an exact amount of SetTokens for given amount of input ERC20 tokens.
    * The excess amount of tokens is returned in an equivalent amount of ether.
    *
    * @param _setToken              Address of the SetToken to be issued
    * @param _inputToken            Address of the input token
    * @param _amountSetToken        Amount of SetTokens to issue
    * @param _maxAmountInputToken   Maximum amount of input tokens to be used to issue SetTokens.
    * @param _componentQuotes       The encoded 0x transactions to execute 
    *
    * @return totalInputTokenSold   Amount of input token spent for issuance
    */
    function issueExactSetFromToken(
        ISetToken _setToken,
        IERC20 _inputToken,
        uint256 _amountSetToken,
        uint256 _maxAmountInputToken,
        bytes[] memory _componentQuotes,
        address _issuanceModule,
        bool _isDebtIssuance
    )
        isValidModule(_issuanceModule)
        external
        nonReentrant
        returns (uint256)
    {

        _inputToken.safeTransferFrom(msg.sender, address(this), _maxAmountInputToken);
        _safeApprove(_inputToken, swapTarget, _maxAmountInputToken);

        uint256 totalInputTokenSold = _buyComponentsForInputToken(_setToken, _amountSetToken,  _componentQuotes, _inputToken, _issuanceModule, _isDebtIssuance);
        require(totalInputTokenSold <= _maxAmountInputToken, "ExchangeIssuance: OVERSPENT TOKEN");

        IBasicIssuanceModule(_issuanceModule).issue(_setToken, _amountSetToken, msg.sender);

        _returnExcessInputToken(_inputToken, _maxAmountInputToken, totalInputTokenSold);

        emit ExchangeIssue(msg.sender, _setToken, _inputToken, _maxAmountInputToken, _amountSetToken);
        return totalInputTokenSold;
    }


    /**
    * Issues an exact amount of SetTokens for given amount of ETH.
    * The excess amount of tokens is returned in an equivalent amount of ether.
    *
    * @param _setToken              Address of the SetToken to be issued
    * @param _amountSetToken        Amount of SetTokens to issue
    * @param _componentQuotes       The encoded 0x transactions to execute
    *
    * @return amountEthReturn       Amount of ether returned to the caller
    */
    function issueExactSetFromETH(
        ISetToken _setToken,
        uint256 _amountSetToken,
        bytes[] memory _componentQuotes,
        address _issuanceModule,
        bool _isDebtIssuance
    )
        isValidModule(_issuanceModule)
        external
        nonReentrant
        payable
        returns (uint256)
    {
        require(msg.value > 0, "ExchangeIssuance: NO ETH SENT");

        IWETH(WETH).deposit{value: msg.value}();
        _safeApprove(IERC20(WETH), swapTarget, msg.value);

        uint256 totalEthSold = _buyComponentsForInputToken(_setToken, _amountSetToken, _componentQuotes, IERC20(WETH), _issuanceModule, _isDebtIssuance);

        require(totalEthSold <= msg.value, "ExchangeIssuance: OVERSPENT ETH");
        IBasicIssuanceModule(_issuanceModule).issue(_setToken, _amountSetToken, msg.sender);

        uint256 amountEthReturn = msg.value.sub(totalEthSold);
        if (amountEthReturn > 0) {
            IWETH(WETH).withdraw(amountEthReturn);
            payable(msg.sender).sendValue(amountEthReturn);
        }

        emit ExchangeIssue(msg.sender, _setToken, IERC20(ETH_ADDRESS), totalEthSold, _amountSetToken);
        return amountEthReturn; 
    }

    /**
     * Redeems an exact amount of SetTokens for an ERC20 token.
     * The SetToken must be approved by the sender to this contract.
     *
     * @param _setToken             Address of the SetToken being redeemed
     * @param _outputToken          Address of output token
     * @param _amountSetToken       Amount SetTokens to redeem
     * @param _minOutputReceive     Minimum amount of output token to receive
     * @param _componentQuotes      The encoded 0x transactions execute (components -> WETH).
     * @param _issuanceModule       Address of issuance Module to use 
     * @param _isDebtIssuance       Flag indicating wether given issuance module is a debt issuance module
     *
     * @return outputAmount         Amount of output tokens sent to the caller
     */
    function redeemExactSetForToken(
        ISetToken _setToken,
        IERC20 _outputToken,
        uint256 _amountSetToken,
        uint256 _minOutputReceive,
        bytes[] memory _componentQuotes,
        address _issuanceModule,
        bool _isDebtIssuance
    )
        isValidModule(_issuanceModule)
        external
        nonReentrant
        returns (uint256)
    {

        uint256 outputAmount;
        _redeemExactSet(_setToken, _amountSetToken, _issuanceModule);

        outputAmount = _sellComponentsForOutputToken(_setToken, _amountSetToken, _componentQuotes, _outputToken, _issuanceModule, _isDebtIssuance);
        require(outputAmount >= _minOutputReceive, "ExchangeIssuance: INSUFFICIENT OUTPUT AMOUNT");

        // Transfer sender output token
        _outputToken.safeTransfer(msg.sender, outputAmount);
        // Emit event
        emit ExchangeRedeem(msg.sender, _setToken, _outputToken, _amountSetToken, outputAmount);
        // Return output amount
        return outputAmount;
    }

    /**
     * Redeems an exact amount of SetTokens for ETH.
     * The SetToken must be approved by the sender to this contract.
     *
     * @param _setToken             Address of the SetToken being redeemed
     * @param _amountSetToken       Amount SetTokens to redeem
     * @param _minEthReceive        Minimum amount of Eth to receive
     * @param _componentQuotes      The encoded 0x transactions execute
     * @param _issuanceModule       Address of issuance Module to use 
     * @param _isDebtIssuance       Flag indicating wether given issuance module is a debt issuance module
     *
     * @return outputAmount         Amount of output tokens sent to the caller
     */
    function redeemExactSetForETH(
        ISetToken _setToken,
        uint256 _amountSetToken,
        uint256 _minEthReceive,
        bytes[] memory _componentQuotes,
        address _issuanceModule,
        bool _isDebtIssuance
    )
        isValidModule(_issuanceModule)
        external
        nonReentrant
        returns (uint256)
    {
        _redeemExactSet(_setToken, _amountSetToken, _issuanceModule);
        uint ethAmount = _sellComponentsForOutputToken(_setToken, _amountSetToken, _componentQuotes, IERC20(WETH), _issuanceModule, _isDebtIssuance);
        require(ethAmount >= _minEthReceive, "ExchangeIssuance: INSUFFICIENT WETH RECEIVED");

        IWETH(WETH).withdraw(ethAmount);
        (payable(msg.sender)).sendValue(ethAmount);

        emit ExchangeRedeem(msg.sender, _setToken, IERC20(ETH_ADDRESS), _amountSetToken, ethAmount);
        return ethAmount;
         
    }
    

    /**
     * Sets a max approval limit for an ERC20 token, provided the current allowance
     * is less than the required allownce.
     *
     * @param _token    Token to approve
     * @param _spender  Spender address to approve
     */
    function _safeApprove(IERC20 _token, address _spender, uint256 _requiredAllowance) internal {
        uint256 allowance = _token.allowance(address(this), _spender);
        if (allowance < _requiredAllowance) {
            _token.safeIncreaseAllowance(_spender, type(uint256).max - allowance);
        }
    }

    /**
     * Issues an exact amount of SetTokens using WETH.
     * Acquires SetToken components by executing the 0x swaps whose callata is passed in _quotes.
     * Uses the acquired components to issue the SetTokens.
     *
     * @param _setToken             Address of the SetToken being issued
     * @param _amountSetToken       Amount of SetTokens to be issued
     * @param _quotes               The encoded 0x transaction calldata to execute against the 0x ExchangeProxy
     * @param _inputToken           Token to use to pay for issuance. Must be the sellToken of the 0x trades.
     * @param _issuanceModule       Issuance module to use for set token issuance.
     *
     * @return totalInputTokenSold  Total amount of input token spent on this issuance
     */
    function _buyComponentsForInputToken(
        ISetToken _setToken,
        uint256 _amountSetToken,
        bytes[] memory _quotes,
        IERC20 _inputToken,
        address _issuanceModule,
        bool _isDebtIssuance
    ) 
    internal
    returns (uint256 totalInputTokenSold)
    {
        uint256 componentAmountBought;

        (address[] memory components, uint256[] memory componentUnits) = getRequiredIssuanceComponents(_issuanceModule, _isDebtIssuance, _setToken, _amountSetToken);

        uint256 inputTokenBalanceBefore = _inputToken.balanceOf(address(this));
        for (uint256 i = 0; i < components.length; i++) {
            address component = components[i];
            uint256 units = componentUnits[i];

            // If the component is equal to the input token we don't have to trade
            if(component == address(_inputToken)) {
                totalInputTokenSold = totalInputTokenSold.add(units);
                componentAmountBought = units;
            }
            else {
                uint256 componentBalanceBefore = IERC20(component).balanceOf(address(this));
                _fillQuote(_quotes[i]);
                uint256 componentBalanceAfter = IERC20(component).balanceOf(address(this));
                componentAmountBought = componentBalanceAfter.sub(componentBalanceBefore);
                require(componentAmountBought >= units, "ExchangeIssuance: UNDERBOUGHT COMPONENT");
            }
        }
        uint256 inputTokenBalanceAfter = _inputToken.balanceOf(address(this));
        totalInputTokenSold = totalInputTokenSold.add(inputTokenBalanceBefore.sub(inputTokenBalanceAfter));
    }

    /**
     * Redeems a given list of SetToken components for given token.
     *
     * @param _setToken             The set token being swapped.
     * @param _amountSetToken       The amount of set token being swapped.
     * @param _swaps                An array containing ZeroExSwap swaps.
     * @param _outputToken          The token for which to sell the index components must be the same as the buyToken that was specified when generating the swaps
     * @param _issuanceModule    Address of issuance Module to use 
     * @param _isDebtIssuance    Flag indicating wether given issuance module is a debt issuance module
     *
     * @return totalOutputTokenBought  Total amount of output token received after liquidating all SetToken components
     */
    function _sellComponentsForOutputToken(ISetToken _setToken, uint256 _amountSetToken, bytes[] memory _swaps, IERC20 _outputToken, address _issuanceModule, bool _isDebtIssuance)
        internal
        returns (uint256 totalOutputTokenBought)
    {
        (address[] memory components, uint256[] memory componentUnits) = getRequiredRedemptionComponents(_issuanceModule, _isDebtIssuance, _setToken, _amountSetToken);
        uint256 outputTokenBalanceBefore = _outputToken.balanceOf(address(this));
        for (uint256 i = 0; i < _swaps.length; i++) {
            uint256 maxAmountSell = componentUnits[i];

            uint256 componentAmountSold;

            // If the component is equal to the output token we don't have to trade
            if(components[i] == address(_outputToken)) {
                totalOutputTokenBought = totalOutputTokenBought.add(maxAmountSell);
                componentAmountSold = maxAmountSell;
            }
            else {
                _safeApprove(IERC20(components[i]), address(swapTarget), maxAmountSell);
                uint256 componentBalanceBefore = IERC20(components[i]).balanceOf(address(this));
                _fillQuote(_swaps[i]);
                uint256 componentBalanceAfter = IERC20(components[i]).balanceOf(address(this));
                componentAmountSold = componentBalanceBefore.sub(componentBalanceAfter);
                require(maxAmountSell >= componentAmountSold, "ExchangeIssuance: OVERSOLD COMPONENT");
            }

        }
        uint256 outputTokenBalanceAfter = _outputToken.balanceOf(address(this));
        totalOutputTokenBought = totalOutputTokenBought.add(outputTokenBalanceAfter.sub(outputTokenBalanceBefore));
    }

    /**
     * Execute a 0x Swap quote
     *
     * @param _quote          Swap quote as returned by 0x API
     *
     */
    function _fillQuote(
        bytes memory _quote
    )
        internal
        
    {

        (bool success, bytes memory returndata) = swapTarget.call(_quote);

        // Forwarding errors including new custom errors
        // Taken from: https://ethereum.stackexchange.com/a/111187/73805
        if (!success) {
            if (returndata.length == 0) revert();
            assembly {
                revert(add(32, returndata), mload(returndata))
            }
        }

    }

    /**
     * Transfers given amount of set token from the sender and redeems it for underlying components.
     * Obtained component tokens are sent to this contract. 
     *
     * @param _setToken     Address of the SetToken to be redeemed
     * @param _amount       Amount of SetToken to be redeemed
     */
    function _redeemExactSet(ISetToken _setToken, uint256 _amount, address _issuanceModule) internal returns (uint256) {
        _setToken.safeTransferFrom(msg.sender, address(this), _amount);
        IBasicIssuanceModule(_issuanceModule).redeem(_setToken, _amount, address(this));
    }

    /**
     * Returns excess input token
     *
     * @param _inputToken         Address of the input token to return
     * @param _receivedAmount     Amount received by the caller
     * @param _spentAmount        Amount spent for issuance
     */
    function _returnExcessInputToken(IERC20 _inputToken, uint256 _receivedAmount, uint256 _spentAmount) internal {
        uint256 amountTokenReturn = _receivedAmount.sub(_spentAmount);
        if (amountTokenReturn > 0) {
            _inputToken.safeTransfer(msg.sender,  amountTokenReturn);
        }
    }

    /**
     * Returns component positions required for issuance 
     *
     * @param _issuanceModule    Address of issuance Module to use 
     * @param _isDebtIssuance    Flag indicating wether given issuance module is a debt issuance module
     * @param _setToken          Set token to issue
     * @param _amountSetToken    Amount of set token to issue
     */
    function getRequiredIssuanceComponents(address _issuanceModule, bool _isDebtIssuance, ISetToken _setToken, uint256 _amountSetToken) public view returns(address[] memory components, uint256[] memory positions) {
        if(_isDebtIssuance) { 
            (components, positions, ) = IDebtIssuanceModule(_issuanceModule).getRequiredComponentIssuanceUnits(_setToken, _amountSetToken);
        }
        else {
            (components, positions) = IBasicIssuanceModule(_issuanceModule).getRequiredComponentUnitsForIssue(_setToken, _amountSetToken);
        }

    }

    /**
     * Returns component positions required for Redemption 
     *
     * @param _issuanceModule    Address of issuance Module to use 
     * @param _isDebtIssuance    Flag indicating wether given issuance module is a debt issuance module
     * @param _setToken          Set token to issue
     * @param _amountSetToken    Amount of set token to issue
     */
    function getRequiredRedemptionComponents(address _issuanceModule, bool _isDebtIssuance, ISetToken _setToken, uint256 _amountSetToken) public view returns(address[] memory components, uint256[] memory positions) {
        if(_isDebtIssuance) { 
            (components, positions, ) = IDebtIssuanceModule(_issuanceModule).getRequiredComponentRedemptionUnits(_setToken, _amountSetToken);
        }
        else {
            components = _setToken.getComponents();
            positions = new uint256[](components.length);
            for(uint256 i = 0; i < components.length; i++) {
                uint256 unit = uint256(_setToken.getDefaultPositionRealUnit(components[i]));
                positions[i] = unit.preciseMul(_amountSetToken);
            }
        }
    }
}

File 2 of 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

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

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 4 of 16 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 5 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

File 6 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

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

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

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

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 7 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

File 8 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 9 of 16 : IBasicIssuanceModule.sol
/*
    Copyright 2020 Set Labs Inc.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity >=0.6.10;

import { ISetToken } from "./ISetToken.sol";

interface IBasicIssuanceModule {
    function getRequiredComponentUnitsForIssue(
        ISetToken _setToken,
        uint256 _quantity
    ) external view returns(address[] memory, uint256[] memory);
    function issue(ISetToken _setToken, uint256 _quantity, address _to) external;
    function redeem(ISetToken _token, uint256 _quantity, address _to) external;
}

File 10 of 16 : IDebtIssuanceModule.sol
/*
    Copyright 2020 Set Labs Inc.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity >=0.6.10;

import { ISetToken } from "./ISetToken.sol";

interface IDebtIssuanceModule {
    function getRequiredComponentIssuanceUnits(
        ISetToken _setToken,
        uint256 _quantity
    ) external view returns (address[] memory, uint256[] memory, uint256[] memory);
    function getRequiredComponentRedemptionUnits(
        ISetToken _setToken,
        uint256 _quantity
    ) external view returns (address[] memory, uint256[] memory, uint256[] memory);
    function issue(ISetToken _setToken, uint256 _quantity, address _to) external;
    function redeem(ISetToken _token, uint256 _quantity, address _to) external;
}

File 11 of 16 : IController.sol
/*
    Copyright 2020 Set Labs Inc.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;

interface IController {
    function addSet(address _setToken) external;
    function feeRecipient() external view returns(address);
    function getModuleFee(address _module, uint256 _feeType) external view returns(uint256);
    function isModule(address _module) external view returns(bool);
    function isSet(address _setToken) external view returns(bool);
    function isSystemContract(address _contractAddress) external view returns (bool);
    function resourceId(uint256 _id) external view returns(address);
}

File 12 of 16 : ISetToken.sol
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

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

/**
 * @title ISetToken
 * @author Set Protocol
 *
 * Interface for operating with SetTokens.
 */
interface ISetToken is IERC20 {

    /* ============ Enums ============ */

    enum ModuleState {
        NONE,
        PENDING,
        INITIALIZED
    }

    /* ============ Structs ============ */
    /**
     * The base definition of a SetToken Position
     *
     * @param component           Address of token in the Position
     * @param module              If not in default state, the address of associated module
     * @param unit                Each unit is the # of components per 10^18 of a SetToken
     * @param positionState       Position ENUM. Default is 0; External is 1
     * @param data                Arbitrary data
     */
    struct Position {
        address component;
        address module;
        int256 unit;
        uint8 positionState;
        bytes data;
    }

    /**
     * A struct that stores a component's cash position details and external positions
     * This data structure allows O(1) access to a component's cash position units and
     * virtual units.
     *
     * @param virtualUnit               Virtual value of a component's DEFAULT position. Stored as virtual for efficiency
     *                                  updating all units at once via the position multiplier. Virtual units are achieved
     *                                  by dividing a "real" value by the "positionMultiplier"
     * @param componentIndex
     * @param externalPositionModules   List of external modules attached to each external position. Each module
     *                                  maps to an external position
     * @param externalPositions         Mapping of module => ExternalPosition struct for a given component
     */
    struct ComponentPosition {
      int256 virtualUnit;
      address[] externalPositionModules;
      mapping(address => ExternalPosition) externalPositions;
    }

    /**
     * A struct that stores a component's external position details including virtual unit and any
     * auxiliary data.
     *
     * @param virtualUnit       Virtual value of a component's EXTERNAL position.
     * @param data              Arbitrary data
     */
    struct ExternalPosition {
      int256 virtualUnit;
      bytes data;
    }


    /* ============ Functions ============ */

    function addComponent(address _component) external;
    function removeComponent(address _component) external;
    function editDefaultPositionUnit(address _component, int256 _realUnit) external;
    function addExternalPositionModule(address _component, address _positionModule) external;
    function removeExternalPositionModule(address _component, address _positionModule) external;
    function editExternalPositionUnit(address _component, address _positionModule, int256 _realUnit) external;
    function editExternalPositionData(address _component, address _positionModule, bytes calldata _data) external;

    function invoke(address _target, uint256 _value, bytes calldata _data) external returns(bytes memory);

    function editPositionMultiplier(int256 _newMultiplier) external;

    function mint(address _account, uint256 _quantity) external;
    function burn(address _account, uint256 _quantity) external;

    function lock() external;
    function unlock() external;

    function addModule(address _module) external;
    function removeModule(address _module) external;
    function initializeModule() external;

    function setManager(address _manager) external;

    function manager() external view returns (address);
    function moduleStates(address _module) external view returns (ModuleState);
    function getModules() external view returns (address[] memory);

    function getDefaultPositionRealUnit(address _component) external view returns(int256);
    function getExternalPositionRealUnit(address _component, address _positionModule) external view returns(int256);
    function getComponents() external view returns(address[] memory);
    function getExternalPositionModules(address _component) external view returns(address[] memory);
    function getExternalPositionData(address _component, address _positionModule) external view returns(bytes memory);
    function isExternalPositionModule(address _component, address _module) external view returns(bool);
    function isComponent(address _component) external view returns(bool);

    function positionMultiplier() external view returns (int256);
    function getPositions() external view returns (Position[] memory);
    function getTotalComponentRealUnits(address _component) external view returns(int256);

    function isInitializedModule(address _module) external view returns(bool);
    function isPendingModule(address _module) external view returns(bool);
    function isLocked() external view returns (bool);
}

File 13 of 16 : IWETH.sol
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity >=0.6.10;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
}

File 14 of 16 : PreciseUnitMath.sol
/*
    Copyright 2020 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    SPDX-License-Identifier: Apache License, Version 2.0
*/

pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;

import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol";


/**
 * @title PreciseUnitMath
 * @author Set Protocol
 *
 * Arithmetic for fixed-point numbers with 18 decimals of precision. Some functions taken from
 * dYdX's BaseMath library.
 *
 * CHANGELOG:
 * - 9/21/20: Added safePower function
 */
library PreciseUnitMath {
    using SafeMath for uint256;
    using SignedSafeMath for int256;

    // The number One in precise units.
    uint256 constant internal PRECISE_UNIT = 10 ** 18;
    int256 constant internal PRECISE_UNIT_INT = 10 ** 18;

    // Max unsigned integer value
    uint256 constant internal MAX_UINT_256 = type(uint256).max;
    // Max and min signed integer value
    int256 constant internal MAX_INT_256 = type(int256).max;
    int256 constant internal MIN_INT_256 = type(int256).min;

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function preciseUnit() internal pure returns (uint256) {
        return PRECISE_UNIT;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function preciseUnitInt() internal pure returns (int256) {
        return PRECISE_UNIT_INT;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function maxUint256() internal pure returns (uint256) {
        return MAX_UINT_256;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function maxInt256() internal pure returns (int256) {
        return MAX_INT_256;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function minInt256() internal pure returns (int256) {
        return MIN_INT_256;
    }

    /**
     * @dev Multiplies value a by value b (result is rounded down). It's assumed that the value b is the significand
     * of a number with 18 decimals precision.
     */
    function preciseMul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(b).div(PRECISE_UNIT);
    }

    /**
     * @dev Multiplies value a by value b (result is rounded towards zero). It's assumed that the value b is the
     * significand of a number with 18 decimals precision.
     */
    function preciseMul(int256 a, int256 b) internal pure returns (int256) {
        return a.mul(b).div(PRECISE_UNIT_INT);
    }

    /**
     * @dev Multiplies value a by value b (result is rounded up). It's assumed that the value b is the significand
     * of a number with 18 decimals precision.
     */
    function preciseMulCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0 || b == 0) {
            return 0;
        }
        return a.mul(b).sub(1).div(PRECISE_UNIT).add(1);
    }

    /**
     * @dev Divides value a by value b (result is rounded down).
     */
    function preciseDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(PRECISE_UNIT).div(b);
    }


    /**
     * @dev Divides value a by value b (result is rounded towards 0).
     */
    function preciseDiv(int256 a, int256 b) internal pure returns (int256) {
        return a.mul(PRECISE_UNIT_INT).div(b);
    }

    /**
     * @dev Divides value a by value b (result is rounded up or away from 0).
     */
    function preciseDivCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "Cant divide by 0");

        return a > 0 ? a.mul(PRECISE_UNIT).sub(1).div(b).add(1) : 0;
    }

    /**
     * @dev Divides value a by value b (result is rounded down - positive numbers toward 0 and negative away from 0).
     */
    function divDown(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "Cant divide by 0");
        require(a != MIN_INT_256 || b != -1, "Invalid input");

        int256 result = a.div(b);
        if (a ^ b < 0 && a % b != 0) {
            result -= 1;
        }

        return result;
    }

    /**
     * @dev Multiplies value a by value b where rounding is towards the lesser number. 
     * (positive values are rounded towards zero and negative values are rounded away from 0). 
     */
    function conservativePreciseMul(int256 a, int256 b) internal pure returns (int256) {
        return divDown(a.mul(b), PRECISE_UNIT_INT);
    }

    /**
     * @dev Divides value a by value b where rounding is towards the lesser number. 
     * (positive values are rounded towards zero and negative values are rounded away from 0). 
     */
    function conservativePreciseDiv(int256 a, int256 b) internal pure returns (int256) {
        return divDown(a.mul(PRECISE_UNIT_INT), b);
    }

    /**
    * @dev Performs the power on a specified value, reverts on overflow.
    */
    function safePower(
        uint256 a,
        uint256 pow
    )
        internal
        pure
        returns (uint256)
    {
        require(a > 0, "Value must be positive");

        uint256 result = 1;
        for (uint256 i = 0; i < pow; i++){
            uint256 previousResult = result;

            // Using safemath multiplication prevents overflows
            result = previousResult.mul(a);
        }

        return result;
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title SignedSafeMath
 * @dev Signed math operations with safety checks that revert on error.
 */
library SignedSafeMath {
    int256 constant private _INT256_MIN = -2**255;

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

        require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");

        int256 c = a * b;
        require(c / a == b, "SignedSafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two signed integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "SignedSafeMath: division by zero");
        require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");

        int256 c = a / b;

        return c;
    }

    /**
     * @dev Returns the subtraction of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a - b;
        require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");

        return c;
    }

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

        return c;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"contract IController","name":"_setController","type":"address"},{"internalType":"address","name":"_swapTarget","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInputToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountSetIssued","type":"uint256"}],"name":"ExchangeIssue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountSetRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOutputToken","type":"uint256"}],"name":"ExchangeRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_issuanceModule","type":"address"}],"name":"approveSetToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"},{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"}],"name":"getRequiredIssuanceComponents","outputs":[{"internalType":"address[]","name":"components","type":"address[]"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"},{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"}],"name":"getRequiredRedemptionComponents","outputs":[{"internalType":"address[]","name":"components","type":"address[]"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"issueExactSetFromETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_maxAmountInputToken","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"issueExactSetFromToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minEthReceive","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"redeemExactSetForETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"_amountSetToken","type":"uint256"},{"internalType":"uint256","name":"_minOutputReceive","type":"uint256"},{"internalType":"bytes[]","name":"_componentQuotes","type":"bytes[]"},{"internalType":"address","name":"_issuanceModule","type":"address"},{"internalType":"bool","name":"_isDebtIssuance","type":"bool"}],"name":"redeemExactSetForToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setController","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTarget","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b5060405162003105380380620031058339810160408190526200003491620000c2565b6000620000496001600160e01b03620000be16565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180556001600160601b0319606092831b811660a05292821b8316608052901b1660c0526200012e565b3390565b600080600060608486031215620000d7578283fd5b8351620000e48162000115565b6020850151909350620000f78162000115565b60408501519092506200010a8162000115565b809150509250925092565b6001600160a01b03811681146200012b57600080fd5b50565b60805160601c60a05160601c60c05160601c612f51620001b4600039806106b65280610a99528061120b5280611bcc5280611fa952508061036d52806105b75280610abd5280610ae45280610e2952806110765250806101125280610d3c5280610f1d5280610f7c528061117352806111ea528061123a52806113185250612f516000f3fe6080604052600436106101025760003560e01c80638da5cb5b11610095578063b50452b211610064578063b50452b2146102c1578063bb4cee01146102e1578063c132e27f14610301578063c224337914610314578063f2fde38b146103345761015a565b80638da5cb5b146102625780639b8862ec14610277578063a734f06e14610297578063ad5c4648146102ac5761015a565b8063715018a6116100d1578063715018a6146101f65780637e7f0cde1461020b5780638b2704ec1461022d5780638cd6944a146102425761015a565b806303105b041461015f5780630e8cc7051461017f5780635590febd146101925780636b211d8f146101c85761015a565b3661015a57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101585760405162461bcd60e51b815260040161014f9061295c565b60405180910390fd5b005b600080fd5b34801561016b57600080fd5b5061015861017a36600461259c565b610354565b61015861018d36600461252b565b610420565b34801561019e57600080fd5b506101b26101ad3660046125d4565b6105b2565b6040516101bf9190612e6b565b60405180910390f35b3480156101d457600080fd5b506101e86101e33660046123bb565b6107e2565b6040516101bf92919061282c565b34801561020257600080fd5b50610158610a0e565b34801561021757600080fd5b50610220610a97565b6040516101bf91906127c1565b34801561023957600080fd5b50610220610abb565b34801561024e57600080fd5b506101b261025d3660046125d4565b610adf565b34801561026e57600080fd5b50610220610c69565b34801561028357600080fd5b5061015861029236600461259c565b610c78565b3480156102a357600080fd5b50610220610d22565b3480156102b857600080fd5b50610220610d3a565b3480156102cd57600080fd5b506101e86102dc3660046123bb565b610d5e565b3480156102ed57600080fd5b506101b26102fc3660046126ee565b610e24565b6101b261030f36600461266f565b611071565b34801561032057600080fd5b5061015861032f36600461252b565b6113f5565b34801561034057600080fd5b5061015861034f36600461239f565b611432565b6040516342f6e38960e01b815281906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342f6e389906103a29084906004016127c1565b60206040518083038186803b1580156103ba57600080fd5b505afa1580156103ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f29190612580565b61040e5760405162461bcd60e51b815260040161014f90612aba565b61041b83836000196114f2565b505050565b610428611598565b6001600160a01b0316610439610c69565b6001600160a01b03161461045f5760405162461bcd60e51b815260040161014f90612c7b565b60005b828110156105ac5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061048b57fe5b90506020020160208101906104a0919061239f565b6001600160a01b031614156104cd576104c86001600160a01b0383164763ffffffff61159c16565b6105a4565b6105a4828585848181106104dd57fe5b90506020020160208101906104f2919061239f565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161051d91906127c1565b60206040518083038186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056d9190612775565b86868581811061057957fe5b905060200201602081019061058e919061239f565b6001600160a01b0316919063ffffffff61163816565b600101610462565b50505050565b6000827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166342f6e389826040518263ffffffff1660e01b815260040161060191906127c1565b60206040518083038186803b15801561061957600080fd5b505afa15801561062d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106519190612580565b61066d5760405162461bcd60e51b815260040161014f90612aba565b600260015414156106905760405162461bcd60e51b815260040161014f90612e34565b60026001556106b06001600160a01b03891633308963ffffffff61168e16565b6106db887f0000000000000000000000000000000000000000000000000000000000000000886114f2565b60006106eb8a89888c89896116af565b90508681111561070d5760405162461bcd60e51b815260040161014f90612cf4565b6040516336bc7a3d60e11b81526001600160a01b03861690636d78f47a9061073d908d908c9033906004016128ba565b600060405180830381600087803b15801561075757600080fd5b505af115801561076b573d6000803e3d6000fd5b5050505061077a8988836119c4565b886001600160a01b03168a6001600160a01b0316336001600160a01b03167f44b3b16472a909f781f712646232271ffd156fff642d4895b700146a404626018a8c6040516107c9929190612e74565b60405180910390a4600180559998505050505050505050565b6060808415610878576040516335c729db60e11b81526001600160a01b03871690636b8e53b6906108199087908790600401612813565b60006040518083038186803b15801561083157600080fd5b505afa158015610845573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261086d91908101906124a7565b509092509050610a05565b836001600160a01b03166399d50d5d6040518163ffffffff1660e01b815260040160006040518083038186803b1580156108b157600080fd5b505afa1580156108c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108ed919081019061240b565b9150815167ffffffffffffffff8111801561090757600080fd5b50604051908082528060200260200182016040528015610931578160200160208202803683370190505b50905060005b8251811015610a03576000856001600160a01b03166366cb8d2f85848151811061095d57fe5b60200260200101516040518263ffffffff1660e01b815260040161098191906127c1565b60206040518083038186803b15801561099957600080fd5b505afa1580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d19190612775565b90506109e3818663ffffffff6119f816565b8383815181106109ef57fe5b602090810291909101015250600101610937565b505b94509492505050565b610a16611598565b6001600160a01b0316610a27610c69565b6001600160a01b031614610a4d5760405162461bcd60e51b815260040161014f90612c7b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166342f6e389826040518263ffffffff1660e01b8152600401610b2e91906127c1565b60206040518083038186803b158015610b4657600080fd5b505afa158015610b5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7e9190612580565b610b9a5760405162461bcd60e51b815260040161014f90612aba565b60026001541415610bbd5760405162461bcd60e51b815260040161014f90612e34565b60026001556000610bcf8a8987611a2b565b50610bde8a89888c8989611ab1565b905086811015610c005760405162461bcd60e51b815260040161014f90612910565b610c1a6001600160a01b038a16338363ffffffff61163816565b886001600160a01b03168a6001600160a01b0316336001600160a01b03167f9f8f1a845f52c0a7086f16f355a092a5acf0cca219c831409b9e5b1c39af9f9f8b856040516107c9929190612e74565b6000546001600160a01b031690565b6060826001600160a01b03166399d50d5d6040518163ffffffff1660e01b815260040160006040518083038186803b158015610cb357600080fd5b505afa158015610cc7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cef919081019061240b565b905060005b81518110156105ac57610d1a828281518110610d0c57fe5b602002602001015184610354565b600101610cf4565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b7f000000000000000000000000000000000000000000000000000000000000000081565b6060808415610d955760405163131e26b960e01b81526001600160a01b0387169063131e26b9906108199087908790600401612813565b604051637a4ffd0360e01b81526001600160a01b03871690637a4ffd0390610dc39087908790600401612813565b60006040518083038186803b158015610ddb57600080fd5b505afa158015610def573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e179190810190612446565b9097909650945050505050565b6000827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166342f6e389826040518263ffffffff1660e01b8152600401610e7391906127c1565b60206040518083038186803b158015610e8b57600080fd5b505afa158015610e9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec39190612580565b610edf5760405162461bcd60e51b815260040161014f90612aba565b60026001541415610f025760405162461bcd60e51b815260040161014f90612e34565b6002600155610f12888886611a2b565b506000610f438989887f00000000000000000000000000000000000000000000000000000000000000008989611ab1565b905086811015610f655760405162461bcd60e51b815260040161014f90612bee565b604051632e1a7d4d60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632e1a7d4d90610fb1908490600401612e6b565b600060405180830381600087803b158015610fcb57600080fd5b505af1158015610fdf573d6000803e3d6000fd5b50610ff6925033915083905063ffffffff61159c16565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316896001600160a01b0316336001600160a01b03167f9f8f1a845f52c0a7086f16f355a092a5acf0cca219c831409b9e5b1c39af9f9f8b85604051611059929190612e74565b60405180910390a46001805598975050505050505050565b6000827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166342f6e389826040518263ffffffff1660e01b81526004016110c091906127c1565b60206040518083038186803b1580156110d857600080fd5b505afa1580156110ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111109190612580565b61112c5760405162461bcd60e51b815260040161014f90612aba565b6002600154141561114f5760405162461bcd60e51b815260040161014f90612e34565b6002600155346111715760405162461bcd60e51b815260040161014f90612d6c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111cc57600080fd5b505af11580156111e0573d6000803e3d6000fd5b50505050506112307f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000346114f2565b60006112608888887f000000000000000000000000000000000000000000000000000000000000000089896116af565b9050348111156112825760405162461bcd60e51b815260040161014f90612bb7565b6040516336bc7a3d60e11b81526001600160a01b03861690636d78f47a906112b2908b908b9033906004016128ba565b600060405180830381600087803b1580156112cc57600080fd5b505af11580156112e0573d6000803e3d6000fd5b5050505060006112f98234611e1690919063ffffffff16565b9050801561139257604051632e1a7d4d60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632e1a7d4d9061134d908490600401612e6b565b600060405180830381600087803b15801561136757600080fd5b505af115801561137b573d6000803e3d6000fd5b50611392925033915083905063ffffffff61159c16565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316896001600160a01b0316336001600160a01b03167f44b3b16472a909f781f712646232271ffd156fff642d4895b700146a40462601858c604051611059929190612e74565b60005b828110156105ac5761142a84848381811061140f57fe5b9050602002016020810190611424919061239f565b83610354565b6001016113f8565b61143a611598565b6001600160a01b031661144b610c69565b6001600160a01b0316146114715760405162461bcd60e51b815260040161014f90612c7b565b6001600160a01b0381166114975760405162461bcd60e51b815260040161014f906129a9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b604051636eb1769f60e11b81526000906001600160a01b0385169063dd62ed3e9061152390309087906004016127d5565b60206040518083038186803b15801561153b57600080fd5b505afa15801561154f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115739190612775565b9050818110156105ac576105ac6001600160a01b03851684831963ffffffff611e3e16565b3390565b804710156115bc5760405162461bcd60e51b815260040161014f90612b03565b6000826001600160a01b0316826040516115d5906127be565b60006040518083038185875af1925050503d8060008114611612576040519150601f19603f3d011682016040523d82523d6000602084013e611617565b606091505b505090508061041b5760405162461bcd60e51b815260040161014f90612a5d565b61041b8363a9059cbb60e01b8484604051602401611657929190612813565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611eef565b6105ac846323b872dd60e01b858585604051602401611657939291906127ef565b6000806060806116c186868c8c610d5e565b915091506000876001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016116f391906127c1565b60206040518083038186803b15801561170b57600080fd5b505afa15801561171f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117439190612775565b905060005b835181101561191257600084828151811061175f57fe5b60200260200101519050600084838151811061177757fe5b602002602001015190508a6001600160a01b0316826001600160a01b031614156117b5576117ab888263ffffffff611f7e16565b9750809650611908565b6040516370a0823160e01b81526000906001600160a01b038416906370a08231906117e49030906004016127c1565b60206040518083038186803b1580156117fc57600080fd5b505afa158015611810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118349190612775565b90506118528d858151811061184557fe5b6020026020010151611fa3565b6040516370a0823160e01b81526000906001600160a01b038516906370a08231906118819030906004016127c1565b60206040518083038186803b15801561189957600080fd5b505afa1580156118ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d19190612775565b90506118e3818363ffffffff611e1616565b9850828910156119055760405162461bcd60e51b815260040161014f90612da3565b50505b5050600101611748565b506040516370a0823160e01b81526000906001600160a01b038a16906370a08231906119429030906004016127c1565b60206040518083038186803b15801561195a57600080fd5b505afa15801561196e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119929190612775565b90506119b46119a7838363ffffffff611e1616565b879063ffffffff611f7e16565b9c9b505050505050505050505050565b60006119d6838363ffffffff611e1616565b905080156105ac576105ac6001600160a01b038516338363ffffffff61163816565b6000611a22670de0b6b3a7640000611a16858563ffffffff61203e16565b9063ffffffff61207816565b90505b92915050565b6000611a486001600160a01b03851633308663ffffffff61168e16565b604051635c833bfd60e01b81526001600160a01b03831690635c833bfd90611a78908790879030906004016128ba565b600060405180830381600087803b158015611a9257600080fd5b505af1158015611aa6573d6000803e3d6000fd5b505050509392505050565b6000606080611ac285858b8b6107e2565b915091506000866001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611af491906127c1565b60206040518083038186803b158015611b0c57600080fd5b505afa158015611b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b449190612775565b905060005b8851811015611d65576000838281518110611b6057fe5b602002602001015190506000896001600160a01b0316868481518110611b8257fe5b60200260200101516001600160a01b03161415611bb357611ba9878363ffffffff611f7e16565b9650819050611d5b565b611bf1868481518110611bc257fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000846114f2565b6000868481518110611bff57fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611c3291906127c1565b60206040518083038186803b158015611c4a57600080fd5b505afa158015611c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c829190612775565b9050611c938c858151811061184557fe5b6000878581518110611ca157fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611cd491906127c1565b60206040518083038186803b158015611cec57600080fd5b505afa158015611d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d249190612775565b9050611d36828263ffffffff611e1616565b925082841015611d585760405162461bcd60e51b815260040161014f90612cb0565b50505b5050600101611b49565b506040516370a0823160e01b81526000906001600160a01b038916906370a0823190611d959030906004016127c1565b60206040518083038186803b158015611dad57600080fd5b505afa158015611dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de59190612775565b9050611e07611dfa828463ffffffff611e1616565b869063ffffffff611f7e16565b9b9a5050505050505050505050565b600082821115611e385760405162461bcd60e51b815260040161014f90612a26565b50900390565b6000611ece82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b8152600401611e729291906127d5565b60206040518083038186803b158015611e8a57600080fd5b505afa158015611e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec29190612775565b9063ffffffff611f7e16565b90506105ac8463095ea7b360e01b8584604051602401611657929190612813565b6060611f44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120aa9092919063ffffffff16565b80519091501561041b5780806020019051810190611f629190612580565b61041b5760405162461bcd60e51b815260040161014f90612dea565b600082820183811015611a225760405162461bcd60e51b815260040161014f906129ef565b600060607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031683604051611fdf91906127a2565b6000604051808303816000865af19150503d806000811461201c576040519150601f19603f3d011682016040523d82523d6000602084013e612021565b606091505b50915091508161041b57805161203657600080fd5b805181602001fd5b60008261204d57506000611a25565b8282028284828161205a57fe5b0414611a225760405162461bcd60e51b815260040161014f90612c3a565b60008082116120995760405162461bcd60e51b815260040161014f90612b80565b8183816120a257fe5b049392505050565b60606120b984846000856120c3565b90505b9392505050565b6060824710156120e55760405162461bcd60e51b815260040161014f90612b3a565b6120ee85612184565b61210a5760405162461bcd60e51b815260040161014f90612d35565b60006060866001600160a01b0316858760405161212791906127a2565b60006040518083038185875af1925050503d8060008114612164576040519150601f19603f3d011682016040523d82523d6000602084013e612169565b606091505b509150915061217982828661218a565b979650505050505050565b3b151590565b606083156121995750816120bc565b8251156121a95782518084602001fd5b8160405162461bcd60e51b815260040161014f91906128dd565b600082601f8301126121d3578081fd5b81516121e66121e182612ea9565b612e82565b81815291506020808301908481018184028601820187101561220757600080fd5b60005b8481101561222f57815161221d81612ef5565b8452928201929082019060010161220a565b505050505092915050565b6000601f838184011261224b578182fd5b82356122596121e182612ea9565b818152925060208084019085810160005b848110156122ec578135880189603f82011261228557600080fd5b8381013567ffffffffffffffff81111561229e57600080fd5b6122af818901601f19168601612e82565b81815260408c818486010111156122c557600080fd5b8281850188840137506000918101860191909152855250928201929082019060010161226a565b50505050505092915050565b60008083601f840112612309578182fd5b50813567ffffffffffffffff811115612320578182fd5b602083019150836020808302850101111561233a57600080fd5b9250929050565b600082601f830112612351578081fd5b815161235f6121e182612ea9565b81815291506020808301908481018184028601820187101561238057600080fd5b60005b8481101561222f57815184529282019290820190600101612383565b6000602082840312156123b0578081fd5b8135611a2281612ef5565b600080600080608085870312156123d0578283fd5b84356123db81612ef5565b935060208501356123eb81612f0d565b925060408501356123fb81612ef5565b9396929550929360600135925050565b60006020828403121561241c578081fd5b815167ffffffffffffffff811115612432578182fd5b61243e848285016121c3565b949350505050565b60008060408385031215612458578182fd5b825167ffffffffffffffff8082111561246f578384fd5b61247b868387016121c3565b93506020850151915080821115612490578283fd5b5061249d85828601612341565b9150509250929050565b6000806000606084860312156124bb578283fd5b835167ffffffffffffffff808211156124d2578485fd5b6124de878388016121c3565b945060208601519150808211156124f3578384fd5b6124ff87838801612341565b93506040860151915080821115612514578283fd5b5061252186828701612341565b9150509250925092565b60008060006040848603121561253f578283fd5b833567ffffffffffffffff811115612555578384fd5b612561868287016122f8565b909450925050602084013561257581612ef5565b809150509250925092565b600060208284031215612591578081fd5b8151611a2281612f0d565b600080604083850312156125ae578182fd5b82356125b981612ef5565b915060208301356125c981612ef5565b809150509250929050565b600080600080600080600060e0888a0312156125ee578485fd5b87356125f981612ef5565b9650602088013561260981612ef5565b95506040880135945060608801359350608088013567ffffffffffffffff811115612632578384fd5b61263e8a828b0161223a565b93505060a088013561264f81612ef5565b915060c088013561265f81612f0d565b8091505092959891949750929550565b600080600080600060a08688031215612686578283fd5b853561269181612ef5565b945060208601359350604086013567ffffffffffffffff8111156126b3578384fd5b6126bf8882890161223a565b93505060608601356126d081612ef5565b915060808601356126e081612f0d565b809150509295509295909350565b60008060008060008060c08789031215612706578384fd5b863561271181612ef5565b95506020870135945060408701359350606087013567ffffffffffffffff81111561273a578283fd5b61274689828a0161223a565b935050608087013561275781612ef5565b915060a087013561276781612f0d565b809150509295509295509295565b600060208284031215612786578081fd5b5051919050565b815260200190565b6001600160a01b03169052565b600082516127b4818460208701612ec9565b9190910192915050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b604080825283519082018190526000906020906060840190828701845b8281101561286c5761285c848351612795565b9284019290840190600101612849565b505050838103828501528085516128838184612e6b565b91508387019250845b818110156128ad5761289f83855161278d565b93850193925060010161288c565b5090979650505050505050565b6001600160a01b0393841681526020810192909252909116604082015260600190565b60006020825282518060208401526128fc816040850160208701612ec9565b601f01601f19169190910160400192915050565b6020808252602c908201527f45786368616e676549737375616e63653a20494e53554646494349454e54204f60408201526b155514155508105353d5539560a21b606082015260800190565b6020808252602d908201527f45786368616e676549737375616e63653a20446972656374206465706f73697460408201526c1cc81b9bdd08185b1b1bddd959609a1b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b60208082526029908201527f45786368616e676549737375616e63653a20494e56414c49442049535355414e6040820152684345204d4f44554c4560b81b606082015260800190565b6020808252601d908201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252601f908201527f45786368616e676549737375616e63653a204f5645525350454e542045544800604082015260600190565b6020808252602c908201527f45786368616e676549737375616e63653a20494e53554646494349454e54205760408201526b11551208149150d15255915160a21b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526024908201527f45786368616e676549737375616e63653a204f564552534f4c4420434f4d504f6040820152631391539560e21b606082015260800190565b60208082526021908201527f45786368616e676549737375616e63653a204f5645525350454e5420544f4b456040820152602760f91b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601d908201527f45786368616e676549737375616e63653a204e4f204554482053454e54000000604082015260600190565b60208082526027908201527f45786368616e676549737375616e63653a20554e444552424f5547485420434f604082015266135413d391539560ca1b606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715612ea157600080fd5b604052919050565b600067ffffffffffffffff821115612ebf578081fd5b5060209081020190565b60005b83811015612ee4578181015183820152602001612ecc565b838111156105ac5750506000910152565b6001600160a01b0381168114612f0a57600080fd5b50565b8015158114612f0a57600080fdfea2646970667358221220e70f1e22a39fb36f4cca1a4e425647ac9d48478f9dba4bf9797c8852a2943a5264736f6c634300060a0033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a349000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff

Deployed Bytecode

0x6080604052600436106101025760003560e01c80638da5cb5b11610095578063b50452b211610064578063b50452b2146102c1578063bb4cee01146102e1578063c132e27f14610301578063c224337914610314578063f2fde38b146103345761015a565b80638da5cb5b146102625780639b8862ec14610277578063a734f06e14610297578063ad5c4648146102ac5761015a565b8063715018a6116100d1578063715018a6146101f65780637e7f0cde1461020b5780638b2704ec1461022d5780638cd6944a146102425761015a565b806303105b041461015f5780630e8cc7051461017f5780635590febd146101925780636b211d8f146101c85761015a565b3661015a57336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146101585760405162461bcd60e51b815260040161014f9061295c565b60405180910390fd5b005b600080fd5b34801561016b57600080fd5b5061015861017a36600461259c565b610354565b61015861018d36600461252b565b610420565b34801561019e57600080fd5b506101b26101ad3660046125d4565b6105b2565b6040516101bf9190612e6b565b60405180910390f35b3480156101d457600080fd5b506101e86101e33660046123bb565b6107e2565b6040516101bf92919061282c565b34801561020257600080fd5b50610158610a0e565b34801561021757600080fd5b50610220610a97565b6040516101bf91906127c1565b34801561023957600080fd5b50610220610abb565b34801561024e57600080fd5b506101b261025d3660046125d4565b610adf565b34801561026e57600080fd5b50610220610c69565b34801561028357600080fd5b5061015861029236600461259c565b610c78565b3480156102a357600080fd5b50610220610d22565b3480156102b857600080fd5b50610220610d3a565b3480156102cd57600080fd5b506101e86102dc3660046123bb565b610d5e565b3480156102ed57600080fd5b506101b26102fc3660046126ee565b610e24565b6101b261030f36600461266f565b611071565b34801561032057600080fd5b5061015861032f36600461252b565b6113f5565b34801561034057600080fd5b5061015861034f36600461239f565b611432565b6040516342f6e38960e01b815281906001600160a01b037f000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a34916906342f6e389906103a29084906004016127c1565b60206040518083038186803b1580156103ba57600080fd5b505afa1580156103ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f29190612580565b61040e5760405162461bcd60e51b815260040161014f90612aba565b61041b83836000196114f2565b505050565b610428611598565b6001600160a01b0316610439610c69565b6001600160a01b03161461045f5760405162461bcd60e51b815260040161014f90612c7b565b60005b828110156105ac5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061048b57fe5b90506020020160208101906104a0919061239f565b6001600160a01b031614156104cd576104c86001600160a01b0383164763ffffffff61159c16565b6105a4565b6105a4828585848181106104dd57fe5b90506020020160208101906104f2919061239f565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161051d91906127c1565b60206040518083038186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056d9190612775565b86868581811061057957fe5b905060200201602081019061058e919061239f565b6001600160a01b0316919063ffffffff61163816565b600101610462565b50505050565b6000827f000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a3496001600160a01b03166342f6e389826040518263ffffffff1660e01b815260040161060191906127c1565b60206040518083038186803b15801561061957600080fd5b505afa15801561062d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106519190612580565b61066d5760405162461bcd60e51b815260040161014f90612aba565b600260015414156106905760405162461bcd60e51b815260040161014f90612e34565b60026001556106b06001600160a01b03891633308963ffffffff61168e16565b6106db887f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff886114f2565b60006106eb8a89888c89896116af565b90508681111561070d5760405162461bcd60e51b815260040161014f90612cf4565b6040516336bc7a3d60e11b81526001600160a01b03861690636d78f47a9061073d908d908c9033906004016128ba565b600060405180830381600087803b15801561075757600080fd5b505af115801561076b573d6000803e3d6000fd5b5050505061077a8988836119c4565b886001600160a01b03168a6001600160a01b0316336001600160a01b03167f44b3b16472a909f781f712646232271ffd156fff642d4895b700146a404626018a8c6040516107c9929190612e74565b60405180910390a4600180559998505050505050505050565b6060808415610878576040516335c729db60e11b81526001600160a01b03871690636b8e53b6906108199087908790600401612813565b60006040518083038186803b15801561083157600080fd5b505afa158015610845573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261086d91908101906124a7565b509092509050610a05565b836001600160a01b03166399d50d5d6040518163ffffffff1660e01b815260040160006040518083038186803b1580156108b157600080fd5b505afa1580156108c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108ed919081019061240b565b9150815167ffffffffffffffff8111801561090757600080fd5b50604051908082528060200260200182016040528015610931578160200160208202803683370190505b50905060005b8251811015610a03576000856001600160a01b03166366cb8d2f85848151811061095d57fe5b60200260200101516040518263ffffffff1660e01b815260040161098191906127c1565b60206040518083038186803b15801561099957600080fd5b505afa1580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d19190612775565b90506109e3818663ffffffff6119f816565b8383815181106109ef57fe5b602090810291909101015250600101610937565b505b94509492505050565b610a16611598565b6001600160a01b0316610a27610c69565b6001600160a01b031614610a4d5760405162461bcd60e51b815260040161014f90612c7b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b7f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff81565b7f000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a34981565b6000827f000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a3496001600160a01b03166342f6e389826040518263ffffffff1660e01b8152600401610b2e91906127c1565b60206040518083038186803b158015610b4657600080fd5b505afa158015610b5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7e9190612580565b610b9a5760405162461bcd60e51b815260040161014f90612aba565b60026001541415610bbd5760405162461bcd60e51b815260040161014f90612e34565b60026001556000610bcf8a8987611a2b565b50610bde8a89888c8989611ab1565b905086811015610c005760405162461bcd60e51b815260040161014f90612910565b610c1a6001600160a01b038a16338363ffffffff61163816565b886001600160a01b03168a6001600160a01b0316336001600160a01b03167f9f8f1a845f52c0a7086f16f355a092a5acf0cca219c831409b9e5b1c39af9f9f8b856040516107c9929190612e74565b6000546001600160a01b031690565b6060826001600160a01b03166399d50d5d6040518163ffffffff1660e01b815260040160006040518083038186803b158015610cb357600080fd5b505afa158015610cc7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cef919081019061240b565b905060005b81518110156105ac57610d1a828281518110610d0c57fe5b602002602001015184610354565b600101610cf4565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6060808415610d955760405163131e26b960e01b81526001600160a01b0387169063131e26b9906108199087908790600401612813565b604051637a4ffd0360e01b81526001600160a01b03871690637a4ffd0390610dc39087908790600401612813565b60006040518083038186803b158015610ddb57600080fd5b505afa158015610def573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e179190810190612446565b9097909650945050505050565b6000827f000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a3496001600160a01b03166342f6e389826040518263ffffffff1660e01b8152600401610e7391906127c1565b60206040518083038186803b158015610e8b57600080fd5b505afa158015610e9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec39190612580565b610edf5760405162461bcd60e51b815260040161014f90612aba565b60026001541415610f025760405162461bcd60e51b815260040161014f90612e34565b6002600155610f12888886611a2b565b506000610f438989887f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28989611ab1565b905086811015610f655760405162461bcd60e51b815260040161014f90612bee565b604051632e1a7d4d60e01b81526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21690632e1a7d4d90610fb1908490600401612e6b565b600060405180830381600087803b158015610fcb57600080fd5b505af1158015610fdf573d6000803e3d6000fd5b50610ff6925033915083905063ffffffff61159c16565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316896001600160a01b0316336001600160a01b03167f9f8f1a845f52c0a7086f16f355a092a5acf0cca219c831409b9e5b1c39af9f9f8b85604051611059929190612e74565b60405180910390a46001805598975050505050505050565b6000827f000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a3496001600160a01b03166342f6e389826040518263ffffffff1660e01b81526004016110c091906127c1565b60206040518083038186803b1580156110d857600080fd5b505afa1580156110ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111109190612580565b61112c5760405162461bcd60e51b815260040161014f90612aba565b6002600154141561114f5760405162461bcd60e51b815260040161014f90612e34565b6002600155346111715760405162461bcd60e51b815260040161014f90612d6c565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111cc57600080fd5b505af11580156111e0573d6000803e3d6000fd5b50505050506112307f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc27f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff346114f2565b60006112608888887f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc289896116af565b9050348111156112825760405162461bcd60e51b815260040161014f90612bb7565b6040516336bc7a3d60e11b81526001600160a01b03861690636d78f47a906112b2908b908b9033906004016128ba565b600060405180830381600087803b1580156112cc57600080fd5b505af11580156112e0573d6000803e3d6000fd5b5050505060006112f98234611e1690919063ffffffff16565b9050801561139257604051632e1a7d4d60e01b81526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21690632e1a7d4d9061134d908490600401612e6b565b600060405180830381600087803b15801561136757600080fd5b505af115801561137b573d6000803e3d6000fd5b50611392925033915083905063ffffffff61159c16565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316896001600160a01b0316336001600160a01b03167f44b3b16472a909f781f712646232271ffd156fff642d4895b700146a40462601858c604051611059929190612e74565b60005b828110156105ac5761142a84848381811061140f57fe5b9050602002016020810190611424919061239f565b83610354565b6001016113f8565b61143a611598565b6001600160a01b031661144b610c69565b6001600160a01b0316146114715760405162461bcd60e51b815260040161014f90612c7b565b6001600160a01b0381166114975760405162461bcd60e51b815260040161014f906129a9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b604051636eb1769f60e11b81526000906001600160a01b0385169063dd62ed3e9061152390309087906004016127d5565b60206040518083038186803b15801561153b57600080fd5b505afa15801561154f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115739190612775565b9050818110156105ac576105ac6001600160a01b03851684831963ffffffff611e3e16565b3390565b804710156115bc5760405162461bcd60e51b815260040161014f90612b03565b6000826001600160a01b0316826040516115d5906127be565b60006040518083038185875af1925050503d8060008114611612576040519150601f19603f3d011682016040523d82523d6000602084013e611617565b606091505b505090508061041b5760405162461bcd60e51b815260040161014f90612a5d565b61041b8363a9059cbb60e01b8484604051602401611657929190612813565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611eef565b6105ac846323b872dd60e01b858585604051602401611657939291906127ef565b6000806060806116c186868c8c610d5e565b915091506000876001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016116f391906127c1565b60206040518083038186803b15801561170b57600080fd5b505afa15801561171f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117439190612775565b905060005b835181101561191257600084828151811061175f57fe5b60200260200101519050600084838151811061177757fe5b602002602001015190508a6001600160a01b0316826001600160a01b031614156117b5576117ab888263ffffffff611f7e16565b9750809650611908565b6040516370a0823160e01b81526000906001600160a01b038416906370a08231906117e49030906004016127c1565b60206040518083038186803b1580156117fc57600080fd5b505afa158015611810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118349190612775565b90506118528d858151811061184557fe5b6020026020010151611fa3565b6040516370a0823160e01b81526000906001600160a01b038516906370a08231906118819030906004016127c1565b60206040518083038186803b15801561189957600080fd5b505afa1580156118ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d19190612775565b90506118e3818363ffffffff611e1616565b9850828910156119055760405162461bcd60e51b815260040161014f90612da3565b50505b5050600101611748565b506040516370a0823160e01b81526000906001600160a01b038a16906370a08231906119429030906004016127c1565b60206040518083038186803b15801561195a57600080fd5b505afa15801561196e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119929190612775565b90506119b46119a7838363ffffffff611e1616565b879063ffffffff611f7e16565b9c9b505050505050505050505050565b60006119d6838363ffffffff611e1616565b905080156105ac576105ac6001600160a01b038516338363ffffffff61163816565b6000611a22670de0b6b3a7640000611a16858563ffffffff61203e16565b9063ffffffff61207816565b90505b92915050565b6000611a486001600160a01b03851633308663ffffffff61168e16565b604051635c833bfd60e01b81526001600160a01b03831690635c833bfd90611a78908790879030906004016128ba565b600060405180830381600087803b158015611a9257600080fd5b505af1158015611aa6573d6000803e3d6000fd5b505050509392505050565b6000606080611ac285858b8b6107e2565b915091506000866001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611af491906127c1565b60206040518083038186803b158015611b0c57600080fd5b505afa158015611b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b449190612775565b905060005b8851811015611d65576000838281518110611b6057fe5b602002602001015190506000896001600160a01b0316868481518110611b8257fe5b60200260200101516001600160a01b03161415611bb357611ba9878363ffffffff611f7e16565b9650819050611d5b565b611bf1868481518110611bc257fe5b60200260200101517f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff846114f2565b6000868481518110611bff57fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611c3291906127c1565b60206040518083038186803b158015611c4a57600080fd5b505afa158015611c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c829190612775565b9050611c938c858151811061184557fe5b6000878581518110611ca157fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611cd491906127c1565b60206040518083038186803b158015611cec57600080fd5b505afa158015611d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d249190612775565b9050611d36828263ffffffff611e1616565b925082841015611d585760405162461bcd60e51b815260040161014f90612cb0565b50505b5050600101611b49565b506040516370a0823160e01b81526000906001600160a01b038916906370a0823190611d959030906004016127c1565b60206040518083038186803b158015611dad57600080fd5b505afa158015611dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de59190612775565b9050611e07611dfa828463ffffffff611e1616565b869063ffffffff611f7e16565b9b9a5050505050505050505050565b600082821115611e385760405162461bcd60e51b815260040161014f90612a26565b50900390565b6000611ece82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b8152600401611e729291906127d5565b60206040518083038186803b158015611e8a57600080fd5b505afa158015611e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec29190612775565b9063ffffffff611f7e16565b90506105ac8463095ea7b360e01b8584604051602401611657929190612813565b6060611f44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120aa9092919063ffffffff16565b80519091501561041b5780806020019051810190611f629190612580565b61041b5760405162461bcd60e51b815260040161014f90612dea565b600082820183811015611a225760405162461bcd60e51b815260040161014f906129ef565b600060607f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff6001600160a01b031683604051611fdf91906127a2565b6000604051808303816000865af19150503d806000811461201c576040519150601f19603f3d011682016040523d82523d6000602084013e612021565b606091505b50915091508161041b57805161203657600080fd5b805181602001fd5b60008261204d57506000611a25565b8282028284828161205a57fe5b0414611a225760405162461bcd60e51b815260040161014f90612c3a565b60008082116120995760405162461bcd60e51b815260040161014f90612b80565b8183816120a257fe5b049392505050565b60606120b984846000856120c3565b90505b9392505050565b6060824710156120e55760405162461bcd60e51b815260040161014f90612b3a565b6120ee85612184565b61210a5760405162461bcd60e51b815260040161014f90612d35565b60006060866001600160a01b0316858760405161212791906127a2565b60006040518083038185875af1925050503d8060008114612164576040519150601f19603f3d011682016040523d82523d6000602084013e612169565b606091505b509150915061217982828661218a565b979650505050505050565b3b151590565b606083156121995750816120bc565b8251156121a95782518084602001fd5b8160405162461bcd60e51b815260040161014f91906128dd565b600082601f8301126121d3578081fd5b81516121e66121e182612ea9565b612e82565b81815291506020808301908481018184028601820187101561220757600080fd5b60005b8481101561222f57815161221d81612ef5565b8452928201929082019060010161220a565b505050505092915050565b6000601f838184011261224b578182fd5b82356122596121e182612ea9565b818152925060208084019085810160005b848110156122ec578135880189603f82011261228557600080fd5b8381013567ffffffffffffffff81111561229e57600080fd5b6122af818901601f19168601612e82565b81815260408c818486010111156122c557600080fd5b8281850188840137506000918101860191909152855250928201929082019060010161226a565b50505050505092915050565b60008083601f840112612309578182fd5b50813567ffffffffffffffff811115612320578182fd5b602083019150836020808302850101111561233a57600080fd5b9250929050565b600082601f830112612351578081fd5b815161235f6121e182612ea9565b81815291506020808301908481018184028601820187101561238057600080fd5b60005b8481101561222f57815184529282019290820190600101612383565b6000602082840312156123b0578081fd5b8135611a2281612ef5565b600080600080608085870312156123d0578283fd5b84356123db81612ef5565b935060208501356123eb81612f0d565b925060408501356123fb81612ef5565b9396929550929360600135925050565b60006020828403121561241c578081fd5b815167ffffffffffffffff811115612432578182fd5b61243e848285016121c3565b949350505050565b60008060408385031215612458578182fd5b825167ffffffffffffffff8082111561246f578384fd5b61247b868387016121c3565b93506020850151915080821115612490578283fd5b5061249d85828601612341565b9150509250929050565b6000806000606084860312156124bb578283fd5b835167ffffffffffffffff808211156124d2578485fd5b6124de878388016121c3565b945060208601519150808211156124f3578384fd5b6124ff87838801612341565b93506040860151915080821115612514578283fd5b5061252186828701612341565b9150509250925092565b60008060006040848603121561253f578283fd5b833567ffffffffffffffff811115612555578384fd5b612561868287016122f8565b909450925050602084013561257581612ef5565b809150509250925092565b600060208284031215612591578081fd5b8151611a2281612f0d565b600080604083850312156125ae578182fd5b82356125b981612ef5565b915060208301356125c981612ef5565b809150509250929050565b600080600080600080600060e0888a0312156125ee578485fd5b87356125f981612ef5565b9650602088013561260981612ef5565b95506040880135945060608801359350608088013567ffffffffffffffff811115612632578384fd5b61263e8a828b0161223a565b93505060a088013561264f81612ef5565b915060c088013561265f81612f0d565b8091505092959891949750929550565b600080600080600060a08688031215612686578283fd5b853561269181612ef5565b945060208601359350604086013567ffffffffffffffff8111156126b3578384fd5b6126bf8882890161223a565b93505060608601356126d081612ef5565b915060808601356126e081612f0d565b809150509295509295909350565b60008060008060008060c08789031215612706578384fd5b863561271181612ef5565b95506020870135945060408701359350606087013567ffffffffffffffff81111561273a578283fd5b61274689828a0161223a565b935050608087013561275781612ef5565b915060a087013561276781612f0d565b809150509295509295509295565b600060208284031215612786578081fd5b5051919050565b815260200190565b6001600160a01b03169052565b600082516127b4818460208701612ec9565b9190910192915050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b604080825283519082018190526000906020906060840190828701845b8281101561286c5761285c848351612795565b9284019290840190600101612849565b505050838103828501528085516128838184612e6b565b91508387019250845b818110156128ad5761289f83855161278d565b93850193925060010161288c565b5090979650505050505050565b6001600160a01b0393841681526020810192909252909116604082015260600190565b60006020825282518060208401526128fc816040850160208701612ec9565b601f01601f19169190910160400192915050565b6020808252602c908201527f45786368616e676549737375616e63653a20494e53554646494349454e54204f60408201526b155514155508105353d5539560a21b606082015260800190565b6020808252602d908201527f45786368616e676549737375616e63653a20446972656374206465706f73697460408201526c1cc81b9bdd08185b1b1bddd959609a1b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b60208082526029908201527f45786368616e676549737375616e63653a20494e56414c49442049535355414e6040820152684345204d4f44554c4560b81b606082015260800190565b6020808252601d908201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252601f908201527f45786368616e676549737375616e63653a204f5645525350454e542045544800604082015260600190565b6020808252602c908201527f45786368616e676549737375616e63653a20494e53554646494349454e54205760408201526b11551208149150d15255915160a21b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526024908201527f45786368616e676549737375616e63653a204f564552534f4c4420434f4d504f6040820152631391539560e21b606082015260800190565b60208082526021908201527f45786368616e676549737375616e63653a204f5645525350454e5420544f4b456040820152602760f91b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601d908201527f45786368616e676549737375616e63653a204e4f204554482053454e54000000604082015260600190565b60208082526027908201527f45786368616e676549737375616e63653a20554e444552424f5547485420434f604082015266135413d391539560ca1b606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715612ea157600080fd5b604052919050565b600067ffffffffffffffff821115612ebf578081fd5b5060209081020190565b60005b83811015612ee4578181015183820152602001612ecc565b838111156105ac5750506000910152565b6001600160a01b0381168114612f0a57600080fd5b50565b8015158114612f0a57600080fdfea2646970667358221220e70f1e22a39fb36f4cca1a4e425647ac9d48478f9dba4bf9797c8852a2943a5264736f6c634300060a0033

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

000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a349000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff

-----Decoded View---------------
Arg [0] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [1] : _setController (address): 0xa4c8d221d8BB851f83aadd0223a8900A6921A349
Arg [2] : _swapTarget (address): 0xDef1C0ded9bec7F1a1670819833240f027b25EfF

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [1] : 000000000000000000000000a4c8d221d8bb851f83aadd0223a8900a6921a349
Arg [2] : 000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff


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
Chain Token Portfolio % Price Amount Value
ETH5.39%$7.241.6961$12.28
ETH4.67%$0.59704917.7917$10.62
ETH4.17%$1.835.1836$9.49
ETH3.98%$0.0070021,295.0384$9.07
ETH3.87%$1.266.9931$8.81
ETH3.84%$18.7354$8.74
ETH3.74%$78.930.1078$8.51
ETH3.53%$0.50449415.9183$8.03
ETH3.53%$132.530.0606$8.03
ETH3.46%$0.954968.2481$7.88
ETH3.23%$3.911.8784$7.34
ETH3.09%$47.950.1467$7.03
ETH2.99%$0.023269293.0333$6.82
ETH2.98%$1.135.9964$6.78
ETH2.88%$32.020.2047$6.55
ETH2.80%$10.250.6212$6.37
ETH2.62%$15.10.3947$5.96
ETH2.61%$0.22772826.107$5.95
ETH2.48%$0.6758598.3473$5.64
ETH2.31%$1.124.6937$5.26
ETH2.16%$0.5679198.6772$4.93
ETH2.04%$691.080.00671973$4.64
ETH1.96%$0.9419124.7264$4.45
ETH1.88%$0.39585710.7998$4.28
ETH1.87%$8,026.180.0005306$4.26
ETH1.78%$34.090.1192$4.06
ETH1.19%$37.260.0729$2.72
ETH1.13%$0.1052224.4518$2.57
ETH1.13%$10.620.2412$2.56
ETH1.12%$1.331.909$2.54
ETH1.00%$0.08337527.3858$2.28
ETH0.96%$2.50.8732$2.18
ETH0.94%$0.10612220.0732$2.13
ETH0.93%$0.5788463.6515$2.11
ETH0.87%$0.15701812.6072$1.98
ETH0.86%$0.18982610.364$1.97
ETH0.78%$1.661.0694$1.77
ETH0.64%$0.0010411,398.5206$1.46
ETH0.59%$0.3041944.4333$1.35
ETH0.51%$0.4602682.4996$1.15
ETH0.46%$1.490.6995$1.04
ETH0.38%$104.060.00829888$0.8635
ETH0.36%$2.290.3542$0.811
ETH0.35%$0.02904427.4672$0.7977
ETH0.26%$0.1013125.9389$0.6016
ETH0.26%$4.240.1419$0.6014
ETH0.25%$0.002101266.544$0.56
ETH0.22%$0.4204291.1887$0.4997
ETH0.22%$0.2052432.4146$0.4955
ETH0.17%$0.0472098.3423$0.3938
ETH0.13%$0.9983830.2877$0.2872
ETH0.13%$0.2038531.4009$0.2855
ETH0.12%$113,0200.00000247$0.279
ETH0.11%$0.0594574.2627$0.2534
ETH0.10%$0.5526480.4126$0.228
ETH0.10%$0.1421721.5927$0.2264
ETH0.10%$2.730.0828$0.226
ETH0.10%$0.6064750.3642$0.2208
ETH0.09%$1.210.1657$0.20
ETH0.07%$46.760.00361127$0.1688
ETH0.07%$73.840.00223283$0.1648
ETH0.07%$0.0515253.0858$0.1589
ETH0.06%$2,661.110.000054$0.1436
ETH0.06%$1.040.1251$0.1298
ETH0.05%$0.9958460.1153$0.1148
BSC3.16%$0.000009804,828$7.2
POL0.09%$0.4590230.4329$0.198692
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.