Contract 0x9DafBce3367bBc9A70c7120e6E719Ed3f269Bb9E

Contract Overview

Balance:
0 Ether
Txn Hash Method
Block
From
To
Value
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2Reap210780852020-09-22 8:32:04238 days 10 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.130515756761160.247619304
0xee0f05528f5ce2b8edec5f1817f990f16f81ffe5551b492395f977eafb8f85a9Reap210745292020-09-22 4:31:16238 days 14 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.083762429156102.84375
0xaf7e0cae4f93501fc0c930a944aa66c745efb3f9a8084c2599a111c6de4ee746Reap210709582020-09-22 0:31:08238 days 18 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.07634798570495.000000876
0x3eae494d42ed660ad148c8e4eba16109b9fa2f0568bf1413244da79eada7ac5cEngage210704992020-09-22 0:00:12238 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.04820894048783.7125
0x0111784d90e6c80c0a40f3d3cc7851e906778aaccf556b0975b96e8458a70ca1Engage210704702020-09-21 23:58:12238 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.058883372682.9
0x50d579f042e82c65a856e0243b306a9e379ef4a6862b0599b32a6e4fec996962Engage210704232020-09-21 23:55:04238 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.01200861673187.788703355
0x669d1e265f63b98ee37c4d4d87441f942ced433f602621d03ba6a4eac7ea1866Engage210703782020-09-21 23:52:04238 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.01208430329688.342008164
0x071da0b94506caff8108088a57b406121dada8900df30e9edc249844c67a3796Initialize210700992020-09-21 23:33:24238 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e0 Ether0.0014821569
0xbf2a99baa5b2d8cfb280c0a8f821abafcd0657dce70af340364bf5635925ecb50x60806040210700772020-09-21 23:31:56238 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  Contract Creation0 Ether0.0283763259
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xbe53a06dad27bdda66981361504e93cba9e557990 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0x595f8dab94b9c718cbf5c693cd539fd00b286d3d0 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xd0a1e359811322d97991e03f863a0c30c2cf029c0 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0x649c5ffd6e1b67fba819faf0285e6c1dedf808b50 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0x595f8dab94b9c718cbf5c693cd539fd00b286d3d0 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xd0a1e359811322d97991e03f863a0c30c2cf029c0 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xbe53a06dad27bdda66981361504e93cba9e557990 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0x649c5ffd6e1b67fba819faf0285e6c1dedf808b50 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0x649c5ffd6e1b67fba819faf0285e6c1dedf808b50 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0xce23b9f3cd95bff7683d763c9a978d3d99bb72890 Ether
0x3601e230bee24c497e6e9013480837da154524f66061833a2a828587e3b3a8b2210780852020-09-22 8:32:04238 days 10 hrs ago 0x9dafbce3367bbc9a70c7120e6e719ed3f269bb9e 0x595f8dab94b9c718cbf5c693cd539fd00b286d3d0 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x1104C573E3F2455C6a19ba79AB240d18aC4EC22e

Contract Name:
UniswapYieldStrategy

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-09-21
*/

// Dependency file: contracts/interfaces/ISetValuer.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.


*/
// pragma solidity 0.6.10;

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

interface ISetValuer {
    function calculateSetTokenValuation(ISetToken _setToken, address _quoteAsset) external view returns (uint256);
}
// Dependency file: contracts/interfaces/IPriceOracle.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.


*/
// pragma solidity 0.6.10;

/**
 * @title IPriceOracle
 * @author Set Protocol
 *
 * Interface for interacting with PriceOracle
 */
interface IPriceOracle {

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

    function getPrice(address _assetOne, address _assetTwo) external view returns (uint256);
    function masterQuoteAsset() external view returns (address);
}
// Dependency file: contracts/interfaces/IIntegrationRegistry.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.


*/
// pragma solidity 0.6.10;

interface IIntegrationRegistry {
    function addIntegration(address _module, string memory _id, address _wrapper) external;
    function getIntegrationAdapter(address _module, string memory _id) external view returns(address);
    function getIntegrationAdapterWithHash(address _module, bytes32 _id) external view returns(address);
    function isValidIntegration(address _module, string memory _id) external view returns(bool);
}
// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol



// pragma solidity ^0.6.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");
        }
    }
}

// Dependency file: contracts/protocol/lib/ResourceIdentifier.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.


*/

// pragma solidity 0.6.10;

// import { IController } from "../../interfaces/IController.sol";
// import { IIntegrationRegistry } from "../../interfaces/IIntegrationRegistry.sol";
// import { IPriceOracle } from "../../interfaces/IPriceOracle.sol";
// import { ISetValuer } from "../../interfaces/ISetValuer.sol";

/**
 * @title ResourceIdentifier
 * @author Set Protocol
 *
 * A collection of utility functions to fetch information related to Resource contracts in the system
 */
library ResourceIdentifier {

    // IntegrationRegistry will always be resource ID 0 in the system
    uint256 constant internal INTEGRATION_REGISTRY_RESOURCE_ID = 0;
    // PriceOracle will always be resource ID 1 in the system
    uint256 constant internal PRICE_ORACLE_RESOURCE_ID = 1;
    // SetValuer resource will always be resource ID 2 in the system
    uint256 constant internal SET_VALUER_RESOURCE_ID = 2;

    /* ============ Internal ============ */

    /**
     * Gets the instance of integration registry stored on Controller. Note: IntegrationRegistry is stored as index 0 on
     * the Controller
     */
    function getIntegrationRegistry(IController _controller) internal view returns (IIntegrationRegistry) {
        return IIntegrationRegistry(_controller.resourceId(INTEGRATION_REGISTRY_RESOURCE_ID));
    }

    /**
     * Gets instance of price oracle on Controller. Note: PriceOracle is stored as index 1 on the Controller
     */
    function getPriceOracle(IController _controller) internal view returns (IPriceOracle) {
        return IPriceOracle(_controller.resourceId(PRICE_ORACLE_RESOURCE_ID));
    }

    /**
     * Gets the instance of Set valuer on Controller. Note: SetValuer is stored as index 2 on the Controller
     */
    function getSetValuer(IController _controller) internal view returns (ISetValuer) {
        return ISetValuer(_controller.resourceId(SET_VALUER_RESOURCE_ID));
    }
}
// Dependency file: contracts/interfaces/IModule.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.


*/
// pragma solidity 0.6.10;


/**
 * @title IModule
 * @author Set Protocol
 *
 * Interface for interacting with Modules.
 */
interface IModule {
    /**
     * Called by a SetToken to notify that this module was removed from the Set token. Any logic can be included
     * in case checks need to be made or state needs to be cleared.
     */
    function removeModule() external;
}
// Dependency file: contracts/lib/ExplicitERC20.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.


*/

// pragma solidity 0.6.10;

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

/**
 * @title ExplicitERC20
 * @author Set Protocol
 *
 * Utility functions for ERC20 transfers that require the explicit amount to be transferred.
 */
library ExplicitERC20 {
    using SafeMath for uint256;

    /**
     * When given allowance, transfers a token from the "_from" to the "_to" of quantity "_quantity".
     * Ensures that the recipient has received the correct quantity (ie no fees taken on transfer)
     *
     * @param _token           ERC20 token to approve
     * @param _from            The account to transfer tokens from
     * @param _to              The account to transfer tokens to
     * @param _quantity        The quantity to transfer
     */
    function transferFrom(
        IERC20 _token,
        address _from,
        address _to,
        uint256 _quantity
    )
        internal
    {
        // Call specified ERC20 contract to transfer tokens (via proxy).
        if (_quantity > 0) {
            uint256 existingBalance = _token.balanceOf(_to);

            SafeERC20.safeTransferFrom(
                _token,
                _from,
                _to,
                _quantity
            );

            uint256 newBalance = _token.balanceOf(_to);

            // Verify transfer quantity is reflected in balance
            require(
                newBalance == existingBalance.add(_quantity),
                "Invalid post transfer balance"
            );
        }
    }
}

// Dependency file: @openzeppelin/contracts/utils/Address.sol



// pragma solidity ^0.6.2;

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

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

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

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

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

// Dependency file: @openzeppelin/contracts/GSN/Context.sol



// pragma solidity ^0.6.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;
    }
}

// Dependency file: contracts/lib/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.


*/

// 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;
    }
}
// Dependency file: contracts/protocol/lib/Position.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.


*/

// pragma solidity 0.6.10;
// pragma experimental "ABIEncoderV2";

// import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import { SafeCast } from "@openzeppelin/contracts/utils/SafeCast.sol";
// import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
// import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol";

// import { ISetToken } from "../../interfaces/ISetToken.sol";
// import { PreciseUnitMath } from "../../lib/PreciseUnitMath.sol";

/**
 * @title Position
 * @author Set Protocol
 *
 * Collection of helper functions for handling and updating SetToken Positions
 */
library Position {
    using SafeCast for uint256;
    using SafeMath for uint256;
    using SafeCast for int256;
    using SignedSafeMath for int256;
    using PreciseUnitMath for uint256;

    /* ============ Helper ============ */

    /**
     * Returns whether the SetToken has a default position for a given component (if the real unit is > 0)
     */
    function hasDefaultPosition(ISetToken _setToken, address _component) internal view returns(bool) {
        return _setToken.getDefaultPositionRealUnit(_component) > 0;
    }

    /**
     * Returns whether the SetToken has an external position for a given component (if # of position modules is > 0)
     */
    function hasExternalPosition(ISetToken _setToken, address _component) internal view returns(bool) {
        return _setToken.getExternalPositionModules(_component).length > 0;
    }
    
    /**
     * Returns whether the SetToken component default position real unit is greater than or equal to units passed in.
     */
    function hasSufficientDefaultUnits(ISetToken _setToken, address _component, uint256 _unit) internal view returns(bool) {
        return _setToken.getDefaultPositionRealUnit(_component) >= _unit.toInt256();
    }

    /**
     * Returns whether the SetToken component external position is greater than or equal to the real units passed in.
     */
    function hasSufficientExternalUnits(
        ISetToken _setToken,
        address _component,
        address _positionModule,
        uint256 _unit
    )
        internal
        view
        returns(bool)
    {
       return _setToken.getExternalPositionRealUnit(_component, _positionModule) >= _unit.toInt256();    
    }

    /**
     * If the position does not exist, create a new Position and add to the SetToken. If it already exists,
     * then set the position units. If the new units is 0, remove the position. Handles adding/removing of 
     * components where needed (in light of potential external positions).
     *
     * @param _setToken           Address of SetToken being modified
     * @param _component          Address of the component
     * @param _newUnit            Quantity of Position units - must be >= 0
     */
    function editDefaultPosition(ISetToken _setToken, address _component, uint256 _newUnit) internal {
        bool isPositionFound = hasDefaultPosition(_setToken, _component);
        if (!isPositionFound && _newUnit > 0) {
            // If there is no Default Position and no External Modules, then component does not exist
            if (!hasExternalPosition(_setToken, _component)) {
                _setToken.addComponent(_component);
            }
        } else if (isPositionFound && _newUnit == 0) {
            // If there is a Default Position and no external positions, remove the component
            if (!hasExternalPosition(_setToken, _component)) {
                _setToken.removeComponent(_component);
            }
        }

        _setToken.editDefaultPositionUnit(_component, _newUnit.toInt256());
    }

    /**
     * Update an external position and remove and external positions or components if necessary. The logic flows as follows:
     * 1) If component is not already added then add component and external position. 
     * 2) If component is added but no existing external position using the passed module exists then add the external position.
     * 3) If the existing position is being added to then just update the unit
     * 4) If the position is being closed and no other external positions or default positions are associated with the component
     *    then untrack the component and remove external position.
     * 5) If the position is being closed and  other existing positions still exist for the component then just remove the
     *    external position.
     *
     * @param _setToken         SetToken being updated
     * @param _component        Component position being updated
     * @param _module           Module external position is associated with
     * @param _newUnit          Position units of new external position
     * @param _data             Arbitrary data associated with the position
     */
    function editExternalPosition(
        ISetToken _setToken,
        address _component,
        address _module,
        int256 _newUnit,
        bytes memory _data
    )
        internal
    {
        if (!_setToken.isComponent(_component)) {
            _setToken.addComponent(_component);
            addExternalPosition(_setToken, _component, _module, _newUnit, _data);
        } else if (!_setToken.isExternalPositionModule(_component, _module)) {
            addExternalPosition(_setToken, _component, _module, _newUnit, _data);
        } else if (_newUnit != 0) {
            _setToken.editExternalPositionUnit(_component, _module, _newUnit);
        } else {
            // If no default or external position remaining then remove component from components array
            if (_setToken.getDefaultPositionRealUnit(_component) == 0 && _setToken.getExternalPositionModules(_component).length == 1) {
                _setToken.removeComponent(_component);
            }
            _setToken.removeExternalPositionModule(_component, _module);
        }
    }

    /**
     * Add a new external position from a previously untracked module.
     *
     * @param _setToken         SetToken being updated
     * @param _component        Component position being updated
     * @param _module           Module external position is associated with
     * @param _newUnit          Position units of new external position
     * @param _data             Arbitrary data associated with the position
     */
    function addExternalPosition(
        ISetToken _setToken,
        address _component,
        address _module,
        int256 _newUnit,
        bytes memory _data
    )
        internal
    {
        _setToken.addExternalPositionModule(_component, _module);
        _setToken.editExternalPositionUnit(_component, _module, _newUnit);
        _setToken.editExternalPositionData(_component, _module, _data);
    }

    /**
     * Get total notional amount of Default position
     *
     * @param _setTokenSupply     Supply of SetToken in precise units (10^18)
     * @param _positionUnit       Quantity of Position units
     *
     * @return                    Total notional amount of units
     */
    function getDefaultTotalNotional(uint256 _setTokenSupply, uint256 _positionUnit) internal pure returns (uint256) {
        return _setTokenSupply.preciseMul(_positionUnit);
    }

    /**
     * Get position unit from total notional amount
     *
     * @param _setTokenSupply     Supply of SetToken in precise units (10^18)
     * @param _totalNotional      Total notional amount of component prior to
     * @return                    Default position unit
     */
    function getDefaultPositionUnit(uint256 _setTokenSupply, uint256 _totalNotional) internal pure returns (uint256) {
        return _totalNotional.preciseDiv(_setTokenSupply);
    }

    /**
     * Get the total tracked balance - total supply * position unit
     *
     * @param _setToken           Address of the SetToken
     * @param _component          Address of the component
     * @return                    Notional tracked balance
     */
    function getDefaultTrackedBalance(ISetToken _setToken, address _component) internal view returns(uint256) {
        int256 positionUnit = _setToken.getDefaultPositionRealUnit(_component); 
        return _setToken.totalSupply().preciseMul(positionUnit.toUint256());
    }

    /**
     * Calculates the new default position unit and performs the edit with the new unit
     *
     * @param _setToken                 Address of the SetToken
     * @param _component                Address of the component
     * @param _setTotalSupply           Current SetToken supply
     * @param _componentPreviousBalance Pre-action component balance
     * @return                          Current component balance
     * @return                          Previous position unit
     * @return                          New position unit
     */
    function calculateAndEditDefaultPosition(
        ISetToken _setToken,
        address _component,
        uint256 _setTotalSupply,
        uint256 _componentPreviousBalance
    )
        internal
        returns(uint256, uint256, uint256)
    {
        uint256 currentBalance = IERC20(_component).balanceOf(address(_setToken));
        uint256 positionUnit = _setToken.getDefaultPositionRealUnit(_component).toUint256();

        uint256 newTokenUnit = calculateDefaultEditPositionUnit(
            _setTotalSupply,
            _componentPreviousBalance,
            currentBalance,
            positionUnit
        );

        editDefaultPosition(_setToken, _component, newTokenUnit);

        return (currentBalance, positionUnit, newTokenUnit);
    }

    /**
     * Calculate the new position unit given total notional values pre and post executing an action that changes SetToken state
     * The intention is to make updates to the units without accidentally picking up airdropped assets as well.
     *
     * @param _setTokenSupply     Supply of SetToken in precise units (10^18)
     * @param _preTotalNotional   Total notional amount of component prior to executing action
     * @param _postTotalNotional  Total notional amount of component after the executing action
     * @param _prePositionUnit    Position unit of SetToken prior to executing action
     * @return                    New position unit
     */
    function calculateDefaultEditPositionUnit(
        uint256 _setTokenSupply,
        uint256 _preTotalNotional,
        uint256 _postTotalNotional,
        uint256 _prePositionUnit
    )
        internal
        pure
        returns (uint256)
    {
        // If pre action total notional amount is greater then subtract post action total notional and calculate new position units
        if (_preTotalNotional >= _postTotalNotional) {
            uint256 unitsToSub = _preTotalNotional.sub(_postTotalNotional).preciseDivCeil(_setTokenSupply);
            return _prePositionUnit.sub(unitsToSub);
        } else {
            // Else subtract post action total notional from pre action total notional and calculate new position units
            uint256 unitsToAdd = _postTotalNotional.sub(_preTotalNotional).preciseDiv(_setTokenSupply);
            return _prePositionUnit.add(unitsToAdd);
        }
    }
}

// Dependency file: contracts/protocol/lib/ModuleBase.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.


*/

// pragma solidity 0.6.10;

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

// import { ExplicitERC20 } from "../../lib/ExplicitERC20.sol";
// import { IController } from "../../interfaces/IController.sol";
// import { IModule } from "../../interfaces/IModule.sol";
// import { ISetToken } from "../../interfaces/ISetToken.sol";
// import { Invoke } from "./Invoke.sol";
// import { PreciseUnitMath } from "../../lib/PreciseUnitMath.sol";
// import { ResourceIdentifier } from "./ResourceIdentifier.sol";

/**
 * @title ModuleBase
 * @author Set Protocol
 *
 * Abstract class that houses common Module-related state and functions.
 */
abstract contract ModuleBase is IModule {
    using PreciseUnitMath for uint256;
    using Invoke for ISetToken;
    using ResourceIdentifier for IController;

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

    // Address of the controller
    IController public controller;

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

    modifier onlyManagerAndValidSet(ISetToken _setToken) { 
        require(isSetManager(_setToken, msg.sender), "Must be the SetToken manager");
        require(isSetValidAndInitialized(_setToken), "Must be a valid and initialized SetToken");
        _;
    }

    modifier onlySetManager(ISetToken _setToken, address _caller) {
        require(isSetManager(_setToken, _caller), "Must be the SetToken manager");
        _;
    }

    modifier onlyValidAndInitializedSet(ISetToken _setToken) {
        require(isSetValidAndInitialized(_setToken), "Must be a valid and initialized SetToken");
        _;
    }

    /**
     * Throws if the sender is not a SetToken's module or module not enabled
     */
    modifier onlyModule(ISetToken _setToken) {
        require(
            _setToken.moduleStates(msg.sender) == ISetToken.ModuleState.INITIALIZED,
            "Only the module can call"
        );

        require(
            controller.isModule(msg.sender),
            "Module must be enabled on controller"
        );
        _;
    }

    /**
     * Utilized during module initializations to check that the module is in pending state
     * and that the SetToken is valid
     */
    modifier onlyValidAndPendingSet(ISetToken _setToken) {
        require(controller.isSet(address(_setToken)), "Must be controller-enabled SetToken");
        require(isSetPendingInitialization(_setToken), "Must be pending initialization");        
        _;
    }

    /* ============ Constructor ============ */

    /**
     * Set state variables and map asset pairs to their oracles
     *
     * @param _controller             Address of controller contract
     */
    constructor(IController _controller) public {
        controller = _controller;
    }

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

    /**
     * Transfers tokens from an address (that has set allowance on the module).
     *
     * @param  _token          The address of the ERC20 token
     * @param  _from           The address to transfer from
     * @param  _to             The address to transfer to
     * @param  _quantity       The number of tokens to transfer
     */
    function transferFrom(IERC20 _token, address _from, address _to, uint256 _quantity) internal {
        ExplicitERC20.transferFrom(_token, _from, _to, _quantity);
    }

    /**
     * Gets the integration for the module with the passed in name. Validates that the address is not empty
     */
    function getAndValidateAdapter(string memory _integrationName) internal view returns(address) { 
        bytes32 integrationHash = getNameHash(_integrationName);
        return getAndValidateAdapterWithHash(integrationHash);
    }

    /**
     * Gets the integration for the module with the passed in hash. Validates that the address is not empty
     */
    function getAndValidateAdapterWithHash(bytes32 _integrationHash) internal view returns(address) { 
        address adapter = controller.getIntegrationRegistry().getIntegrationAdapterWithHash(
            address(this),
            _integrationHash
        );

        require(adapter != address(0), "Must be valid adapter"); 
        return adapter;
    }

    /**
     * Gets the total fee for this module of the passed in index (fee % * quantity)
     */
    function getModuleFee(uint256 _feeIndex, uint256 _quantity) internal view returns(uint256) {
        uint256 feePercentage = controller.getModuleFee(address(this), _feeIndex);
        return _quantity.preciseMul(feePercentage);
    }

    /**
     * Pays the _feeQuantity from the _setToken denominated in _token to the protocol fee recipient
     */
    function payProtocolFeeFromSetToken(ISetToken _setToken, address _token, uint256 _feeQuantity) internal {
        if (_feeQuantity > 0) {
            _setToken.strictInvokeTransfer(_token, controller.feeRecipient(), _feeQuantity); 
        }
    }

    /**
     * Returns true if the module is in process of initialization on the SetToken
     */
    function isSetPendingInitialization(ISetToken _setToken) internal view returns(bool) {
        return _setToken.isPendingModule(address(this));
    }

    /**
     * Returns true if the address is the SetToken's manager
     */
    function isSetManager(ISetToken _setToken, address _toCheck) internal view returns(bool) {
        return _setToken.manager() == _toCheck;
    }

    /**
     * Returns true if SetToken must be enabled on the controller 
     * and module is registered on the SetToken
     */
    function isSetValidAndInitialized(ISetToken _setToken) internal view returns(bool) {
        return controller.isSet(address(_setToken)) &&
            _setToken.isInitializedModule(address(this));
    }

    /**
     * Hashes the string and returns a bytes32 value
     */
    function getNameHash(string memory _name) internal pure returns(bytes32) {
        return keccak256(bytes(_name));
    }
}
// Dependency file: contracts/interfaces/external/IUniswapV2Router.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.


*/

// pragma solidity 0.6.10;

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

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

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
// Dependency file: contracts/interfaces/external/IUniswapV2Pair.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.

*/

// pragma solidity 0.6.10;

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

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

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

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

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

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

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

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

    function initialize(address, address) external;
}

// Dependency file: contracts/interfaces/external/IStakingRewards.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.


*/

// pragma solidity 0.6.10;

interface IStakingRewards {
    function balanceOf(address account) external view returns (uint256);
    function earned(address account) external view returns (uint256);
    function stake(uint256 amount) external;
    function withdraw(uint256 amount) external;
    function getReward() external;
}

// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol



// pragma solidity ^0.6.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);
}

// Dependency file: contracts/interfaces/ISetToken.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.


*/
// 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);
}
// Dependency file: contracts/protocol/lib/Invoke.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.


*/

// pragma solidity 0.6.10;

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

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


/**
 * @title Invoke
 * @author Set Protocol
 *
 * A collection of common utility functions for interacting with the SetToken's invoke function
 */
library Invoke {
    using SafeMath for uint256;

    /* ============ Internal ============ */

    /**
     * Instructs the SetToken to set approvals of the ERC20 token to a spender.
     *
     * @param _setToken        SetToken instance to invoke
     * @param _token           ERC20 token to approve
     * @param _spender         The account allowed to spend the SetToken's balance
     * @param _quantity        The quantity of allowance to allow
     */
    function invokeApprove(
        ISetToken _setToken,
        address _token,
        address _spender,
        uint256 _quantity
    )
        internal
    {
        bytes memory callData = abi.encodeWithSignature("approve(address,uint256)", _spender, _quantity);
        _setToken.invoke(_token, 0, callData);
    }

    /**
     * Instructs the SetToken to transfer the ERC20 token to a recipient.
     *
     * @param _setToken        SetToken instance to invoke
     * @param _token           ERC20 token to transfer
     * @param _to              The recipient account
     * @param _quantity        The quantity to transfer
     */
    function invokeTransfer(
        ISetToken _setToken,
        address _token,
        address _to,
        uint256 _quantity
    )
        internal
    {
        if (_quantity > 0) {
            bytes memory callData = abi.encodeWithSignature("transfer(address,uint256)", _to, _quantity);
            _setToken.invoke(_token, 0, callData);
        }
    }

    /**
     * Instructs the SetToken to transfer the ERC20 token to a recipient.
     * The new SetToken balance must equal the existing balance less the quantity transferred
     *
     * @param _setToken        SetToken instance to invoke
     * @param _token           ERC20 token to transfer
     * @param _to              The recipient account
     * @param _quantity        The quantity to transfer
     */
    function strictInvokeTransfer(
        ISetToken _setToken,
        address _token,
        address _to,
        uint256 _quantity
    )
        internal
    {
        if (_quantity > 0) {
            // Retrieve current balance of token for the SetToken
            uint256 existingBalance = IERC20(_token).balanceOf(address(_setToken));

            Invoke.invokeTransfer(_setToken, _token, _to, _quantity);

            // Get new balance of transferred token for SetToken
            uint256 newBalance = IERC20(_token).balanceOf(address(_setToken));

            // Verify only the transfer quantity is subtracted
            require(
                newBalance == existingBalance.sub(_quantity),
                "Invalid post transfer balance"
            );
        }
    }

    /**
     * Instructs the SetToken to unwrap the passed quantity of WETH
     *
     * @param _setToken        SetToken instance to invoke
     * @param _weth            WETH address
     * @param _quantity        The quantity to unwrap
     */
    function invokeUnwrapWETH(ISetToken _setToken, address _weth, uint256 _quantity) internal {
        bytes memory callData = abi.encodeWithSignature("withdraw(uint256)", _quantity);
        _setToken.invoke(_weth, 0, callData);
    }

    /**
     * Instructs the SetToken to wrap the passed quantity of ETH
     *
     * @param _setToken        SetToken instance to invoke
     * @param _weth            WETH address
     * @param _quantity        The quantity to unwrap
     */
    function invokeWrapWETH(ISetToken _setToken, address _weth, uint256 _quantity) internal {
        bytes memory callData = abi.encodeWithSignature("deposit()");
        _setToken.invoke(_weth, _quantity, callData);
    }
}
// Dependency file: contracts/interfaces/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.


*/
// 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);
}
// Dependency file: @openzeppelin/contracts/math/SignedSafeMath.sol



// pragma solidity ^0.6.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;
    }
}

// Dependency file: @openzeppelin/contracts/math/SafeMath.sol



// pragma solidity ^0.6.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

// Dependency file: @openzeppelin/contracts/utils/SafeCast.sol



// pragma solidity ^0.6.0;


/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such 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.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

// Dependency file: @openzeppelin/contracts/utils/ReentrancyGuard.sol



// pragma solidity ^0.6.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].
 */
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;
    }
}

// Dependency file: @openzeppelin/contracts/math/Math.sol



// pragma solidity ^0.6.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);
    }
}

// Dependency file: @openzeppelin/contracts/token/ERC20/ERC20.sol



// pragma solidity ^0.6.0;

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

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

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(sender, recipient, amount);

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

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

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

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

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

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

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

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

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

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

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

/*
    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.


*/

pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

// import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import { Math } from "@openzeppelin/contracts/math/Math.sol";
// import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// import { SafeCast } from "@openzeppelin/contracts/utils/SafeCast.sol";
// import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
// import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol";

// import { IController } from "../../interfaces/IController.sol";
// import { Invoke } from "../lib/Invoke.sol";
// import { ISetToken } from "../../interfaces/ISetToken.sol";
// import { IStakingRewards } from "../../interfaces/external/IStakingRewards.sol";
// import { IUniswapV2Pair } from "../../interfaces/external/IUniswapV2Pair.sol";
// import { IUniswapV2Router } from "../../interfaces/external/IUniswapV2Router.sol";
// import { ModuleBase } from "../lib/ModuleBase.sol";
// import { Position } from "../lib/Position.sol";
// import { PreciseUnitMath } from "../../lib/PreciseUnitMath.sol";


contract UniswapYieldStrategy is ModuleBase, ReentrancyGuard {
    using Position for ISetToken;
    using Invoke for ISetToken;
    using SafeMath for uint256;
    using SafeCast for uint256;
    using SafeCast for int256;

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

    IUniswapV2Router public uniswapRouter;
    IUniswapV2Pair public lpToken;
    IERC20 public assetOne;
    IERC20 public assetTwo;
    IERC20 public uni;
    address public feeRecipient;
    IStakingRewards public rewarder;
    ISetToken public setToken;
    uint256 public reservePercentage;        // Precise percentage (e.g. 10^16 = 1%)
    uint256 public slippageTolerance;        // Precise percentage
    uint256 public rewardFee;                // Precise percentage
    uint256 public withdrawalFee;            // Precise percentage
    uint256 public assetOneBaseUnit;
    uint256 public assetTwoBaseUnit;
    uint256 public lpTokenBaseUnit;

    /* ============ Constructor ============ */

    constructor(
        IController _controller,
        IUniswapV2Router _uniswapRouter,
        IUniswapV2Pair _lpToken,
        IERC20 _assetOne,
        IERC20 _assetTwo,
        IERC20 _uni,
        IStakingRewards _rewarder,
        address _feeRecipient
    )
        public
        ModuleBase(_controller)
    {
        controller = _controller;
        uniswapRouter = _uniswapRouter;
        lpToken = _lpToken;
        assetOne = _assetOne;
        assetTwo = _assetTwo;
        uni = _uni;
        rewarder = _rewarder;
        feeRecipient = _feeRecipient;

        uint256 tokenOneDecimals = ERC20(address(_assetOne)).decimals();
        assetOneBaseUnit = 10 ** tokenOneDecimals;
        uint256 tokenTwoDecimals = ERC20(address(_assetTwo)).decimals();
        assetTwoBaseUnit = 10 ** tokenTwoDecimals;
        uint256 lpTokenDecimals = ERC20(address(_lpToken)).decimals();
        lpTokenBaseUnit = 10 ** lpTokenDecimals;
    }

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

    function engage() external nonReentrant {
        _engage();
    }

    function disengage() external nonReentrant {
        _rebalance(0);

        uint256 lpTokenQuantity = _calculateDisengageLPQuantity();

        _unstake(lpTokenQuantity);

        _approveAndRemoveLiquidity(lpTokenQuantity);

        _updatePositions();
    }

    function reap() external nonReentrant {
        _handleReward();

        _engage();
    }

    function rebalance() external nonReentrant {
        _rebalance(0);

        _updatePositions();
    }

    function rebalanceSome(uint256 _sellTokenQuantity) external nonReentrant {
        _rebalance(_sellTokenQuantity);

        _updatePositions();        
    }

    function unstakeAndRedeem(uint256 _setTokenQuantity) external nonReentrant {
        require(setToken.balanceOf(msg.sender) >= _setTokenQuantity, "User must have sufficient SetToken");

        setToken.burn(msg.sender, _setTokenQuantity);

        uint256 lpTokenUnit = setToken.getExternalPositionRealUnit(address(lpToken), address(this)).toUint256();

        uint256 userLPBalance = lpTokenUnit.preciseMul(_setTokenQuantity);

        _unstake(userLPBalance);

        uint256 lpFees = userLPBalance.preciseMul(withdrawalFee);
        setToken.invokeTransfer(address(lpToken), msg.sender, userLPBalance.sub(lpFees));
        setToken.invokeTransfer(address(lpToken), feeRecipient, lpFees);

        uint256 assetOneUnit = setToken.getDefaultPositionRealUnit(address(assetOne)).toUint256();
        uint256 assetOneNotional = assetOneUnit.preciseMul(_setTokenQuantity);
        uint256 assetOneFee = assetOneNotional.preciseMul(withdrawalFee);
        setToken.invokeTransfer(address(assetOne), msg.sender, assetOneNotional.sub(assetOneFee));
        setToken.invokeTransfer(address(assetOne), feeRecipient, assetOneFee);

        uint256 assetTwoUnit = setToken.getDefaultPositionRealUnit(address(assetTwo)).toUint256();
        uint256 assetTwoNotional = assetTwoUnit.preciseMul(_setTokenQuantity);
        uint256 assetTwoFee = assetTwoNotional.preciseMul(withdrawalFee);
        setToken.invokeTransfer(address(assetTwo), msg.sender, assetTwoNotional.sub(assetTwoFee));
        setToken.invokeTransfer(address(assetTwo), feeRecipient, assetTwoFee);
    }

    function initialize(
        ISetToken _setToken,
        uint256 _reservePercentage,
        uint256 _slippageTolerance,
        uint256 _rewardFee,
        uint256 _withdrawalFee
    )
        external
        onlySetManager(_setToken, msg.sender)
    {
        require(address(setToken) == address(0), "May only be called once");

        setToken = _setToken;
        reservePercentage = _reservePercentage;
        slippageTolerance = _slippageTolerance;
        rewardFee = _rewardFee;
        withdrawalFee = _withdrawalFee;

        _setToken.initializeModule();
    }

    function removeModule() external override {
        require(msg.sender == address(setToken), "Caller must be SetToken");

        uint256 lpBalance = rewarder.balanceOf(address(setToken));

        _unstake(lpBalance);

        _approveAndRemoveLiquidity(lpBalance);

        _updatePositions();
    }

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

    function _engage() internal {
        _rebalance(0);

        (uint256 assetOneQuantity, uint256 assetTwoQuantity) = _calculateEngageQuantities();

        uint256 lpBalance = _approveAndAddLiquidity(assetOneQuantity, assetTwoQuantity);

        _approveAndStake(lpBalance);

        _updatePositions();
    }  

    // Rebalances reserve assets to achieve a 50/50 value split
    // If a sellTokenQuantity is provided, then use this value
    function _rebalance(uint256 _sellTokenQuantity) internal {
        address assetToSell;
        address assetToBuy;
        uint256 quantityToSell;
        uint256 minimumBuyToken;

        uint256 assetOneToTwoPrice = controller.getPriceOracle().getPrice(address(assetOne), address(assetTwo));

        uint256 balanceAssetOne = assetOne.balanceOf(address(setToken));
        uint256 balanceAssetTwo = assetTwo.balanceOf(address(setToken));

        // Convert Asset Two to One adjust for decimal differences
        uint256 valueAssetTwoDenomOne = balanceAssetTwo.preciseDiv(assetOneToTwoPrice).mul(assetOneBaseUnit).div(assetTwoBaseUnit);

        if (balanceAssetOne > valueAssetTwoDenomOne) {
            assetToSell = address(assetOne);
            assetToBuy = address(assetTwo);
            quantityToSell = balanceAssetOne.sub(valueAssetTwoDenomOne).div(2);

            // Base unit calculations are to normalize the values for different decimals
            minimumBuyToken = quantityToSell.preciseMul(assetOneToTwoPrice).mul(assetTwoBaseUnit).div(assetOneBaseUnit);
        } else {
            assetToSell = address(assetTwo);
            assetToBuy = address(assetOne);
            quantityToSell = valueAssetTwoDenomOne
                                .sub(balanceAssetOne).div(2).preciseMul(assetOneToTwoPrice)
                                .mul(assetTwoBaseUnit).div(assetOneBaseUnit);
            minimumBuyToken = quantityToSell.preciseDiv(assetOneToTwoPrice).mul(assetOneBaseUnit).div(assetTwoBaseUnit);
        }

        if (_sellTokenQuantity > 0) {
            require(_sellTokenQuantity <= quantityToSell, "Delta must be less than max");
            minimumBuyToken = minimumBuyToken.preciseMul(_sellTokenQuantity).preciseDiv(quantityToSell);
            quantityToSell = _sellTokenQuantity;
        }

        // Reduce the expected receive quantity 
        minimumBuyToken = minimumBuyToken
            .preciseMul(PreciseUnitMath.preciseUnit().sub(slippageTolerance));

        setToken.invokeApprove(assetToSell, address(uniswapRouter), quantityToSell);
        if (quantityToSell > 0) {
            _invokeUniswapTrade(assetToSell, assetToBuy, quantityToSell, minimumBuyToken);
        }
    }

    function _approveAndAddLiquidity(uint256 _assetOneQuantity, uint256 _assetTwoQuantity) internal returns (uint256) {
        setToken.invokeApprove(address(assetOne), address(uniswapRouter), _assetOneQuantity);
        setToken.invokeApprove(address(assetTwo), address(uniswapRouter), _assetTwoQuantity);

        bytes memory addLiquidityBytes = abi.encodeWithSignature(
            "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)",
            assetOne,
            assetTwo,
            _assetOneQuantity,
            _assetTwoQuantity,
            1,
            1,
            address(setToken),
            now.add(60) // Valid for one minute
        );

        setToken.invoke(address(uniswapRouter), 0, addLiquidityBytes);

        return lpToken.balanceOf(address(setToken));
    }

    function _approveAndRemoveLiquidity(uint256 _liquidityQuantity) internal {
        setToken.invokeApprove(address(lpToken), address(uniswapRouter), _liquidityQuantity);

        bytes memory removeLiquidityBytes = abi.encodeWithSignature(
            "removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)",
            assetOne,
            assetTwo,
            _liquidityQuantity,
            1,
            1,
            address(setToken),
            now.add(60) // Valid for one minute
        );

        setToken.invoke(address(uniswapRouter), 0, removeLiquidityBytes);
    }

    function _approveAndStake(uint256 _lpTokenQuantity) internal {
        setToken.invokeApprove(address(lpToken), address(rewarder), _lpTokenQuantity);
        bytes memory stakeBytes = abi.encodeWithSignature("stake(uint256)", _lpTokenQuantity);

        setToken.invoke(address(rewarder), 0, stakeBytes);
    }

    function _unstake(uint256 _lpTokenQuantity) internal {
        bytes memory unstakeBytes = abi.encodeWithSignature("withdraw(uint256)", _lpTokenQuantity);

        setToken.invoke(address(rewarder), 0, unstakeBytes);
    }

    function _handleReward() internal {
        setToken.invoke(address(rewarder), 0, abi.encodeWithSignature("getReward()"));

        uint256 uniBalance = uni.balanceOf(address(setToken));
        uint256 assetOneBalance = assetOne.balanceOf(address(setToken));

        setToken.invokeApprove(address(uni), address(uniswapRouter), uniBalance);
        _invokeUniswapTrade(address(uni), address(assetOne), uniBalance, 1);

        uint256 postTradeAssetOneBalance = assetOne.balanceOf(address(setToken));
        uint256 fee = postTradeAssetOneBalance.sub(assetOneBalance).preciseMul(rewardFee);

        setToken.strictInvokeTransfer(address(assetOne), feeRecipient, fee);
    }

    function _invokeUniswapTrade(
        address _sellToken,
        address _buyToken,
        uint256 _amountIn,
        uint256 _amountOutMin
    )
        internal
    {
        address[] memory path = new address[](2);
        path[0] = _sellToken;
        path[1] = _buyToken;

        bytes memory tradeBytes = abi.encodeWithSignature(
            "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",
            _amountIn,
            _amountOutMin,
            path,
            address(setToken),
            now.add(180)
        );

        setToken.invoke(address(uniswapRouter), 0, tradeBytes);
    }

    function _calculateEngageQuantities() internal view returns(uint256 tokenAQuantity, uint256 tokenBQuantity) {
        (
            uint256 desiredAssetOne,
            uint256 desiredAssetTwo,
            uint256 assetOneOnSetToken,
            uint256 assetTwoOnSetToken
        ) = _getDesiredSingleAssetReserve();

        require(assetOneOnSetToken > desiredAssetOne && assetTwoOnSetToken > desiredAssetTwo, "SetToken assets must be > desired");

        return (
            assetOneOnSetToken.sub(desiredAssetOne),
            assetTwoOnSetToken.sub(desiredAssetTwo)
        );
    }

    function _calculateDisengageLPQuantity() internal view returns(uint256 _lpTokenQuantity) {
        (uint256 assetOneToLPRate, uint256 assetTwoToLPRate) = _getLPReserveExchangeRate();

        (
            uint256 desiredOne,
            uint256 desiredTwo,
            uint256 assetOneOnSetToken,
            uint256 assetTwoOnSetToken
        ) = _getDesiredSingleAssetReserve();    

        require(assetOneOnSetToken < desiredOne && assetTwoOnSetToken < desiredTwo, "SetToken assets must be < desired");

        // LP Rates already account for decimals
        uint256 minLPForOneToRedeem = desiredOne.sub(assetOneOnSetToken).preciseDiv(assetOneToLPRate);
        uint256 minLPForTwoToRedeem = desiredTwo.sub(assetTwoOnSetToken).preciseDiv(assetTwoToLPRate);

        return Math.max(minLPForOneToRedeem, minLPForTwoToRedeem);
    }

    // Returns desiredOneReserve, desiredTwoReserve, tokenOne and tokenTwo balances
    function _getDesiredSingleAssetReserve()
        internal
        view
        returns(uint256, uint256, uint256, uint256)
    {
        (uint256 assetOneReserve, uint256 assetTwoReserve) = _getTotalLPReserves();
        uint256 balanceAssetOne = assetOne.balanceOf(address(setToken));
        uint256 balanceAssetTwo = assetTwo.balanceOf(address(setToken));

        uint256 desiredOneReserve = assetOneReserve.add(balanceAssetOne).preciseMul(reservePercentage);
        uint256 desiredTwoReserve = assetTwoReserve.add(balanceAssetTwo).preciseMul(reservePercentage);

        return(desiredOneReserve, desiredTwoReserve, balanceAssetOne, balanceAssetTwo);
    }

    // Returns assetAToLPRate and assetBToLPRate
    function _getLPReserveExchangeRate() internal view returns (uint256, uint256) {
        (uint reserve0, uint reserve1) = _getReservesSafe();
        uint256 totalSupply = lpToken.totalSupply();
        return(
            reserve0.preciseDiv(totalSupply),
            reserve1.preciseDiv(totalSupply)
        );
    }

    // Returns assetOneReserve and assetTwoReserve
    function _getTotalLPReserves() internal view returns (uint256, uint256) {
        (uint reserve0, uint reserve1) = _getReservesSafe();
        uint256 totalSupply = lpToken.totalSupply();
        uint256 lpTokenBalance = rewarder.balanceOf(address(setToken));
        return(
            reserve0.mul(lpTokenBalance).div(totalSupply),
            reserve1.mul(lpTokenBalance).div(totalSupply)
        );
    }

    function _updatePositions() internal {
        uint256 totalSupply = setToken.totalSupply();
        uint256 assetOneBalance = assetOne.balanceOf(address(setToken));
        uint256 assetTwoBalance = assetTwo.balanceOf(address(setToken));
        uint256 lpBalance = rewarder.balanceOf(address(setToken));

        // Doesn't check to make sure unit is different, and no check for any LP token on Set
        setToken.editDefaultPosition(address(assetOne), Position.getDefaultPositionUnit(totalSupply, assetOneBalance));
        setToken.editDefaultPosition(address(assetTwo), Position.getDefaultPositionUnit(totalSupply, assetTwoBalance));
        setToken.editExternalPosition(
            address(lpToken),
            address(this),
            Position.getDefaultPositionUnit(totalSupply, lpBalance).toInt256(),
            ""
        );
    }

    // Code pulled to sort from UniswapV2Library
    // https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/UniswapV2Library.sol
    function _getReservesSafe() internal view returns(uint256, uint256) {
        address firstAsset = address(assetOne) < address(assetTwo) ? address(assetOne) : address(assetTwo);
        (uint reserve0, uint reserve1,) = lpToken.getReserves();
        return address(assetOne) == firstAsset ? (reserve0, reserve1) : (reserve1, reserve0);
    }
}

Contract ABI

[{"inputs":[{"internalType":"contract IController","name":"_controller","type":"address"},{"internalType":"contract IUniswapV2Router","name":"_uniswapRouter","type":"address"},{"internalType":"contract IUniswapV2Pair","name":"_lpToken","type":"address"},{"internalType":"contract IERC20","name":"_assetOne","type":"address"},{"internalType":"contract IERC20","name":"_assetTwo","type":"address"},{"internalType":"contract IERC20","name":"_uni","type":"address"},{"internalType":"contract IStakingRewards","name":"_rewarder","type":"address"},{"internalType":"address","name":"_feeRecipient","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"assetOne","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetOneBaseUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetTwo","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetTwoBaseUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disengage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"engage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_reservePercentage","type":"uint256"},{"internalType":"uint256","name":"_slippageTolerance","type":"uint256"},{"internalType":"uint256","name":"_rewardFee","type":"uint256"},{"internalType":"uint256","name":"_withdrawalFee","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IUniswapV2Pair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpTokenBaseUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sellTokenQuantity","type":"uint256"}],"name":"rebalanceSome","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewarder","outputs":[{"internalType":"contract IStakingRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setToken","outputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slippageTolerance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uni","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"contract IUniswapV2Router","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_setTokenQuantity","type":"uint256"}],"name":"unstakeAndRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040516200368f3803806200368f83398101604081905262000034916200024f565b60008054600180556001600160a01b03199081166001600160a01b038b8116918217831690911783556002805483168b83161790556003805483168a831617905560048054831689831690811782556005805485168a851617905560068054851689851617905560088054851688851617905560078054909416928616929092179092556040805163313ce56760e01b81529051919263313ce567928282019260209290829003018186803b158015620000ed57600080fd5b505afa15801562000102573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012891906200030f565b60ff16905080600a0a600e819055506000856001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200017357600080fd5b505afa15801562000188573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ae91906200030f565b60ff16905080600a0a600f819055506000886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620001f957600080fd5b505afa1580156200020e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200023491906200030f565b60ff16600a0a60105550620003529950505050505050505050565b600080600080600080600080610100898b0312156200026c578384fd5b8851620002798162000339565b60208a01519098506200028c8162000339565b60408a01519097506200029f8162000339565b60608a0151909650620002b28162000339565b60808a0151909550620002c58162000339565b60a08a0151909450620002d88162000339565b60c08a0151909350620002eb8162000339565b60e08a0151909250620002fe8162000339565b809150509295985092959890939650565b60006020828403121562000321578081fd5b815160ff8116811462000332578182fd5b9392505050565b6001600160a01b03811681146200034f57600080fd5b50565b61332d80620003626000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063c72896ac116100c3578063ee63021a1161007c578063ee63021a1461021d578063f26efb2214610225578063f37a7eec14610238578063f700c82914610240578063f77c479114610248578063f92ad2191461025057610158565b8063c72896ac146101ed578063d03153aa146101f5578063dcc3e06e146101fd578063e72133c214610205578063ed9cf58c1461020d578063edc9af951461021557610158565b80637d7c2a1c116101155780637d7c2a1c146101bd578063847ef08d146101c5578063866ce701146101cd5780638b424267146101d55780638bc7e8c4146101dd578063a193c18d146101e557610158565b806315656ea51461015d57806343b1878a1461017b57806346904840146101905780634a166f68146101a55780635fcbd285146101ad578063735de9f7146101b5575b600080fd5b610165610263565b6040516101729190613201565b60405180910390f35b61018e610189366004612d50565b610269565b005b610198610647565b6040516101729190612d94565b61018e610656565b61019861068c565b61019861069b565b61018e6106aa565b61018e6106e4565b6101986107b5565b6101656107c4565b6101656107ca565b6101986107d0565b61018e6107df565b610165610817565b61019861081d565b61016561082c565b610198610832565b610198610841565b61018e610850565b61018e610233366004612d50565b6108af565b6101656108e0565b6101656108e6565b6101986108ec565b61018e61025e366004612ca1565b6108fb565b600f5481565b600260015414156102955760405162461bcd60e51b815260040161028c906131ca565b60405180910390fd5b60026001556009546040516370a0823160e01b815282916001600160a01b0316906370a08231906102ca903390600401612d94565b60206040518083038186803b1580156102e257600080fd5b505afa1580156102f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031a9190612ce4565b10156103385760405162461bcd60e51b815260040161028c9061305a565b600954604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac9061036a9033908590600401612da8565b600060405180830381600087803b15801561038457600080fd5b505af1158015610398573d6000803e3d6000fd5b50506009546003546040516308bafae960e21b81526000945061042e93506001600160a01b03928316926322ebeba4926103d9929116903090600401612dc1565b60206040518083038186803b1580156103f157600080fd5b505afa158015610405573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104299190612ce4565b6109d6565b90506000610442828463ffffffff6109fc16565b905061044d81610a2f565b6000610464600d54836109fc90919063ffffffff16565b6003549091506104a2906001600160a01b031633610488858563ffffffff610b0116565b6009546001600160a01b031692919063ffffffff610b4316565b6003546007546009546104cc926001600160a01b039182169290821691168463ffffffff610b4316565b600954600480546040516366cb8d2f60e01b8152600093610507936001600160a01b03918216936366cb8d2f936103d9939091169101612d94565b9050600061051b828763ffffffff6109fc16565b90506000610534600d54836109fc90919063ffffffff16565b600454909150610558906001600160a01b031633610488858563ffffffff610b0116565b600454600754600954610582926001600160a01b039182169290821691168463ffffffff610b4316565b6009546005546040516366cb8d2f60e01b81526000926105bc926001600160a01b03918216926366cb8d2f926103d9921690600401612d94565b905060006105d0828a63ffffffff6109fc16565b905060006105e9600d54836109fc90919063ffffffff16565b60055490915061060d906001600160a01b031633610488858563ffffffff610b0116565b600554600754600954610637926001600160a01b039182169290821691168463ffffffff610b4316565b5050600180555050505050505050565b6007546001600160a01b031681565b600260015414156106795760405162461bcd60e51b815260040161028c906131ca565b6002600155610686610c19565b60018055565b6003546001600160a01b031681565b6002546001600160a01b031681565b600260015414156106cd5760405162461bcd60e51b815260040161028c906131ca565b60026001556106dc6000610c51565b610686610fb7565b6009546001600160a01b0316331461070e5760405162461bcd60e51b815260040161028c90612fb7565b6008546009546040516370a0823160e01b81526000926001600160a01b03908116926370a08231926107469290911690600401612d94565b60206040518083038186803b15801561075e57600080fd5b505afa158015610772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107969190612ce4565b90506107a181610a2f565b6107aa8161126d565b6107b2610fb7565b50565b6005546001600160a01b031681565b600c5481565b600d5481565b6004546001600160a01b031681565b600260015414156108025760405162461bcd60e51b815260040161028c906131ca565b600260015561080f611345565b610686610c19565b600b5481565b6008546001600160a01b031681565b600e5481565b6009546001600160a01b031681565b6006546001600160a01b031681565b600260015414156108735760405162461bcd60e51b815260040161028c906131ca565b60026001556108826000610c51565b600061088c611625565b905061089781610a2f565b6108a08161126d565b6108a8610fb7565b5060018055565b600260015414156108d25760405162461bcd60e51b815260040161028c906131ca565b60026001556108a081610c51565b60105481565b600a5481565b6000546001600160a01b031681565b843361090782826116bd565b6109235760405162461bcd60e51b815260040161028c90613193565b6009546001600160a01b03161561094c5760405162461bcd60e51b815260040161028c90612fee565b600980546001600160a01b0319166001600160a01b038916908117909155600a879055600b869055600c859055600d849055604080516307ff078f60e11b81529051630ffe0f1e9160048082019260009290919082900301818387803b1580156109b557600080fd5b505af11580156109c9573d6000803e3d6000fd5b5050505050505050505050565b6000808212156109f85760405162461bcd60e51b815260040161028c90613025565b5090565b6000610a26670de0b6b3a7640000610a1a858563ffffffff61174b16565b9063ffffffff61178516565b90505b92915050565b606081604051602401610a429190613201565b60408051601f198184030181529181526020820180516001600160e01b0316632e1a7d4d60e01b17905260095460085491516347b7819960e11b81529293506001600160a01b0390811692638f6f033292610aa69216906000908690600401612e34565b600060405180830381600087803b158015610ac057600080fd5b505af1158015610ad4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610afc9190810190612c15565b505050565b6000610a2683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117c7565b8015610c135760608282604051602401610b5e929190612da8565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516347b7819960e11b81529091506001600160a01b03861690638f6f033290610bba9087906000908690600401612e34565b600060405180830381600087803b158015610bd457600080fd5b505af1158015610be8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c109190810190612c15565b50505b50505050565b610c236000610c51565b600080610c2e6117f3565b915091506000610c3e8383611862565b9050610c4981611a4c565b610afc610fb7565b600080548190819081908190610c6f906001600160a01b0316611aed565b60048054600554604051635620c32d60e11b81526001600160a01b039485169463ac41865a94610ca6948216939091169101612dc1565b60206040518083038186803b158015610cbe57600080fd5b505afa158015610cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf69190612ce4565b600480546009546040516370a0823160e01b81529394506000936001600160a01b03928316936370a0823193610d2e93169101612d94565b60206040518083038186803b158015610d4657600080fd5b505afa158015610d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7e9190612ce4565b6005546009546040516370a0823160e01b81529293506000926001600160a01b03928316926370a0823192610db892911690600401612d94565b60206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e089190612ce4565b90506000610e37600f54610a1a600e54610e2b8887611b6d90919063ffffffff16565b9063ffffffff61174b16565b905080831115610e94576004546005546001600160a01b039182169950169650610e6c6002610a1a858463ffffffff610b0116565b9550610e8d600e54610a1a600f54610e2b888b6109fc90919063ffffffff16565b9450610efc565b600554600454600e54600f546001600160a01b039384169b50929091169850610ed891610a1a90610e2b88610ecc600285898c610b01565b9063ffffffff6109fc16565b9550610ef9600f54610a1a600e54610e2b888b611b6d90919063ffffffff16565b94505b8815610f485785891115610f225760405162461bcd60e51b815260040161028c90613114565b610f4286610f36878c63ffffffff6109fc16565b9063ffffffff611b6d16565b94508895505b610f72610f65600b54610f59611b8b565b9063ffffffff610b0116565b869063ffffffff6109fc16565b600254600954919650610f9a916001600160a01b03908116918b91168963ffffffff611b9716565b8515610fac57610fac88888888611c08565b505050505050505050565b600954604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b158015610ffc57600080fd5b505afa158015611010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110349190612ce4565b600480546009546040516370a0823160e01b81529394506000936001600160a01b03928316936370a082319361106c93169101612d94565b60206040518083038186803b15801561108457600080fd5b505afa158015611098573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bc9190612ce4565b6005546009546040516370a0823160e01b81529293506000926001600160a01b03928316926370a08231926110f692911690600401612d94565b60206040518083038186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111469190612ce4565b6008546009546040516370a0823160e01b81529293506000926001600160a01b03928316926370a082319261118092911690600401612d94565b60206040518083038186803b15801561119857600080fd5b505afa1580156111ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d09190612ce4565b600454909150611206906001600160a01b03166111ed8686611d6f565b6009546001600160a01b0316919063ffffffff611d8116565b600554611220906001600160a01b03166111ed8685611d6f565b600354610c13906001600160a01b03163061124361123e8886611d6f565b611eff565b6040805160208101909152600081526009546001600160a01b03169392919063ffffffff611f2416565b600354600254600954611297926001600160a01b039182169290821691168463ffffffff611b9716565b6004546005546009546060926001600160a01b039081169281169185916001918291166112cb42603c63ffffffff6122e016565b6040516024016112e19796959493929190612e5b565b60408051601f198184030181529181526020820180516001600160e01b0316635d5155ef60e11b17905260095460025491516347b7819960e11b81529293506001600160a01b0390811692638f6f033292610aa69216906000908690600401612e34565b6009546008546040805160048082526024820183526020820180516001600160e01b0316631e8c5c8960e11b17905291516347b7819960e11b81526001600160a01b0394851694638f6f0332946113a494911692600092909101612e34565b600060405180830381600087803b1580156113be57600080fd5b505af11580156113d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113fa9190810190612c15565b506006546009546040516370a0823160e01b81526000926001600160a01b03908116926370a08231926114339290911690600401612d94565b60206040518083038186803b15801561144b57600080fd5b505afa15801561145f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114839190612ce4565b600480546009546040516370a0823160e01b81529394506000936001600160a01b03928316936370a08231936114bb93169101612d94565b60206040518083038186803b1580156114d357600080fd5b505afa1580156114e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150b9190612ce4565b600654600254600954929350611537926001600160a01b0390811692811691168563ffffffff611b9716565b600654600454611556916001600160a01b039081169116846001611c08565b600480546009546040516370a0823160e01b81526000936001600160a01b03938416936370a082319361158c9391169101612d94565b60206040518083038186803b1580156115a457600080fd5b505afa1580156115b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115dc9190612ce4565b905060006115f9600c54610ecc8585610b0190919063ffffffff16565b600454600754600954929350610c13926001600160a01b0390811692811691168463ffffffff61230516565b6000806000611632612447565b9150915060008060008061164461250e565b9350935093509350838210801561165a57508281105b6116765760405162461bcd60e51b815260040161028c90612f3f565b600061168c87610f36878663ffffffff610b0116565b905060006116a487610f36878663ffffffff610b0116565b90506116b08282612682565b9850505050505050505090565b6000816001600160a01b0316836001600160a01b031663481c6a756040518163ffffffff1660e01b815260040160206040518083038186803b15801561170257600080fd5b505afa158015611716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173a9190612b2e565b6001600160a01b0316149392505050565b60008261175a57506000610a29565b8282028284828161176757fe5b0414610a265760405162461bcd60e51b815260040161028c9061309c565b6000610a2683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612699565b600081848411156117eb5760405162461bcd60e51b815260040161028c9190612eeb565b505050900390565b60008060008060008061180461250e565b9350935093509350838211801561181a57508281115b6118365760405162461bcd60e51b815260040161028c90612efe565b611846828563ffffffff610b0116565b611856828563ffffffff610b0116565b95509550505050509091565b60045460025460095460009261188f926001600160a01b039283169291821691168663ffffffff611b9716565b6005546002546009546118b9926001600160a01b039182169290821691168563ffffffff611b9716565b6004546005546009546060926001600160a01b0390811692811691879187916001918291166118ef42603c63ffffffff6122e016565b604051602401611906989796959493929190612e9f565b60408051601f198184030181529181526020820180516001600160e01b031662e8e33760e81b17905260095460025491516347b7819960e11b81529293506001600160a01b0390811692638f6f0332926119699216906000908690600401612e34565b600060405180830381600087803b15801561198357600080fd5b505af1158015611997573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119bf9190810190612c15565b506003546009546040516370a0823160e01b81526001600160a01b03928316926370a08231926119f492911690600401612d94565b60206040518083038186803b158015611a0c57600080fd5b505afa158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612ce4565b949350505050565b600354600854600954611a76926001600160a01b039182169290821691168463ffffffff611b9716565b606081604051602401611a899190613201565b60408051601f198184030181529181526020820180516001600160e01b031663534a7e1d60e11b17905260095460085491516347b7819960e11b81529293506001600160a01b0390811692638f6f033292610aa69216906000908690600401612e34565b6040516373b2e76b60e11b81526000906001600160a01b0383169063e765ced690611b1d90600190600401613201565b60206040518083038186803b158015611b3557600080fd5b505afa158015611b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a299190612b2e565b6000610a2682610a1a85670de0b6b3a764000063ffffffff61174b16565b670de0b6b3a764000090565b60608282604051602401611bac929190612da8565b60408051601f198184030181529181526020820180516001600160e01b031663095ea7b360e01b179052516347b7819960e11b81529091506001600160a01b03861690638f6f033290610bba9087906000908690600401612e34565b60408051600280825260608083018452926020830190803683370190505090508481600081518110611c3657fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110611c6457fe5b6001600160a01b03928316602091820292909201015260095460609185918591859116611c984260b463ffffffff6122e016565b604051602401611cac95949392919061320a565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b17905260095460025491516347b7819960e11b81529293506001600160a01b0390811692638f6f033292611d109216906000908690600401612e34565b600060405180830381600087803b158015611d2a57600080fd5b505af1158015611d3e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611d669190810190612c15565b50505050505050565b6000610a26828463ffffffff611b6d16565b6000611d8d84846126d0565b905080158015611d9d5750600082115b15611e1457611dac8484612757565b611e0f576040516304e3532760e41b81526001600160a01b03851690634e35327090611ddc908690600401612d94565b600060405180830381600087803b158015611df657600080fd5b505af1158015611e0a573d6000803e3d6000fd5b505050505b611e91565b808015611e1f575081155b15611e9157611e2e8484612757565b611e9157604051636f86c89760e01b81526001600160a01b03851690636f86c89790611e5e908690600401612d94565b600060405180830381600087803b158015611e7857600080fd5b505af1158015611e8c573d6000803e3d6000fd5b505050505b836001600160a01b0316632ba57d1784611eaa85611eff565b6040518363ffffffff1660e01b8152600401611ec7929190612da8565b600060405180830381600087803b158015611ee157600080fd5b505af1158015611ef5573d6000803e3d6000fd5b5050505050505050565b6000600160ff1b82106109f85760405162461bcd60e51b815260040161028c9061314b565b60405163df5e9b2960e01b81526001600160a01b0386169063df5e9b2990611f50908790600401612d94565b60206040518083038186803b158015611f6857600080fd5b505afa158015611f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa09190612bf5565b612014576040516304e3532760e41b81526001600160a01b03861690634e35327090611fd0908790600401612d94565b600060405180830381600087803b158015611fea57600080fd5b505af1158015611ffe573d6000803e3d6000fd5b5050505061200f85858585856127e3565b6122d9565b604051637d96659360e01b81526001600160a01b03861690637d966593906120429087908790600401612dc1565b60206040518083038186803b15801561205a57600080fd5b505afa15801561206e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120929190612bf5565b6120a35761200f85858585856127e3565b8115612110576040516363a90fc160e01b81526001600160a01b038616906363a90fc1906120d990879087908790600401612e10565b600060405180830381600087803b1580156120f357600080fd5b505af1158015612107573d6000803e3d6000fd5b505050506122d9565b6040516366cb8d2f60e01b81526001600160a01b038616906366cb8d2f9061213c908790600401612d94565b60206040518083038186803b15801561215457600080fd5b505afa158015612168573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218c9190612ce4565b158015612219575060405163a7bdad0360e01b81526001600160a01b0386169063a7bdad03906121c0908790600401612d94565b60006040518083038186803b1580156121d857600080fd5b505afa1580156121ec573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122149190810190612b4a565b516001145b1561227d57604051636f86c89760e01b81526001600160a01b03861690636f86c8979061224a908790600401612d94565b600060405180830381600087803b15801561226457600080fd5b505af1158015612278573d6000803e3d6000fd5b505050505b60405163acf3f07760e01b81526001600160a01b0386169063acf3f077906122ab9087908790600401612dc1565b600060405180830381600087803b1580156122c557600080fd5b505af1158015610fac573d6000803e3d6000fd5b5050505050565b600082820183811015610a265760405162461bcd60e51b815260040161028c90612f80565b8015610c13576040516370a0823160e01b81526000906001600160a01b038516906370a082319061233a908890600401612d94565b60206040518083038186803b15801561235257600080fd5b505afa158015612366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238a9190612ce4565b905061239885858585610b43565b6040516370a0823160e01b81526000906001600160a01b038616906370a08231906123c7908990600401612d94565b60206040518083038186803b1580156123df57600080fd5b505afa1580156123f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124179190612ce4565b9050612429828463ffffffff610b0116565b8114610c105760405162461bcd60e51b815260040161028c906130dd565b6000806000806124556128d5565b915091506000600360009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156124a957600080fd5b505afa1580156124bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e19190612ce4565b90506124f3838263ffffffff611b6d16565b612503838363ffffffff611b6d16565b945094505050509091565b60008060008060008061251f6129d5565b600480546009546040516370a0823160e01b81529496509294506000936001600160a01b03918216936370a082319361255c939091169101612d94565b60206040518083038186803b15801561257457600080fd5b505afa158015612588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ac9190612ce4565b6005546009546040516370a0823160e01b81529293506000926001600160a01b03928316926370a08231926125e692911690600401612d94565b60206040518083038186803b1580156125fe57600080fd5b505afa158015612612573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126369190612ce4565b90506000612653600a54610ecc85886122e090919063ffffffff16565b90506000612670600a54610ecc85886122e090919063ffffffff16565b919a9199509297509095509350505050565b6000818310156126925781610a26565b5090919050565b600081836126ba5760405162461bcd60e51b815260040161028c9190612eeb565b5060008385816126c657fe5b0495945050505050565b600080836001600160a01b03166366cb8d2f846040518263ffffffff1660e01b81526004016126ff9190612d94565b60206040518083038186803b15801561271757600080fd5b505afa15801561272b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061274f9190612ce4565b139392505050565b600080836001600160a01b031663a7bdad03846040518263ffffffff1660e01b81526004016127869190612d94565b60006040518083038186803b15801561279e57600080fd5b505afa1580156127b2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127da9190810190612b4a565b51119392505050565b60405163ea0ee55960e01b81526001600160a01b0386169063ea0ee559906128119087908790600401612dc1565b600060405180830381600087803b15801561282b57600080fd5b505af115801561283f573d6000803e3d6000fd5b50506040516363a90fc160e01b81526001600160a01b03881692506363a90fc1915061287390879087908790600401612e10565b600060405180830381600087803b15801561288d57600080fd5b505af11580156128a1573d6000803e3d6000fd5b50506040516326898fe160e01b81526001600160a01b03881692506326898fe191506122ab90879087908690600401612ddb565b600554600454600091829182916001600160a01b03908116911610612905576005546001600160a01b0316612912565b6004546001600160a01b03165b9050600080600360009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561296557600080fd5b505afa158015612979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299d9190612cfc565b506004546001600160701b039283169450911691506001600160a01b038481169116146129cb578082612503565b9094909350915050565b6000806000806129e36128d5565b915091506000600360009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a3757600080fd5b505afa158015612a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a6f9190612ce4565b6008546009546040516370a0823160e01b81529293506000926001600160a01b03928316926370a0823192612aa992911690600401612d94565b60206040518083038186803b158015612ac157600080fd5b505afa158015612ad5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612af99190612ce4565b9050612b0f82610a1a868463ffffffff61174b16565b61185683610a1a868563ffffffff61174b16565b8051610a29816132cd565b600060208284031215612b3f578081fd5b8151610a26816132cd565b60006020808385031215612b5c578182fd5b825167ffffffffffffffff80821115612b73578384fd5b81850186601f820112612b84578485fd5b8051925081831115612b94578485fd5b8383029150612ba484830161327a565b8381528481019082860184840187018a1015612bbe578788fd5b8794505b85851015612be857612bd48a82612b23565b835260019490940193918601918601612bc2565b5098975050505050505050565b600060208284031215612c06578081fd5b81518015158114610a26578182fd5b600060208284031215612c26578081fd5b815167ffffffffffffffff80821115612c3d578283fd5b81840185601f820112612c4e578384fd5b8051925081831115612c5e578384fd5b612c71601f8401601f191660200161327a565b9150828252856020848301011115612c87578384fd5b612c988360208401602084016132a1565b50949350505050565b600080600080600060a08688031215612cb8578081fd5b8535612cc3816132cd565b97602087013597506040870135966060810135965060800135945092505050565b600060208284031215612cf5578081fd5b5051919050565b600080600060608486031215612d10578283fd5b8351612d1b816132e2565b6020850151909350612d2c816132e2565b604085015190925063ffffffff81168114612d45578182fd5b809150509250925092565b600060208284031215612d61578081fd5b5035919050565b60008151808452612d808160208601602086016132a1565b601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03848116825283166020820152606060408201819052600090612e0790830184612d68565b95945050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060018060a01b038516825283602083015260606040830152612e076060830184612d68565b6001600160a01b0397881681529587166020870152604086019490945260ff92831660608601529116608084015290921660a082015260c081019190915260e00190565b6001600160a01b03988916815296881660208801526040870195909552606086019390935260ff91821660808601521660a084015290921660c082015260e08101919091526101000190565b600060208252610a266020830184612d68565b60208082526021908201527f536574546f6b656e20617373657473206d757374206265203e206465736972656040820152601960fa1b606082015260800190565b60208082526021908201527f536574546f6b656e20617373657473206d757374206265203c206465736972656040820152601960fa1b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526017908201527f43616c6c6572206d75737420626520536574546f6b656e000000000000000000604082015260600190565b60208082526017908201527f4d6179206f6e6c792062652063616c6c6564206f6e6365000000000000000000604082015260600190565b6020808252818101527f53616665436173743a2076616c7565206d75737420626520706f736974697665604082015260600190565b60208082526022908201527f55736572206d75737420686176652073756666696369656e7420536574546f6b60408201526132b760f11b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252601d908201527f496e76616c696420706f7374207472616e736665722062616c616e6365000000604082015260600190565b6020808252601b908201527f44656c7461206d757374206265206c657373207468616e206d61780000000000604082015260600190565b60208082526028908201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604082015267371034b73a191a9b60c11b606082015260800190565b6020808252601c908201527f4d7573742062652074686520536574546f6b656e206d616e6167657200000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156132595784516001600160a01b031683529383019391830191600101613234565b50506001600160a01b03969096166060850152505050608001529392505050565b60405181810167ffffffffffffffff8111828210171561329957600080fd5b604052919050565b60005b838110156132bc5781810151838201526020016132a4565b83811115610c135750506000910152565b6001600160a01b03811681146107b257600080fd5b6001600160701b03811681146107b257600080fdfea264697066735822122024c05719583c2863f917e50e445d0eb83901a26891c81b503984feb61833dbdc64736f6c634300060a00330000000000000000000000009048278ca7e874f9338e4898c436ab07aa4547010000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000000a9f9974c3db9bc5ffd4c1de13651277c264dad4000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c000000000000000000000000f091720dea579d7eec922d8b2a3a67ba522ccf6d0000000000000000000000003d07e0780fd534759dbf1d7e3d92f454b783c4f40000000000000000000000003d07e0780fd534759dbf1d7e3d92f454b783c4f400000000000000000000000069bdb276a17dd90f9d3a545944ccb20e593ae8e3

Deployed ByteCode Sourcemap

100086:15966:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;100971:31;;;:::i;:::-;;;;;;;;;;;;;;;;102873:1587;;;;;;;;;:::i;:::-;;100539:27;;;:::i;:::-;;;;;;;;102134:68;;;:::i;100421:29::-;;;:::i;100377:37::-;;;:::i;102590:106::-;;;:::i;105071:311::-;;;:::i;100486:22::-;;;:::i;100797:24::-;;;:::i;100865:28::-;;;:::i;100457:22::-;;;:::i;102488:94::-;;;:::i;100729:32::-;;;:::i;100573:31::-;;;:::i;100933:::-;;;:::i;100611:25::-;;;:::i;100515:17::-;;;:::i;102210:270::-;;;:::i;102704:161::-;;;;;;;;;:::i;101009:30::-;;;:::i;100643:32::-;;;:::i;40243:29::-;;;:::i;104468:595::-;;;;;;;;;:::i;100971:31::-;;;;:::o;102873:1587::-;85269:1;85875:7;;:19;;85867:63;;;;-1:-1:-1;;;85867:63:0;;;;;;;;;;;;;;;;;85269:1;86008:7;:18;102967:8:::1;::::0;:30:::1;::::0;-1:-1:-1;;;102967:30:0;;103001:17;;-1:-1:-1;;;;;102967:8:0::1;::::0;:18:::1;::::0;:30:::1;::::0;102986:10:::1;::::0;102967:30:::1;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:51;;102959:98;;;;-1:-1:-1::0;;;102959:98:0::1;;;;;;;;;103070:8;::::0;:44:::1;::::0;-1:-1:-1;;;103070:44:0;;-1:-1:-1;;;;;103070:8:0;;::::1;::::0;:13:::1;::::0;:44:::1;::::0;103084:10:::1;::::0;103096:17;;103070:44:::1;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;103149:8:0::1;::::0;103194:7:::1;::::0;103149:69:::1;::::0;-1:-1:-1;;;103149:69:0;;103127:19:::1;::::0;-1:-1:-1;103149:81:0::1;::::0;-1:-1:-1;;;;;;103149:8:0;;::::1;::::0;:36:::1;::::0;:69:::1;::::0;103194:7;::::1;::::0;103212:4:::1;::::0;103149:69:::1;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:79;:81::i;:::-;103127:103:::0;-1:-1:-1;103243:21:0::1;103267:41;103127:103:::0;103290:17;103267:41:::1;:22;:41;:::i;:::-;103243:65;;103321:23;103330:13;103321:8;:23::i;:::-;103357:14;103374:39;103399:13;;103374;:24;;:39;;;;:::i;:::-;103456:7;::::0;103357:56;;-1:-1:-1;103424:80:0::1;::::0;-1:-1:-1;;;;;103456:7:0::1;103466:10;103478:25;:13:::0;103357:56;103478:25:::1;:17;:25;:::i;:::-;103424:8;::::0;-1:-1:-1;;;;;103424:8:0::1;::::0;:80;;::::1;:23;:80;:::i;:::-;103547:7;::::0;103557:12:::1;::::0;103515:8:::1;::::0;:63:::1;::::0;-1:-1:-1;;;;;103515:8:0;;::::1;::::0;103547:7;;::::1;::::0;103557:12:::1;103571:6:::0;103515:63:::1;:23;:63;:::i;:::-;103614:8;::::0;103658::::1;::::0;;103614:54:::1;::::0;-1:-1:-1;;;103614:54:0;;103591:20:::1;::::0;103614:66:::1;::::0;-1:-1:-1;;;;;103614:8:0;;::::1;::::0;:35:::1;::::0;:54:::1;::::0;103658:8;;::::1;::::0;103614:54:::1;;;:66;103591:89:::0;-1:-1:-1;103691:24:0::1;103718:42;103591:89:::0;103742:17;103718:42:::1;:23;:42;:::i;:::-;103691:69;;103771:19;103793:42;103821:13;;103793:16;:27;;:42;;;;:::i;:::-;103878:8;::::0;103771:64;;-1:-1:-1;103846:89:0::1;::::0;-1:-1:-1;;;;;103878:8:0::1;103889:10;103901:33;:16:::0;103771:64;103901:33:::1;:20;:33;:::i;103846:89::-;103978:8;::::0;103989:12:::1;::::0;103946:8:::1;::::0;:69:::1;::::0;-1:-1:-1;;;;;103946:8:0;;::::1;::::0;103978;;::::1;::::0;103989:12:::1;104003:11:::0;103946:69:::1;:23;:69;:::i;:::-;104051:8;::::0;104095::::1;::::0;104051:54:::1;::::0;-1:-1:-1;;;104051:54:0;;104028:20:::1;::::0;104051:66:::1;::::0;-1:-1:-1;;;;;104051:8:0;;::::1;::::0;:35:::1;::::0;:54:::1;::::0;104095:8:::1;::::0;104051:54:::1;;;;:66;104028:89:::0;-1:-1:-1;104128:24:0::1;104155:42;104028:89:::0;104179:17;104155:42:::1;:23;:42;:::i;:::-;104128:69;;104208:19;104230:42;104258:13;;104230:16;:27;;:42;;;;:::i;:::-;104315:8;::::0;104208:64;;-1:-1:-1;104283:89:0::1;::::0;-1:-1:-1;;;;;104315:8:0::1;104326:10;104338:33;:16:::0;104208:64;104338:33:::1;:20;:33;:::i;104283:89::-;104415:8;::::0;104426:12:::1;::::0;104383:8:::1;::::0;:69:::1;::::0;-1:-1:-1;;;;;104383:8:0;;::::1;::::0;104415;;::::1;::::0;104426:12:::1;104440:11:::0;104383:69:::1;:23;:69;:::i;:::-;-1:-1:-1::0;;85225:1:0;86187:22;;-1:-1:-1;;;;;;;;102873:1587:0:o;100539:27::-;;;-1:-1:-1;;;;;100539:27:0;;:::o;102134:68::-;85269:1;85875:7;;:19;;85867:63;;;;-1:-1:-1;;;85867:63:0;;;;;;;;;85269:1;86008:7;:18;102185:9:::1;:7;:9::i;:::-;85225:1:::0;86187:22;;102134:68::o;100421:29::-;;;-1:-1:-1;;;;;100421:29:0;;:::o;100377:37::-;;;-1:-1:-1;;;;;100377:37:0;;:::o;102590:106::-;85269:1;85875:7;;:19;;85867:63;;;;-1:-1:-1;;;85867:63:0;;;;;;;;;85269:1;86008:7;:18;102644:13:::1;102655:1;102644:10;:13::i;:::-;102670:18;:16;:18::i;105071:311::-:0;105154:8;;-1:-1:-1;;;;;105154:8:0;105132:10;:31;105124:67;;;;-1:-1:-1;;;105124:67:0;;;;;;;;;105224:8;;105251;;105224:37;;-1:-1:-1;;;105224:37:0;;105204:17;;-1:-1:-1;;;;;105224:8:0;;;;:18;;:37;;105251:8;;;;105224:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;105204:57;;105274:19;105283:9;105274:8;:19::i;:::-;105306:37;105333:9;105306:26;:37::i;:::-;105356:18;:16;:18::i;:::-;105071:311;:::o;100486:22::-;;;-1:-1:-1;;;;;100486:22:0;;:::o;100797:24::-;;;;:::o;100865:28::-;;;;:::o;100457:22::-;;;-1:-1:-1;;;;;100457:22:0;;:::o;102488:94::-;85269:1;85875:7;;:19;;85867:63;;;;-1:-1:-1;;;85867:63:0;;;;;;;;;85269:1;86008:7;:18;102537:15:::1;:13;:15::i;:::-;102565:9;:7;:9::i;100729:32::-:0;;;;:::o;100573:31::-;;;-1:-1:-1;;;;;100573:31:0;;:::o;100933:::-;;;;:::o;100611:25::-;;;-1:-1:-1;;;;;100611:25:0;;:::o;100515:17::-;;;-1:-1:-1;;;;;100515:17:0;;:::o;102210:270::-;85269:1;85875:7;;:19;;85867:63;;;;-1:-1:-1;;;85867:63:0;;;;;;;;;85269:1;86008:7;:18;102264:13:::1;102275:1;102264:10;:13::i;:::-;102290:23;102316:31;:29;:31::i;:::-;102290:57;;102360:25;102369:15;102360:8;:25::i;:::-;102398:43;102425:15;102398:26;:43::i;:::-;102454:18;:16;:18::i;:::-;-1:-1:-1::0;85225:1:0;86187:22;;102210:270::o;102704:161::-;85269:1;85875:7;;:19;;85867:63;;;;-1:-1:-1;;;85867:63:0;;;;;;;;;85269:1;86008:7;:18;102788:30:::1;102799:18:::0;102788:10:::1;:30::i;101009:::-:0;;;;:::o;100643:32::-;;;;:::o;40243:29::-;;;-1:-1:-1;;;;;40243:29:0;;:::o;104468:595::-;104703:9;104714:10;40679:32;40692:9;40703:7;40679:12;:32::i;:::-;40671:73;;;;-1:-1:-1;;;40671:73:0;;;;;;;;;104758:8:::1;::::0;-1:-1:-1;;;;;104758:8:0::1;104750:31:::0;104742:67:::1;;;;-1:-1:-1::0;;;104742:67:0::1;;;;;;;;;104822:8;:20:::0;;-1:-1:-1;;;;;;104822:20:0::1;-1:-1:-1::0;;;;;104822:20:0;::::1;::::0;;::::1;::::0;;;104853:17:::1;:38:::0;;;104902:17:::1;:38:::0;;;104951:9:::1;:22:::0;;;104984:13:::1;:30:::0;;;105027:28:::1;::::0;;-1:-1:-1;;;105027:28:0;;;;:26:::1;::::0;:28:::1;::::0;;::::1;::::0;-1:-1:-1;;105027:28:0;;;;;;;;-1:-1:-1;104822:20:0;105027:28;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;104468:595:::0;;;;;;;:::o;80150:171::-;80206:7;80243:1;80234:5;:10;;80226:55;;;;-1:-1:-1;;;80226:55:0;;;;;;;;;-1:-1:-1;80307:5:0;80150:171::o;23225:126::-;23290:7;23317:26;21686:8;23317;:1;23323;23317:8;:5;:8;:::i;:::-;:12;:26;:12;:26;:::i;:::-;23310:33;;23225:126;;;;;:::o;109981:226::-;110045:25;110118:16;110073:62;;;;;;;;;;;;;-1:-1:-1;;110073:62:0;;;;;;;;;;;;;;-1:-1:-1;;;;;110073:62:0;-1:-1:-1;;;110073:62:0;;;110148:8;;110172;;110148:51;;-1:-1:-1;;;110148:51:0;;110073:62;;-1:-1:-1;;;;;;110148:8:0;;;;:15;;:51;;110172:8;;-1:-1:-1;;110073:62:0;;110148:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;110148:51:0;;;;;;;;;;;;;;;109981:226;;:::o;72738:136::-;72796:7;72823:43;72827:1;72830;72823:43;;;;;;;;;;;;;;;;;:3;:43::i;64717:367::-;64891:13;;64887:190;;64921:21;64998:3;65003:9;64945:68;;;;;;;;;;;;;;-1:-1:-1;;64945:68:0;;;;;;;;;;;;;;-1:-1:-1;;;;;64945:68:0;-1:-1:-1;;;64945:68:0;;;65028:37;-1:-1:-1;;;65028:37:0;;64945:68;;-1:-1:-1;;;;;;65028:16:0;;;;;:37;;65045:6;;-1:-1:-1;;64945:68:0;;65028:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;65028:37:0;;;;;;;;;;;;;;;64887:190;;64717:367;;;;:::o;105448:319::-;105487:13;105498:1;105487:10;:13::i;:::-;105514:24;105540;105568:28;:26;:28::i;:::-;105513:83;;;;105609:17;105629:59;105653:16;105671;105629:23;:59::i;:::-;105609:79;;105701:27;105718:9;105701:16;:27::i;:::-;105741:18;:16;:18::i;105906:2270::-;105974:19;106131:10;;105974:19;;;;;;;;106131:27;;-1:-1:-1;;;;;106131:10:0;:25;:27::i;:::-;106176:8;;;106195;;106131:74;;-1:-1:-1;;;106131:74:0;;-1:-1:-1;;;;;106131:36:0;;;;;;:74;;106176:8;;;106195;;;;106131:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;106244:8;;;106271;;106244:37;;-1:-1:-1;;;106244:37:0;;106102:103;;-1:-1:-1;106218:23:0;;-1:-1:-1;;;;;106244:8:0;;;;:18;;:37;;106271:8;;106244:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;106318:8;;106345;;106318:37;;-1:-1:-1;;;106318:37:0;;106218:63;;-1:-1:-1;106292:23:0;;-1:-1:-1;;;;;106318:8:0;;;;:18;;:37;;106345:8;;;106318:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;106292:63;;106436:29;106468:90;106541:16;;106468:68;106519:16;;106468:46;106495:18;106468:15;:26;;:46;;;;:::i;:::-;:50;:68;:50;:68;:::i;:90::-;106436:122;;106593:21;106575:15;:39;106571:898;;;106653:8;;106698;;-1:-1:-1;;;;;106653:8:0;;;;-1:-1:-1;106698:8:0;;-1:-1:-1;106739:49:0;106786:1;106739:42;:15;106759:21;106739:42;:19;:42;:::i;:49::-;106722:66;;106913:89;106985:16;;106913:67;106963:16;;106913:45;106939:18;106913:14;:25;;:45;;;;:::i;:89::-;106895:107;;106571:898;;;107057:8;;107102;;107318:16;;107296;;-1:-1:-1;;;;;107057:8:0;;;;-1:-1:-1;107102:8:0;;;;;-1:-1:-1;107143:192:0;;:170;;:114;107238:18;107143:83;107224:1;107143:170;:21;107203:15;107143:59;:76::i;:83::-;:94;:114;:94;:114;:::i;:192::-;107126:209;;107368:89;107440:16;;107368:67;107418:16;;107368:45;107394:18;107368:14;:25;;:45;;;;:::i;:89::-;107350:107;;106571:898;107485:22;;107481:287;;107554:14;107532:18;:36;;107524:76;;;;-1:-1:-1;;;107524:76:0;;;;;;;;;107633:73;107691:14;107633:46;:15;107660:18;107633:46;:26;:46;:::i;:::-;:57;:73;:57;:73;:::i;:::-;107615:91;;107738:18;107721:35;;107481:287;107848:94;107889:52;107923:17;;107889:29;:27;:29::i;:::-;:33;:52;:33;:52;:::i;:::-;107848:15;;:94;:40;:94;:::i;:::-;107999:13;;107955:8;;107830:112;;-1:-1:-1;107955:75:0;;-1:-1:-1;;;;;107955:8:0;;;;107978:11;;107999:13;108015:14;107955:75;:22;:75;:::i;:::-;108045:18;;108041:128;;108080:77;108100:11;108113:10;108125:14;108141:15;108080:19;:77::i;:::-;105906:2270;;;;;;;;;:::o;114673:863::-;114743:8;;:22;;;-1:-1:-1;;;114743:22:0;;;;114721:19;;-1:-1:-1;;;;;114743:8:0;;:20;;:22;;;;;;;;;;;;;;:8;:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;114802:8;;;114829;;114802:37;;-1:-1:-1;;;114802:37:0;;114721:44;;-1:-1:-1;114776:23:0;;-1:-1:-1;;;;;114802:8:0;;;;:18;;:37;;114829:8;;114802:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;114876:8;;114903;;114876:37;;-1:-1:-1;;;114876:37:0;;114776:63;;-1:-1:-1;114850:23:0;;-1:-1:-1;;;;;114876:8:0;;;;:18;;:37;;114903:8;;;114876:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;114944:8;;114971;;114944:37;;-1:-1:-1;;;114944:37:0;;114850:63;;-1:-1:-1;114924:17:0;;-1:-1:-1;;;;;114944:8:0;;;;:18;;:37;;114971:8;;;114944:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;115126:8;;114924:57;;-1:-1:-1;115089:110:0;;-1:-1:-1;;;;;115126:8:0;115137:61;115169:11;115182:15;115137:31;:61::i;:::-;115089:8;;-1:-1:-1;;;;;115089:8:0;;:110;;:28;:110;:::i;:::-;115247:8;;115210:110;;-1:-1:-1;;;;;115247:8:0;115258:61;115290:11;115303:15;115258:31;:61::i;115210:110::-;115383:7;;115331:197;;-1:-1:-1;;;;;115383:7:0;115414:4;115434:66;:55;115466:11;115479:9;115434:31;:55::i;:::-;:64;:66::i;:::-;115331:197;;;;;;;;;-1:-1:-1;115331:197:0;;:8;;-1:-1:-1;;;;;115331:8:0;;:197;;;;:29;:197;:::i;109032:618::-;109147:7;;109165:13;;109116:8;;:84;;-1:-1:-1;;;;;109116:8:0;;;;109147:7;;;;109165:13;109181:18;109116:84;:22;:84;:::i;:::-;109376:8;;109399;;109495;;109213:33;;-1:-1:-1;;;;;109376:8:0;;;;109399;;;109422:18;;109376:8;;;;109495;109519:11;:3;109527:2;109519:11;:7;:11;:::i;:::-;109249:316;;;;;;;;;;;;;;;;;;;-1:-1:-1;;109249:316:0;;;;;;;;;;;;;;-1:-1:-1;;;;;109249:316:0;-1:-1:-1;;;109249:316:0;;;109578:8;;109602:13;;109578:64;;-1:-1:-1;;;109578:64:0;;109249:316;;-1:-1:-1;;;;;;109578:8:0;;;;:15;;:64;;109602:13;;-1:-1:-1;;109249:316:0;;109578:64;;;;110215:690;110260:8;;110284;;110298:38;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;110298:38:0;-1:-1:-1;;;110298:38:0;;;110260:77;;-1:-1:-1;;;110260:77:0;;-1:-1:-1;;;;;110260:8:0;;;;:15;;:77;;110284:8;;;110260;;110298:38;;110260:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;110260:77:0;;;;;;;;;;;;;;-1:-1:-1;110371:3:0;;110393:8;;110371:32;;-1:-1:-1;;;110371:32:0;;110350:18;;-1:-1:-1;;;;;110371:3:0;;;;:13;;:32;;110393:8;;;;110371:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;110440:8;;;110467;;110440:37;;-1:-1:-1;;;110440:37:0;;110350:53;;-1:-1:-1;110414:23:0;;-1:-1:-1;;;;;110440:8:0;;;;:18;;:37;;110467:8;;110440:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;110521:3;;110535:13;;110490:8;;110414:63;;-1:-1:-1;110490:72:0;;-1:-1:-1;;;;;110490:8:0;;;;110521:3;;;110535:13;110551:10;110490:72;:22;:72;:::i;:::-;110601:3;;110615:8;;110573:67;;-1:-1:-1;;;;;110601:3:0;;;;110615:8;110626:10;110601:3;110573:19;:67::i;:::-;110688:8;;;110715;;110688:37;;-1:-1:-1;;;110688:37:0;;110653:32;;-1:-1:-1;;;;;110688:8:0;;;;:18;;:37;;110715:8;;;110688:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;110653:72;;110736:11;110750:67;110807:9;;110750:45;110779:15;110750:24;:28;;:45;;;;:::i;:67::-;110868:8;;110879:12;;110830:8;;110736:81;;-1:-1:-1;110830:67:0;;-1:-1:-1;;;;;110830:8:0;;;;110868;;;110879:12;110736:81;110830:67;:29;:67;:::i;112183:855::-;112246:24;112284;112310;112338:27;:25;:27::i;:::-;112283:82;;;;112393:18;112426;112459:26;112500;112540:31;:29;:31::i;:::-;112378:193;;;;;;;;112617:10;112596:18;:31;:66;;;;;112652:10;112631:18;:31;112596:66;112588:112;;;;-1:-1:-1;;;112588:112:0;;;;;;;;;112763:27;112793:63;112839:16;112793:34;:10;112808:18;112793:34;:14;:34;:::i;:63::-;112763:93;-1:-1:-1;112867:27:0;112897:63;112943:16;112897:34;:10;112912:18;112897:34;:14;:34;:::i;:63::-;112867:93;;112980:50;112989:19;113010;112980:8;:50::i;:::-;112973:57;;;;;;;;;;112183:855;:::o;44659:146::-;44742:4;44789:8;-1:-1:-1;;;;;44766:31:0;:9;-1:-1:-1;;;;;44766:17:0;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;44766:31:0;;;44659:146;-1:-1:-1;;;44659:146:0:o;73628:471::-;73686:7;73931:6;73927:47;;-1:-1:-1;73961:1:0;73954:8;;73927:47;73998:5;;;74002:1;73998;:5;:1;74022:5;;;;;:10;74014:56;;;;-1:-1:-1;;;74014:56:0;;;;;;;;74575:132;74633:7;74660:39;74664:1;74667;74660:39;;;;;;;;;;;;;;;;;:3;:39::i;73177:192::-;73263:7;73299:12;73291:6;;;;73283:29;;;;-1:-1:-1;;;73283:29:0;;;;;;;;;;-1:-1:-1;;;73335:5:0;;;73177:192::o;111571:604::-;111631:22;111655;111705:23;111743;111781:26;111822;111862:31;:29;:31::i;:::-;111690:203;;;;;;;;111935:15;111914:18;:36;:76;;;;;111975:15;111954:18;:36;111914:76;111906:122;;;;-1:-1:-1;;;111906:122:0;;;;;;;;;112063:39;:18;112086:15;112063:39;:22;:39;:::i;:::-;112117;:18;112140:15;112117:39;:22;:39;:::i;:::-;112041:126;;;;;;;;111571:604;;:::o;108184:840::-;108340:8;;108359:13;;108309:8;;108289:7;;108309:84;;-1:-1:-1;;;;;108309:8:0;;;;108340;;;;108359:13;108375:17;108309:84;:22;:84;:::i;:::-;108435:8;;108454:13;;108404:8;;:84;;-1:-1:-1;;;;;108404:8:0;;;;108435;;;;108454:13;108470:17;108404:84;:22;:84;:::i;:::-;108666:8;;108689;;108816;;108501:30;;-1:-1:-1;;;;;108666:8:0;;;;108689;;;108712:17;;108744;;108666:8;;;;108816;108840:11;:3;108848:2;108840:11;:7;:11;:::i;:::-;108534:352;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;108534:352:0;;;;;;;;;;;;;;-1:-1:-1;;;;;108534:352:0;-1:-1:-1;;;108534:352:0;;;108899:8;;108923:13;;108899:61;;-1:-1:-1;;;108899:61:0;;108534:352;;-1:-1:-1;;;;;;108899:8:0;;;;:15;;:61;;108923:13;;-1:-1:-1;;108534:352:0;;108899:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;108899:61:0;;;;;;;;;;;;;;-1:-1:-1;108980:7:0;;109006:8;;108980:36;;-1:-1:-1;;;108980:36:0;;-1:-1:-1;;;;;108980:7:0;;;;:17;;:36;;109006:8;;;108980:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;108973:43;108184:840;-1:-1:-1;;;;108184:840:0:o;109658:315::-;109761:7;;109779:8;;109730;;:77;;-1:-1:-1;;;;;109730:8:0;;;;109761:7;;;;109779:8;109790:16;109730:77;:22;:77;:::i;:::-;109818:23;109886:16;109844:59;;;;;;;;;;;;;-1:-1:-1;;109844:59:0;;;;;;;;;;;;;;-1:-1:-1;;;;;109844:59:0;-1:-1:-1;;;109844:59:0;;;109916:8;;109940;;109916:49;;-1:-1:-1;;;109916:49:0;;109844:59;;-1:-1:-1;;;;;;109916:8:0;;;;:15;;:49;;109940:8;;-1:-1:-1;;109844:59:0;;109916:49;;;;9126:174;9243:48;;-1:-1:-1;;;9243:48:0;;9198:12;;-1:-1:-1;;;;;9243:22:0;;;;;:48;;8434:1;;9243:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24171:126;24236:7;24263:26;24287:1;24263:19;:1;21686:8;24263:19;:5;:19;:::i;22131:93::-;21686:8;22131:93;:::o;64055:326::-;64229:21;64305:8;64315:9;64253:72;;;;;;;;;;;;;;-1:-1:-1;;64253:72:0;;;;;;;;;;;;;;-1:-1:-1;;;;;64253:72:0;-1:-1:-1;;;64253:72:0;;;64336:37;-1:-1:-1;;;64336:37:0;;64253:72;;-1:-1:-1;;;;;;64336:16:0;;;;;:37;;64353:6;;-1:-1:-1;;64253:72:0;;64336:37;;;;110913:650;111124:16;;;111138:1;111124:16;;;111100:21;111124:16;;;;;111100:21;111124:16;;;;;;;;;;-1:-1:-1;111124:16:0;111100:40;;111161:10;111151:4;111156:1;111151:7;;;;;;;;;;;;;:20;-1:-1:-1;;;;;111151:20:0;;;-1:-1:-1;;;;;111151:20:0;;;;;111192:9;111182:4;111187:1;111182:7;;;;;;;;-1:-1:-1;;;;;111182:19:0;;;:7;;;;;;;;;:19;111441:8;;111214:23;;111362:9;;111386:13;;111414:4;;111441:8;111465:12;:3;111473;111465:12;:7;:12;:::i;:::-;111240:248;;;;;;;;;;;;;;;;;-1:-1:-1;;111240:248:0;;;;;;;;;;;;;;-1:-1:-1;;;;;111240:248:0;-1:-1:-1;;;111240:248:0;;;111501:8;;111525:13;;111501:54;;-1:-1:-1;;;111501:54:0;;111240:248;;-1:-1:-1;;;;;;111501:8:0;;;;:15;;:54;;111525:13;;-1:-1:-1;;111240:248:0;;111501:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;111501:54:0;;;;;;;;;;;;;;;110913:650;;;;;;:::o;34914:181::-;35018:7;35045:42;:14;35071:15;35045:42;:25;:42;:::i;30164:840::-;30272:20;30295:41;30314:9;30325:10;30295:18;:41::i;:::-;30272:64;;30352:15;30351:16;:32;;;;;30382:1;30371:8;:12;30351:32;30347:571;;;30508:42;30528:9;30539:10;30508:19;:42::i;:::-;30503:118;;30571:34;;-1:-1:-1;;;30571:34:0;;-1:-1:-1;;;;;30571:22:0;;;;;:34;;30594:10;;30571:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30503:118;30347:571;;;30642:15;:32;;;;-1:-1:-1;30661:13:0;;30642:32;30638:280;;;30791:42;30811:9;30822:10;30791:19;:42::i;:::-;30786:121;;30854:37;;-1:-1:-1;;;30854:37:0;;-1:-1:-1;;;;;30854:25:0;;;;;:37;;30880:10;;30854:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30786:121;30930:9;-1:-1:-1;;;;;30930:33:0;;30964:10;30976:19;:8;:17;:19::i;:::-;30930:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30164:840;;;;:::o;83332:181::-;83388:6;-1:-1:-1;;;83415:5:0;:14;83407:67;;;;-1:-1:-1;;;83407:67:0;;;;;;;;32163:1088;32379:33;;-1:-1:-1;;;32379:33:0;;-1:-1:-1;;;;;32379:21:0;;;;;:33;;32401:10;;32379:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32374:870;;32429:34;;-1:-1:-1;;;32429:34:0;;-1:-1:-1;;;;;32429:22:0;;;;;:34;;32452:10;;32429:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32478:68;32498:9;32509:10;32521:7;32530:8;32540:5;32478:19;:68::i;:::-;32374:870;;;32569:55;;-1:-1:-1;;;32569:55:0;;-1:-1:-1;;;;;32569:34:0;;;;;:55;;32604:10;;32616:7;;32569:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32564:680;;32641:68;32661:9;32672:10;32684:7;32693:8;32703:5;32641:19;:68::i;32564:680::-;32731:13;;32727:517;;32761:65;;-1:-1:-1;;;32761:65:0;;-1:-1:-1;;;;;32761:34:0;;;;;:65;;32796:10;;32808:7;;32817:8;;32761:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32727:517;;;32968:48;;-1:-1:-1;;;32968:48:0;;-1:-1:-1;;;;;32968:36:0;;;;;:48;;33005:10;;32968:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:53;:117;;;;-1:-1:-1;33025:48:0;;-1:-1:-1;;;33025:48:0;;-1:-1:-1;;;;;33025:36:0;;;;;:48;;33062:10;;33025:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;33025:48:0;;;;;;;;;;;;;;:55;33084:1;33025:60;32968:117;32964:195;;;33106:37;;-1:-1:-1;;;33106:37:0;;-1:-1:-1;;;;;33106:25:0;;;;;:37;;33132:10;;33106:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32964:195;33173:59;;-1:-1:-1;;;33173:59:0;;-1:-1:-1;;;;;33173:38:0;;;;;:59;;33212:10;;33224:7;;33173:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32727:517;32163:1088;;;;;:::o;72274:181::-;72332:7;72364:5;;;72388:6;;;;72380:46;;;;-1:-1:-1;;;72380:46:0;;;;;;;;65515:803;65695:13;;65691:620;;65818:44;;-1:-1:-1;;;65818:44:0;;65792:23;;-1:-1:-1;;;;;65818:24:0;;;;;:44;;65851:9;;65818:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;65792:70;;65879:56;65901:9;65912:6;65920:3;65925:9;65879:21;:56::i;:::-;66039:44;;-1:-1:-1;;;66039:44:0;;66018:18;;-1:-1:-1;;;;;66039:24:0;;;;;:44;;66072:9;;66039:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66018:65;-1:-1:-1;66204:30:0;:15;66224:9;66204:30;:19;:30;:::i;:::-;66190:10;:44;66164:135;;;;-1:-1:-1;;;66164:135:0;;;;;;;;113864:324;113924:7;113933;113954:13;113969;113986:18;:16;:18::i;:::-;113953:51;;;;114015:19;114037:7;;;;;;;;;-1:-1:-1;;;;;114037:7:0;-1:-1:-1;;;;;114037:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;114015:43;-1:-1:-1;114090:32:0;:8;114015:43;114090:32;:19;:32;:::i;:::-;114137;:8;114157:11;114137:32;:19;:32;:::i;:::-;114069:111;;;;;;;113864:324;;:::o;113131:675::-;113221:7;113230;113239;113248;113274:23;113299;113326:21;:19;:21::i;:::-;113384:8;;;113411;;113384:37;;-1:-1:-1;;;113384:37:0;;113273:74;;-1:-1:-1;113273:74:0;;-1:-1:-1;113358:23:0;;-1:-1:-1;;;;;113384:8:0;;;;:18;;:37;;113411:8;;;;113384:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;113458:8;;113485;;113458:37;;-1:-1:-1;;;113458:37:0;;113358:63;;-1:-1:-1;113432:23:0;;-1:-1:-1;;;;;113458:8:0;;;;:18;;:37;;113485:8;;;113458:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;113432:63;;113508:25;113536:66;113584:17;;113536:36;113556:15;113536;:19;;:36;;;;:::i;:66::-;113508:94;;113613:25;113641:66;113689:17;;113641:36;113661:15;113641;:19;;:36;;;;:::i;:66::-;113727:17;;;;-1:-1:-1;113765:15:0;;-1:-1:-1;113782:15:0;;-1:-1:-1;113131:675:0;-1:-1:-1;;;;113131:675:0:o;86483:107::-;86541:7;86573:1;86568;:6;;:14;;86581:1;86568:14;;;-1:-1:-1;86577:1:0;;86483:107;-1:-1:-1;86483:107:0:o;75203:278::-;75289:7;75324:12;75317:5;75309:28;;;;-1:-1:-1;;;75309:28:0;;;;;;;;;;;75348:9;75364:1;75360;:5;;;;;;;75203:278;-1:-1:-1;;;;;75203:278:0:o;28285:175::-;28376:4;28451:1;28400:9;-1:-1:-1;;;;;28400:36:0;;28437:10;28400:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:52;;28285:175;-1:-1:-1;;;28285:175:0:o;28604:183::-;28696:4;28778:1;28720:9;-1:-1:-1;;;;;28720:36:0;;28757:10;28720:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;28720:48:0;;;;;;;;;;;;;;:55;:59;;28604:183;-1:-1:-1;;;28604:183:0:o;33706:423::-;33916:56;;-1:-1:-1;;;33916:56:0;;-1:-1:-1;;;;;33916:35:0;;;;;:56;;33952:10;;33964:7;;33916:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;33983:65:0;;-1:-1:-1;;;33983:65:0;;-1:-1:-1;;;;;33983:34:0;;;-1:-1:-1;33983:34:0;;-1:-1:-1;33983:65:0;;34018:10;;34030:7;;34039:8;;33983:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;34059:62:0;;-1:-1:-1;;;34059:62:0;;-1:-1:-1;;;;;34059:34:0;;;-1:-1:-1;34059:34:0;;-1:-1:-1;34059:62:0;;34094:10;;34106:7;;34115:5;;34059:62;;;;115703:346;115831:8;;115811;;115753:7;;;;;;-1:-1:-1;;;;;115831:8:0;;;115811;;115803:37;:77;;115871:8;;-1:-1:-1;;;;;115871:8:0;115803:77;;;115851:8;;-1:-1:-1;;;;;115851:8:0;115803:77;115782:98;;115892:13;115907;115925:7;;;;;;;;;-1:-1:-1;;;;;115925:7:0;-1:-1:-1;;;;;115925:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;115972:8:0;;-1:-1:-1;;;;;115891:55:0;;;;-1:-1:-1;115891:55:0;;;-1:-1:-1;;;;;;115964:31:0;;;115972:8;;115964:31;:77;;116022:8;116032;115964:77;;;115999:8;;116009;;-1:-1:-1;115703:346:0;-1:-1:-1;;115703:346:0:o;114248:417::-;114302:7;114311;114332:13;114347;114364:18;:16;:18::i;:::-;114331:51;;;;114393:19;114415:7;;;;;;;;;-1:-1:-1;;;;;114415:7:0;-1:-1:-1;;;;;114415:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;114472:8;;114499;;114472:37;;-1:-1:-1;;;114472:37:0;;114393:43;;-1:-1:-1;114447:22:0;;-1:-1:-1;;;;;114472:8:0;;;;:18;;:37;;114499:8;;;114472:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;114447:62;-1:-1:-1;114541:45:0;114574:11;114541:28;:8;114447:62;114541:28;:12;:28;:::i;:45::-;114601;114634:11;114601:28;:8;114614:14;114601:28;:12;:28;:::i;5:134:-1:-;83:13;;101:33;83:13;101:33;;2350:263;;2465:2;2453:9;2444:7;2440:23;2436:32;2433:2;;;-1:-1;;2471:12;2433:2;89:6;83:13;101:33;128:5;101:33;;2620:392;;2760:2;;2748:9;2739:7;2735:23;2731:32;2728:2;;;-1:-1;;2766:12;2728:2;2817:17;2811:24;2855:18;;2847:6;2844:30;2841:2;;;-1:-1;;2877:12;2841:2;2979:6;2968:9;2964:22;292:3;285:4;277:6;273:17;269:27;259:2;;-1:-1;;300:12;259:2;340:6;334:13;320:27;;2855:18;28293:6;28290:30;28287:2;;;-1:-1;;28323:12;28287:2;2760;28360:6;28356:17;;;362:80;2760:2;28356:17;28421:15;362:80;;;470:21;;;527:14;;;;502:17;;;607:27;;;;;604:36;-1:-1;601:2;;;-1:-1;;643:12;601:2;-1:-1;669:10;;663:217;688:6;685:1;682:13;663:217;;;768:48;812:3;800:10;768:48;;;756:61;;710:1;703:9;;;;;831:14;;;;859;;663:217;;;-1:-1;2897:99;2722:290;-1:-1;;;;;;;;2722:290;3019:257;;3131:2;3119:9;3110:7;3106:23;3102:32;3099:2;;;-1:-1;;3137:12;3099:2;975:6;969:13;33916:5;30149:13;30142:21;33894:5;33891:32;33881:2;;-1:-1;;33927:12;3283:360;;3407:2;3395:9;3386:7;3382:23;3378:32;3375:2;;;-1:-1;;3413:12;3375:2;3464:17;3458:24;3502:18;;3494:6;3491:30;3488:2;;;-1:-1;;3524:12;3488:2;3610:6;3599:9;3595:22;1142:3;1135:4;1127:6;1123:17;1119:27;1109:2;;-1:-1;;1150:12;1109:2;1190:6;1184:13;1170:27;;3502:18;28588:6;28585:30;28582:2;;;-1:-1;;28618:12;28582:2;1212:64;28691:9;28672:17;;-1:-1;;28668:33;3407:2;28749:15;1212:64;;;1203:73;;1296:6;1289:5;1282:21;1400:3;3407:2;1391:6;1324;1382:16;;1379:25;1376:2;;;-1:-1;;1407:12;1376:2;1427:39;1459:6;3407:2;1358:5;1354:16;3407:2;1324:6;1320:17;1427:39;;;-1:-1;3544:83;3369:274;-1:-1;;;;3369:274;3650:779;;;;;;3840:3;3828:9;3819:7;3815:23;3811:33;3808:2;;;-1:-1;;3847:12;3808:2;1578:6;1565:20;1590:51;1635:5;1590:51;;;3899:81;4017:2;4056:22;;2000:20;;-1:-1;4125:2;4164:22;;2000:20;;4233:2;4272:22;;2000:20;;-1:-1;4341:3;4381:22;2000:20;;-1:-1;3802:627;-1:-1;;;3802:627;4436:261;;4550:2;4538:9;4529:7;4525:23;4521:32;4518:2;;;-1:-1;;4556:12;4518:2;-1:-1;1730:13;;4512:185;-1:-1;4512:185;4704:533;;;;4852:2;4840:9;4831:7;4827:23;4823:32;4820:2;;;-1:-1;;4858:12;4820:2;1876:6;1870:13;1888:33;1915:5;1888:33;;;5021:2;5071:22;;1870:13;4910:74;;-1:-1;1888:33;1870:13;1888:33;;;5140:2;5189:22;;2288:13;5029:74;;-1:-1;30764:10;30753:22;;34541:34;;34531:2;;-1:-1;;34579:12;34531:2;5148:73;;;;4814:423;;;;;;5244:241;;5348:2;5336:9;5327:7;5323:23;5319:32;5316:2;;;-1:-1;;5354:12;5316:2;-1:-1;2000:20;;5310:175;-1:-1;5310:175;7052:343;;7194:5;29042:12;29586:6;29581:3;29574:19;7287:52;7332:6;29623:4;29618:3;29614:14;29623:4;7313:5;7309:16;7287:52;;;28691:9;33674:14;-1:-1;;33670:28;7351:39;;;;29623:4;7351:39;;7142:253;-1:-1;;7142:253;13930:222;-1:-1;;;;;30547:54;;;;6154:37;;14057:2;14042:18;;14028:124;14404:349;-1:-1;;;;;30547:54;;;;6023:58;;14739:2;14724:18;;8519:36;14567:2;14552:18;;14538:215;14760:333;-1:-1;;;;;30547:54;;;6154:37;;30547:54;;15079:2;15064:18;;6154:37;14915:2;14900:18;;14886:207;15100:528;-1:-1;;;;;30547:54;;;6154:37;;30547:54;;15465:2;15450:18;;6154:37;15301:2;15502;15487:18;;15480:48;;;15100:528;;15542:76;;15286:18;;15604:6;15542:76;;;15534:84;15272:356;-1:-1;;;;;15272:356;15635:440;-1:-1;;;;;30547:54;;;6154:37;;30547:54;;;;15980:2;15965:18;;6154:37;16061:2;16046:18;;8519:36;;;;15816:2;15801:18;;15787:288;16418:544;;2855:18;;30558:42;;;30065:5;30547:54;6161:3;6154:37;32931:24;16799:2;16788:9;16784:18;8646:58;16627:2;16836;16825:9;16821:18;16814:48;16876:76;16627:2;16616:9;16612:18;16938:6;16876:76;;17837:976;-1:-1;;;;;30547:54;;;7493:70;;30547:54;;;18369:2;18354:18;;7493:70;18452:2;18437:18;;8519:36;;;;30858:4;30847:16;;;18541:2;18526:18;;8793:56;30847:16;;18630:3;18615:19;;8793:56;30547:54;;;30558:42;18699:19;;6154:37;18798:3;18783:19;;8519:36;;;;18174:3;18159:19;;18145:668;18820:1088;-1:-1;;;;;30547:54;;;7493:70;;30547:54;;;19380:2;19365:18;;7493:70;19463:2;19448:18;;8519:36;;;;19546:2;19531:18;;8519:36;;;;30858:4;30847:16;;;19635:3;19620:19;;8793:56;30847:16;30558:42;19710:19;;8793:56;30547:54;;;19809:3;19794:19;;6154:37;19893:3;19878:19;;8519:36;;;;19185:3;19170:19;;19156:752;21011:310;;21158:2;21179:17;21172:47;21233:78;21158:2;21147:9;21143:18;21297:6;21233:78;;21328:416;21528:2;21542:47;;;9440:2;21513:18;;;29574:19;9476:34;29614:14;;;9456:55;-1:-1;;;9531:12;;;9524:25;9568:12;;;21499:245;21751:416;21951:2;21965:47;;;9819:2;21936:18;;;29574:19;9855:34;29614:14;;;9835:55;-1:-1;;;9910:12;;;9903:25;9947:12;;;21922:245;22174:416;22374:2;22388:47;;;10198:2;22359:18;;;29574:19;10234:29;29614:14;;;10214:50;10283:12;;;22345:245;22597:416;22797:2;22811:47;;;10534:2;22782:18;;;29574:19;10570:25;29614:14;;;10550:46;10615:12;;;22768:245;23020:416;23220:2;23234:47;;;10866:2;23205:18;;;29574:19;10902:25;29614:14;;;10882:46;10947:12;;;23191:245;23443:416;23643:2;23657:47;;;23628:18;;;29574:19;11234:34;29614:14;;;11214:55;11288:12;;;23614:245;23866:416;24066:2;24080:47;;;11539:2;24051:18;;;29574:19;11575:34;29614:14;;;11555:55;-1:-1;;;11630:12;;;11623:26;11668:12;;;24037:245;24289:416;24489:2;24503:47;;;11919:2;24474:18;;;29574:19;11955:34;29614:14;;;11935:55;-1:-1;;;12010:12;;;12003:25;12047:12;;;24460:245;24712:416;24912:2;24926:47;;;12298:2;24897:18;;;29574:19;12334:31;29614:14;;;12314:52;12385:12;;;24883:245;25135:416;25335:2;25349:47;;;12636:2;25320:18;;;29574:19;12672:29;29614:14;;;12652:50;12721:12;;;25306:245;25558:416;25758:2;25772:47;;;12972:2;25743:18;;;29574:19;13008:34;29614:14;;;12988:55;-1:-1;;;13063:12;;;13056:32;13107:12;;;25729:245;25981:416;26181:2;26195:47;;;13358:2;26166:18;;;29574:19;13394:30;29614:14;;;13374:51;13444:12;;;26152:245;26404:416;26604:2;26618:47;;;13695:2;26589:18;;;29574:19;13731:33;29614:14;;;13711:54;13784:12;;;26575:245;26827:222;8519:36;;;26954:2;26939:18;;26925:124;27056:816;;27345:3;27334:9;27330:19;8548:5;8526:3;8519:36;27510:2;8548:5;27510:2;27499:9;27495:18;8519:36;27345:3;27547:2;27536:9;27532:18;27525:48;27587:108;6547:5;29042:12;29586:6;29581:3;29574:19;29614:14;27334:9;29614:14;6559:93;;27510:2;6723:5;28896:14;6735:21;;-1:-1;6762:260;6787:6;6784:1;6781:13;6762:260;;;6848:13;;-1:-1;;;;;30547:54;6154:37;;29429:14;;;;5916;;;;2855:18;6802:9;6762:260;;;-1:-1;;;;;;;30547:54;;;;27774:2;27759:18;;6154:37;-1:-1;;;27857:3;27842:19;8519:36;27579:116;27316:556;-1:-1;;;27316:556;27879:256;27941:2;27935:9;27967:17;;;28042:18;28027:34;;28063:22;;;28024:62;28021:2;;;28099:1;;28089:12;28021:2;27941;28108:22;27919:216;;-1:-1;27919:216;33330:268;33395:1;33402:101;33416:6;33413:1;33410:13;33402:101;;;33483:11;;;33477:18;33464:11;;;33457:39;33438:2;33431:10;33402:101;;;33518:6;33515:1;33512:13;33509:2;;;-1:-1;;33395:1;33565:16;;33558:27;33379:219;33711:117;-1:-1;;;;;30547:54;;33770:35;;33760:2;;33819:1;;33809:12;34235:117;-1:-1;;;;;34322:5;30431:42;34297:5;34294:35;34284:2;;34343:1;;34333:12

Swarm Source

ipfs://24c05719583c2863f917e50e445d0eb83901a26891c81b503984feb61833dbdc
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading