false
true
0

Contract Address Details

0x235ba14f6DF83c17353e410E5a2dcC052a5a0f64

Contract Name
TideAdapter
Creator
0xf3b5e2–b7ead4 at 0xe0bc65–fafc4e
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
92 Transfers
Gas Used
Fetching gas used...
Last Balance Update
26056658
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
TideAdapter




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
999
EVM Version
shanghai




Verified at
2026-02-18T09:36:47.545359Z

Constructor Arguments

0x00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d000000000000000000000000dc09fcdc3ba071e3c6ca8d344849aec0cd4e25a30000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002d2a8000000000000000000000000d7b324ef7a246c7c77fbee99aed08e0bedca692d000000000000000000000000000000000000000000000000000000000000000b5469646541646170746572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000346b508712a0443de7b7c3e7e90d940d6cf8cac7000000000000000000000000c23c09f8b908e38caa641ff9b1a577d75f2c2498000000000000000000000000a481a20aeac229ba05ba3c9a0c7547e09793dfa90000000000000000000000008662d605bb3554907cd80c60ee99a6e3b53f1fc100000000000000000000000018515a8d416d7709e0be994415d460a1c2e427710000000000000000000000004db2c44496a7039727950b5ea34db6448fdcaf43000000000000000000000000e8dd98d9c63c750bedb081b6bd4dc4f60fc2d0410000000000000000000000006926c634e0444799f48c1a328f616dd8084fe38b000000000000000000000000418058356fb3f30c0d25528768f01a28c0fb27e7000000000000000000000000f39b2485e34f282fb3d2db6b0f1dbfb78b2adda6000000000000000000000000f20d005bf1fe3aaa743e38b49e457ec049c3c1e80000000000000000000000005d504b96b9035bf89a12aa0dbc96b12556993ca70000000000000000000000008ae7f93479f90ae6ea123d60c683325006c11a92000000000000000000000000d503d2f5b84810dfc137db77ecfac20f74f11fc9000000000000000000000000d591e7a2a5bd04846340aadda7236c332c507a43
              

src/adapters/TideAdapter.sol

// SPDX-License-Identifier: GPL-3.0-only

/*
             ++++++++++++++++++                                                                     
          +++++++++++++++++++++++++                                                                 
        ++++++++++++++++++++++++++++++                  +++++++++                                   
      +=++++++++++++++++++++++++++++++=++          ++=+++++===++++++++                              
    +++++++++++++++++++++++++++++++++++++++     ++++=++++++++++++++++++++                           
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                         
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                        
  +=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==                       
 +=+++++++++++++++         +++++++++++++++++++++++++++++++++++++++++++++++++=++                     
 +++++++++++++++              ++=+++++++++++++++++++++++++++++++++++++++++++++++                    
 +++++++++++++++                 +++++++++++++++++++++++++    ++++++++++++++++++                    
 ++++++++++++++                    ++++++++++++++++++++         =++++++++++++++++                   
+++++++++++++++                     ++++++++++++++++++           ++++++++++++++++                   
+++++++++++++++                       ++++++++++++++              +++++++++++++=++                  
+++++++++++++++                         +++++++++++               ++++++++++++++++                  
 ++++++++++++++                          ++++++++                  +++++++++++++++                  
 +++++++++++++++                          ++++++                   ++=++++++++++++                  
 +++++++++++++++                            ++++                   +++++++++++++++                  
 ++++++++++++++++                            +=                    +++++++++++++++                  
  +++++++++++++++                                                  ++++++++++++++++                 
  ++++++++++++++++                                                 ++++++++++++++++++++             
   ++++++++++++++++                                               ++++++++++++++++++++++++          
   ++++++++++++++++                                               +++++++++++++++++++++++++++       
    +=++++++++++++++                                              ++++++++++++++++++++++++++++      
     +=++++++++++++++                                            +++++++++++++++++++++++++++++++    
     +++++++++++++++++                                           ++++++++++++++++++++++++++++++++   
      +++++++++++++++++                                          +++++++++++++++++++++++++++++++++  
       +++++++++++++++++                                                       ++++++++++++++++++++ 
        ++=++++++++++++++                                                         =++++++++++++++++ 
         +++++++++++++++++                                                          ++++++++++++++++
          ++++++++++++++++++                                                         +++++++++++++++
           ++++++++++++++++++                                                         ++++++++++++++
            +++++++++++++++++++                                                       ++++++++++++++
              +++++++++++++++==+                                                      ++++++++++++++
               +++++++++++++++++++                               ..                   ++++++++++++++
                ++++++++++++++++++                            .........               ++++++++++++++
                  ++=+++++++++++++                          .......                   ++++++++++++++
                  +==+++++++++++++                          .......                   ++++++++++++++
                  ++=+++++++++++++                          .......                   ++++++++++++++
                  ++=+++++++++++++                          ...                       ++++++++++++++
                  ++++++++++++++++                           ..                       ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  *++**++*******++                                                    ++++++++++++++
                  *++*************                                                    ++++++++++++++
                  **+*************                                                    **************
                  ****************                                                    **************
                   ***************                                                   ***************
                   ****************                                                  ***************
                   *****************#                                              *****************
                    *******************                                          ****************** 
                     *****************************************************************************  
                      ***************************************************************************   
                       *************************************************************************    
                         #################*****************************************************     
                          ##########################################################***#####*       
                            ###############################################################         
                               ###*######################################################           
                                  ###################################################    

                                  Switch.win
                                  https://Switch.win
                                  Built by: BuildTheTech.com          
*/

pragma solidity ^0.8.0;

import "../SwitchAdapter.sol";
import "../interface/ITideVault.sol";

interface IBalancerV3StaticQuoter {
    function quoteExactInputSingle(
        address pool,
        address tokenIn,
        address tokenOut,
        uint256 amountIn,
        bytes memory userData
    ) external view returns (uint256 amountOut);

    function vault() external view returns (address);

    function router() external view returns (address);

    function senderOverride() external view returns (address);
}

interface IBalancerV3Router {
    function querySwapSingleTokenExactIn(
        address pool,
        IERC20 tokenIn,
        IERC20 tokenOut,
        uint256 exactAmountIn,
        address sender,
        bytes calldata userData
    ) external returns (uint256 amountCalculated);
}

contract TideAdapter is SwitchAdapter {
    using SafeERC20 for IERC20;

    ITideVault public immutable vault;
    IBalancerV3StaticQuoter public immutable quoter;
    address public immutable router;

    mapping(address => mapping(address => address[])) internal tokensToPools;

    error NotVault();

    struct UnlockSwapCall {
        ITideVault.VaultSwapParams params;
        address recipient;
        uint256 quotedAmountOut;
    }

    constructor(
        string memory _name,
        address _vault,
        address _quoter,
        address[] memory _pools,
        uint256 _swapGasEstimate,
        address _router
    ) SwitchAdapter(_name, _swapGasEstimate) {
        require(_vault != address(0), "TideAdapter: zero vault");
        require(_quoter != address(0), "TideAdapter: zero quoter");
        require(_router != address(0), "TideAdapter: zero router");

        ITideVault vaultInstance = ITideVault(_vault);
        IBalancerV3StaticQuoter quoterInstance = IBalancerV3StaticQuoter(_quoter);

        require(quoterInstance.vault() == _vault, "TideAdapter: quoter vault mismatch");
        require(quoterInstance.router() == _router, "TideAdapter: quoter router mismatch");

        vault = vaultInstance;
        quoter = quoterInstance;
        router = _router;

        addPools(_pools);
    }

    function addPools(address[] memory _pools) public onlyMaintainer {
        for (uint256 i = 0; i < _pools.length; i++) {
            address pool = _pools[i];
            if (pool == address(0)) continue;

            IERC20[] memory tokens = _getPoolTokens(pool);
            for (uint256 j = 0; j < tokens.length; j++) {
                address token = address(tokens[j]);
                for (uint256 k = 0; k < tokens.length; k++) {
                    if (j == k) continue;

                    address otherToken = address(tokens[k]);
                    address[] storage poolsForPair = tokensToPools[token][otherToken];

                    bool exists;
                    for (uint256 idx = 0; idx < poolsForPair.length; idx++) {
                        if (poolsForPair[idx] == pool) {
                            exists = true;
                            break;
                        }
                    }

                    if (!exists) {
                        poolsForPair.push(pool);
                    }

                    _approveIfNeeded(token, UINT_MAX);
                }
            }
        }
    }

    function removePools(address[] memory _pools) public onlyMaintainer {
        for (uint256 i = 0; i < _pools.length; i++) {
            address pool = _pools[i];
            if (pool == address(0)) continue;

            IERC20[] memory tokens = _getPoolTokens(pool);
            for (uint256 j = 0; j < tokens.length; j++) {
                address token = address(tokens[j]);
                for (uint256 k = 0; k < tokens.length; k++) {
                    if (j == k) continue;

                    address otherToken = address(tokens[k]);
                    address[] storage currentPools = tokensToPools[token][otherToken];

                    for (uint256 idx = 0; idx < currentPools.length; ) {
                        if (currentPools[idx] == pool) {
                            currentPools[idx] = currentPools[currentPools.length - 1];
                            currentPools.pop();
                            break;
                        } else {
                            unchecked {
                                idx++;
                            }
                        }
                    }
                }
            }
        }
    }

    function getPools(address tokenIn, address tokenOut) public view returns (address[] memory) {
        return tokensToPools[tokenIn][tokenOut];
    }

    function _approveIfNeeded(address _tokenIn, uint256 _amount) internal {
        uint256 allowance = IERC20(_tokenIn).allowance(address(this), address(vault));
        if (allowance < _amount) {
            IERC20(_tokenIn).safeApprove(address(vault), _amount);
        }
    }

    function _query(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut
    ) internal view override returns (uint256) {
        if (_amountIn == 0 || _tokenIn == _tokenOut) {
            return 0;
        }

        address[] memory pools = getPools(_tokenIn, _tokenOut);
        if (pools.length == 0) {
            return 0;
        }

        (, uint256 amountOut) = _getBestPoolForSwap(pools, _tokenIn, _tokenOut, _amountIn);
        return amountOut;
    }

    function _swap(
        uint256 _amountIn,
        uint256 _amountOut,
        address _tokenIn,
        address _tokenOut,
        address to
    ) internal override {
        address[] memory pools = getPools(_tokenIn, _tokenOut);
        require(pools.length > 0, "No pools for swapping");

        (address pool, uint256 quotedAmountOut) = _getBestPoolForSwap(pools, _tokenIn, _tokenOut, _amountIn);
        require(pool != address(0), "Undefined pool");

        ITideVault.VaultSwapParams memory params = ITideVault.VaultSwapParams({
            kind: ITideVault.SwapKind.EXACT_IN,
            pool: pool,
            tokenIn: IERC20(_tokenIn),
            tokenOut: IERC20(_tokenOut),
            amountGivenRaw: _amountIn,
            limitRaw: _amountOut,
            userData: new bytes(0)
        });
        UnlockSwapCall memory unlockCall = UnlockSwapCall({
            params: params,
            recipient: to,
            quotedAmountOut: quotedAmountOut
        });

        vault.unlock(abi.encodeWithSelector(this._executeVaultSwap.selector, unlockCall));
    }

    function _executeVaultSwap(UnlockSwapCall memory unlockCall) external returns (uint256 amountSent) {
        if (msg.sender != address(vault)) revert NotVault();

        ITideVault.VaultSwapParams memory params = unlockCall.params;

        params.tokenIn.safeTransfer(address(vault), params.amountGivenRaw);
        vault.settle(params.tokenIn, params.amountGivenRaw);

        (uint256 amountCalculated, , uint256 amountOutActual) = vault.swap(params);

        amountSent = amountOutActual != 0 ? amountOutActual : amountCalculated;
        if (amountSent == 0) {
            amountSent = unlockCall.quotedAmountOut;
        }

        vault.sendTo(params.tokenOut, unlockCall.recipient, amountSent);
    }

    function _getBestPoolForSwap(
        address[] memory pools,
        address _tokenIn,
        address _tokenOut,
        uint256 _amountIn
    ) internal view returns (address bestPool, uint256 amountOut) {
        amountOut = 0;
        bestPool = address(0);

        for (uint256 i = 0; i < pools.length; i++) {
            address pool = pools[i];
            if (pool == address(0)) {
                continue;
            }

            uint256 newAmountOut = _quotePool(pool, _tokenIn, _tokenOut, _amountIn);
            if (newAmountOut > amountOut) {
                amountOut = newAmountOut;
                bestPool = pool;
            }
        }
    }

    function _quotePool(
        address pool,
        address tokenIn,
        address tokenOut,
        uint256 amountIn
    ) internal view returns (uint256) {
        if (amountIn == 0 || tokenIn == tokenOut) {
            return 0;
        }

        // The static quoter simulates the full vault.swap() path, which applies
        // the pool's swap fee on the INPUT side before computing output.
        // The returned amountOut is therefore already NET (fee-inclusive).
        try quoter.quoteExactInputSingle(pool, tokenIn, tokenOut, amountIn, new bytes(0)) returns (uint256 amountOut) {
            return amountOut;
        } catch {}

        address senderForQuote = quoter.senderOverride();
        if (senderForQuote == address(0)) {
            senderForQuote = router;
        }
        if (senderForQuote == address(0)) {
            senderForQuote = address(this);
        }

        bytes memory payload = abi.encodeWithSelector(
            IBalancerV3Router.querySwapSingleTokenExactIn.selector,
            pool,
            IERC20(tokenIn),
            IERC20(tokenOut),
            amountIn,
            senderForQuote,
            new bytes(0)
        );

        (bool ok, bytes memory result) = router.staticcall(payload);
        if (!ok || result.length == 0) {
            return 0;
        }

        return abi.decode(result, (uint256));
    }

    function _getPoolTokens(address pool) internal view returns (IERC20[] memory tokens) {
        try vault.getPoolTokens(pool) returns (IERC20[] memory vaultTokens) {
            return vaultTokens;
        } catch {
            revert("TideAdapter: pool-tokens");
        }
    }
}
        

dependencies/openzeppelin-contracts/contracts/access/AccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}
          

dependencies/openzeppelin-contracts/contracts/access/IAccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}
          

dependencies/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
          

dependencies/openzeppelin-contracts/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

dependencies/openzeppelin-contracts/contracts/utils/Strings.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}
          

dependencies/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
          

dependencies/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

dependencies/openzeppelin-contracts/contracts/utils/math/Math.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @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.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}
          

dependencies/openzeppelin-contracts/contracts/utils/math/SignedMath.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}
          

src/SwitchAdapter.sol

// SPDX-License-Identifier: GPL-3.0-only

/*
             ++++++++++++++++++                                                                     
          +++++++++++++++++++++++++                                                                 
        ++++++++++++++++++++++++++++++                  +++++++++                                   
      +=++++++++++++++++++++++++++++++=++          ++=+++++===++++++++                              
    +++++++++++++++++++++++++++++++++++++++     ++++=++++++++++++++++++++                           
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                         
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                        
  +=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==                       
 +=+++++++++++++++         +++++++++++++++++++++++++++++++++++++++++++++++++=++                     
 +++++++++++++++              ++=+++++++++++++++++++++++++++++++++++++++++++++++                    
 +++++++++++++++                 +++++++++++++++++++++++++    ++++++++++++++++++                    
 ++++++++++++++                    ++++++++++++++++++++         =++++++++++++++++                   
+++++++++++++++                     ++++++++++++++++++           ++++++++++++++++                   
+++++++++++++++                       ++++++++++++++              +++++++++++++=++                  
+++++++++++++++                         +++++++++++               ++++++++++++++++                  
 ++++++++++++++                          ++++++++                  +++++++++++++++                  
 +++++++++++++++                          ++++++                   ++=++++++++++++                  
 +++++++++++++++                            ++++                   +++++++++++++++                  
 ++++++++++++++++                            +=                    +++++++++++++++                  
  +++++++++++++++                                                  ++++++++++++++++                 
  ++++++++++++++++                                                 ++++++++++++++++++++             
   ++++++++++++++++                                               ++++++++++++++++++++++++          
   ++++++++++++++++                                               +++++++++++++++++++++++++++       
    +=++++++++++++++                                              ++++++++++++++++++++++++++++      
     +=++++++++++++++                                            +++++++++++++++++++++++++++++++    
     +++++++++++++++++                                           ++++++++++++++++++++++++++++++++   
      +++++++++++++++++                                          +++++++++++++++++++++++++++++++++  
       +++++++++++++++++                                                       ++++++++++++++++++++ 
        ++=++++++++++++++                                                         =++++++++++++++++ 
         +++++++++++++++++                                                          ++++++++++++++++
          ++++++++++++++++++                                                         +++++++++++++++
           ++++++++++++++++++                                                         ++++++++++++++
            +++++++++++++++++++                                                       ++++++++++++++
              +++++++++++++++==+                                                      ++++++++++++++
               +++++++++++++++++++                               ..                   ++++++++++++++
                ++++++++++++++++++                            .........               ++++++++++++++
                  ++=+++++++++++++                          .......                   ++++++++++++++
                  +==+++++++++++++                          .......                   ++++++++++++++
                  ++=+++++++++++++                          .......                   ++++++++++++++
                  ++=+++++++++++++                          ...                       ++++++++++++++
                  ++++++++++++++++                           ..                       ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  ++++++++++++++++                                                    ++++++++++++++
                  *++**++*******++                                                    ++++++++++++++
                  *++*************                                                    ++++++++++++++
                  **+*************                                                    **************
                  ****************                                                    **************
                   ***************                                                   ***************
                   ****************                                                  ***************
                   *****************#                                              *****************
                    *******************                                          ****************** 
                     *****************************************************************************  
                      ***************************************************************************   
                       *************************************************************************    
                         #################*****************************************************     
                          ##########################################################***#####*       
                            ###############################################################         
                               ###*######################################################           
                                  ###################################################    

                                  Switch.win
                                  https://Switch.win
                                  Built by: BuildTheTech.com           
*/

pragma solidity ^0.8.0;

import "./interface/IERC20.sol";
import "./lib/SafeERC20.sol";
import "./lib/Maintainable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

abstract contract SwitchAdapter is Maintainable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    event SwitchAdapterSwap(address indexed _tokenFrom, address indexed _tokenTo, uint256 _amountIn, uint256 _amountOut);
    event UpdatedGasEstimate(address indexed _adapter, uint256 _newEstimate);
    event Recovered(address indexed _asset, uint256 amount);

    uint256 internal constant UINT_MAX = type(uint256).max;
    uint256 public swapGasEstimate;
    string public name;

    constructor(string memory _name, uint256 _gasEstimate) {
        setName(_name);
        setSwapGasEstimate(_gasEstimate);
    }

    function setName(string memory _name) internal {
        require(bytes(_name).length != 0, "Invalid adapter name");
        name = _name;
    }

    function setSwapGasEstimate(uint256 _estimate) public onlyMaintainer {
        require(_estimate != 0, "Invalid gas-estimate");
        swapGasEstimate = _estimate;
        emit UpdatedGasEstimate(address(this), _estimate);
    }

    function revokeAllowance(address _token, address _spender) external onlyMaintainer {
        IERC20(_token).safeApprove(_spender, 0);
    }

    function recoverERC20(address _tokenAddress, uint256 _tokenAmount) external onlyMaintainer {
        require(_tokenAmount > 0, "SwitchAdapter: Nothing to recover");
        IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
        emit Recovered(_tokenAddress, _tokenAmount);
    }

    function recoverPLS(uint256 _amount) external onlyMaintainer {
        require(_amount > 0, "SwitchAdapter: Nothing to recover");
        (bool ok, ) = payable(msg.sender).call{value: _amount}("");
        require(ok, "SwitchAdapter: PLS transfer failed");
        emit Recovered(address(0), _amount);
    }

    function query(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut
    ) external view returns (uint256) {
        return _query(_amountIn, _tokenIn, _tokenOut);
    }

    function swap(
        uint256 _amountIn,
        uint256 _amountOut,
        address _fromToken,
        address _toToken,
        address _to
    ) external virtual nonReentrant {
        uint256 toBal0 = IERC20(_toToken).balanceOf(_to);
        _swap(_amountIn, _amountOut, _fromToken, _toToken, _to);
        uint256 diff = IERC20(_toToken).balanceOf(_to) - toBal0;
        require(diff >= _amountOut, "Insufficient amount-out");
        emit SwitchAdapterSwap(_fromToken, _toToken, _amountIn, _amountOut);
    }

    function _returnTo(
        address _token,
        uint256 _amount,
        address _to
    ) internal {
        if (address(this) != _to) IERC20(_token).safeTransfer(_to, _amount);
    }

    function _swap(
        uint256 _amountIn,
        uint256 _amountOut,
        address _fromToken,
        address _toToken,
        address _to
    ) internal virtual;

    function _query(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut
    ) internal view virtual returns (uint256);

    receive() external payable {}
}
          

src/interface/IERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC20 {
    event Approval(address, address, uint256);
    event Transfer(address, address, uint256);

    function name() external view returns (string memory);

    function decimals() external view returns (uint8);

    function transferFrom(
        address,
        address,
        uint256
    ) external returns (bool);

    function allowance(address, address) external view returns (uint256);

    function approve(address, uint256) external returns (bool);

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

    function balanceOf(address) external view returns (uint256);

    function nonces(address) external view returns (uint256); // Only tokens that support permit

    function permit(
        address,
        address,
        uint256,
        uint256,
        uint8,
        bytes32,
        bytes32
    ) external; // Only tokens that support permit

    function swap(address, uint256) external; // Only Avalanche bridge tokens

    function swapSupply(address) external view returns (uint256); // Only Avalanche bridge tokens

    function totalSupply() external view returns (uint256);
}
          

src/interface/ITideVault.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface ITideVault {
    enum SwapKind {
        EXACT_IN,
        EXACT_OUT
    }

    struct VaultSwapParams {
        SwapKind kind;
        address pool;
        IERC20 tokenIn;
        IERC20 tokenOut;
        uint256 amountGivenRaw;
        uint256 limitRaw;
        bytes userData;
    }

    function unlock(bytes calldata data) external returns (bytes memory result);

    function settle(IERC20 token, uint256 amountHint) external returns (uint256 credit);

    function swap(VaultSwapParams calldata params)
        external
        returns (
            uint256 amountCalculated,
            uint256 amountIn,
            uint256 amountOut
        );

    function sendTo(IERC20 token, address to, uint256 amount) external;

    function getPoolTokens(address pool) external view returns (IERC20[] memory tokens);

    /// @notice Returns the static swap fee percentage for a pool (18-decimal fixed point, e.g. 0.01e18 = 1%)
    function getStaticSwapFeePercentage(address pool) external view returns (uint256);
}
          

src/lib/Maintainable.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * @dev Contract module which extends the basic access control mechanism of Ownable
 * to include many maintainers, whom only the owner (DEFAULT_ADMIN_ROLE) may add and
 * remove.
 *
 * By default, the owner account will be the one that deploys the contract. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available this modifier:
 * `onlyMaintainer`, which can be applied to your functions to restrict their use to
 * the accounts with the role of maintainer.
 */

abstract contract Maintainable is Context, AccessControl {
    bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");

    constructor() {
        address msgSender = _msgSender();
        // members of the DEFAULT_ADMIN_ROLE alone may revoke and grant role membership
        _setupRole(DEFAULT_ADMIN_ROLE, msgSender);
        _setupRole(MAINTAINER_ROLE, msgSender);
    }

    function addMaintainer(address addedMaintainer) public virtual {
        grantRole(MAINTAINER_ROLE, addedMaintainer);
    }

    function removeMaintainer(address removedMaintainer) public virtual {
        revokeRole(MAINTAINER_ROLE, removedMaintainer);
    }

    function renounceRole(bytes32 role) public virtual {
        address msgSender = _msgSender();
        renounceRole(role, msgSender);
    }

    function transferOwnership(address newOwner) public virtual {
        address msgSender = _msgSender();
        grantRole(DEFAULT_ADMIN_ROLE, newOwner);
        renounceRole(DEFAULT_ADMIN_ROLE, msgSender);
    }

    modifier onlyMaintainer() {
        address msgSender = _msgSender();
        require(hasRole(MAINTAINER_ROLE, msgSender), "Maintainable: Caller is not a maintainer");
        _;
    }
}
          

src/lib/SafeERC20.sol

// This is a simplified version of OpenZepplin's SafeERC20 library
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;

import "../interface/IERC20.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 ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    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));
    }

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

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

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "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");
        }
    }
}
          

Compiler Settings

{"viaIR":false,"remappings":["@openzeppelin/contracts/=dependencies/openzeppelin-contracts/contracts/","forge-std/=dependencies/forge-std/src/","ds-test/=dependencies/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/","erc4626-tests/=dependencies/openzeppelin-contracts/lib/erc4626-tests/","openzeppelin-contracts/=dependencies/openzeppelin-contracts/","openzeppelin/=dependencies/openzeppelin-contracts/contracts/"],"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":999,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"shanghai"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"address","name":"_vault","internalType":"address"},{"type":"address","name":"_quoter","internalType":"address"},{"type":"address[]","name":"_pools","internalType":"address[]"},{"type":"uint256","name":"_swapGasEstimate","internalType":"uint256"},{"type":"address","name":"_router","internalType":"address"}]},{"type":"error","name":"NotVault","inputs":[]},{"type":"event","name":"Recovered","inputs":[{"type":"address","name":"_asset","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SwitchAdapterSwap","inputs":[{"type":"address","name":"_tokenFrom","internalType":"address","indexed":true},{"type":"address","name":"_tokenTo","internalType":"address","indexed":true},{"type":"uint256","name":"_amountIn","internalType":"uint256","indexed":false},{"type":"uint256","name":"_amountOut","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UpdatedGasEstimate","inputs":[{"type":"address","name":"_adapter","internalType":"address","indexed":true},{"type":"uint256","name":"_newEstimate","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"MAINTAINER_ROLE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountSent","internalType":"uint256"}],"name":"_executeVaultSwap","inputs":[{"type":"tuple","name":"unlockCall","internalType":"struct TideAdapter.UnlockSwapCall","components":[{"type":"tuple","name":"params","internalType":"struct ITideVault.VaultSwapParams","components":[{"type":"uint8","name":"kind","internalType":"enum ITideVault.SwapKind"},{"type":"address","name":"pool","internalType":"address"},{"type":"address","name":"tokenIn","internalType":"contract IERC20"},{"type":"address","name":"tokenOut","internalType":"contract IERC20"},{"type":"uint256","name":"amountGivenRaw","internalType":"uint256"},{"type":"uint256","name":"limitRaw","internalType":"uint256"},{"type":"bytes","name":"userData","internalType":"bytes"}]},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"quotedAmountOut","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMaintainer","inputs":[{"type":"address","name":"addedMaintainer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPools","inputs":[{"type":"address[]","name":"_pools","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getPools","inputs":[{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"query","inputs":[{"type":"uint256","name":"_amountIn","internalType":"uint256"},{"type":"address","name":"_tokenIn","internalType":"address"},{"type":"address","name":"_tokenOut","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IBalancerV3StaticQuoter"}],"name":"quoter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"address","name":"_tokenAddress","internalType":"address"},{"type":"uint256","name":"_tokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverPLS","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMaintainer","inputs":[{"type":"address","name":"removedMaintainer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removePools","inputs":[{"type":"address[]","name":"_pools","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeAllowance","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"router","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapGasEstimate","inputs":[{"type":"uint256","name":"_estimate","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"uint256","name":"_amountIn","internalType":"uint256"},{"type":"uint256","name":"_amountOut","internalType":"uint256"},{"type":"address","name":"_fromToken","internalType":"address"},{"type":"address","name":"_toToken","internalType":"address"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"swapGasEstimate","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ITideVault"}],"name":"vault","inputs":[]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

0x60e060405234801562000010575f80fd5b506040516200401438038062004014833981016040819052620000339162000cc5565b858233620000425f8262000372565b6200006e7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab958262000372565b50600180556200007e8262000382565b6200008981620003e2565b50506001600160a01b038516620000e75760405162461bcd60e51b815260206004820152601760248201527f54696465416461707465723a207a65726f207661756c7400000000000000000060448201526064015b60405180910390fd5b6001600160a01b0384166200013f5760405162461bcd60e51b815260206004820152601860248201527f54696465416461707465723a207a65726f2071756f74657200000000000000006044820152606401620000de565b6001600160a01b038116620001975760405162461bcd60e51b815260206004820152601860248201527f54696465416461707465723a207a65726f20726f7574657200000000000000006044820152606401620000de565b5f8590505f859050866001600160a01b0316816001600160a01b031663fbfa77cf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200020c919062000dc3565b6001600160a01b0316146200026f5760405162461bcd60e51b815260206004820152602260248201527f54696465416461707465723a2071756f746572207661756c74206d69736d61746044820152610c6d60f31b6064820152608401620000de565b826001600160a01b0316816001600160a01b031663f887ea406040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002b6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620002dc919062000dc3565b6001600160a01b031614620003405760405162461bcd60e51b815260206004820152602360248201527f54696465416461707465723a2071756f74657220726f75746572206d69736d616044820152620e8c6d60eb1b6064820152608401620000de565b6001600160a01b0380831660805281811660a052831660c0526200036485620004dd565b505050505050505062001069565b6200037e82826200071f565b5050565b80515f03620003d45760405162461bcd60e51b815260206004820152601460248201527f496e76616c69642061646170746572206e616d650000000000000000000000006044820152606401620000de565b60036200037e828262000e73565b335f8181525f8051602062003fd4833981519152602052604090205460ff166200044e5760405162461bcd60e51b815260206004820152602860248201525f8051602062003ff483398151915260448201526734b73a30b4b732b960c11b6064820152608401620000de565b815f036200049f5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206761732d657374696d6174650000000000000000000000006044820152606401620000de565b600282905560405182815230907ff43f23b7a28e6f8ce6843a21bd7b48bce778aa913b8c8cf459edf7d770e8d38a9060200160405180910390a25050565b335f8181525f8051602062003fd4833981519152602052604090205460ff16620005495760405162461bcd60e51b815260206004820152602860248201525f8051602062003ff483398151915260448201526734b73a30b4b732b960c11b6064820152608401620000de565b5f5b82518110156200071a575f8382815181106200056b576200056b62000f3b565b602002602001015190505f6001600160a01b0316816001600160a01b03160362000596575062000705565b5f620005a282620007bd565b90505f5b815181101562000701575f828281518110620005c657620005c662000f3b565b602002602001015190505f5b8351811015620006e957828114620006d4575f848281518110620005fa57620005fa62000f3b565b6020908102919091018101516001600160a01b038086165f908152600484526040808220928416825291909352822090925090805b82548110156200069157886001600160a01b031683828154811062000658576200065862000f3b565b5f918252602090912001546001600160a01b0316036200067c576001915062000691565b80620006888162000f4f565b9150506200062f565b5080620006c35781546001810183555f838152602090200180546001600160a01b0319166001600160a01b038a161790555b620006d0855f1962000883565b5050505b80620006e08162000f4f565b915050620005d2565b50508080620006f89062000f4f565b915050620005a6565b5050505b80620007118162000f4f565b9150506200054b565b505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166200037e575f828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620007793390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60805160405163ca4f280360e01b81526001600160a01b038381166004830152606092169063ca4f2803906024015f60405180830381865afa9250505080156200082a57506040513d5f823e601f3d908101601f1916820160405262000827919081019062000f74565b60015b620008785760405162461bcd60e51b815260206004820152601860248201527f54696465416461707465723a20706f6f6c2d746f6b656e7300000000000000006044820152606401620000de565b92915050565b919050565b608051604051636eb1769f60e11b81523060048201526001600160a01b0391821660248201525f9184169063dd62ed3e90604401602060405180830381865afa158015620008d3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620008f9919062001013565b9050818110156200071a576080516200071a906001600160a01b0385169084801580620009945750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156200096c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000992919062001013565b155b62000a085760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401620000de565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200071a91859162000a6016565b5f80836001600160a01b03168360405162000a7c91906200102b565b5f604051808303815f865af19150503d805f811462000ab7576040519150601f19603f3d011682016040523d82523d5f602084013e62000abc565b606091505b50915091508162000b105760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646044820152606401620000de565b80511562000b8f578080602001905181019062000b2e919062001048565b62000b8f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620000de565b50505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171562000bd45762000bd462000b95565b604052919050565b5f5b8381101562000bf857818101518382015260200162000bde565b50505f910152565b6001600160a01b038116811462000c15575f80fd5b50565b80516200087e8162000c00565b5f6001600160401b0382111562000c405762000c4062000b95565b5060051b60200190565b5f82601f83011262000c5a575f80fd5b8151602062000c7362000c6d8362000c25565b62000ba9565b82815260059290921b8401810191818101908684111562000c92575f80fd5b8286015b8481101562000cba57805162000cac8162000c00565b835291830191830162000c96565b509695505050505050565b5f805f805f8060c0878903121562000cdb575f80fd5b86516001600160401b038082111562000cf2575f80fd5b818901915089601f83011262000d06575f80fd5b81518181111562000d1b5762000d1b62000b95565b62000d30601f8201601f191660200162000ba9565b8181528b602083860101111562000d45575f80fd5b62000d5882602083016020870162000bdc565b985062000d6a905060208a0162000c18565b965062000d7a60408a0162000c18565b9550606089015191508082111562000d90575f80fd5b5062000d9f89828a0162000c4a565b9350506080870151915062000db760a0880162000c18565b90509295509295509295565b5f6020828403121562000dd4575f80fd5b815162000de18162000c00565b9392505050565b600181811c9082168062000dfd57607f821691505b60208210810362000e1c57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200071a575f81815260208120601f850160051c8101602086101562000e4a5750805b601f850160051c820191505b8181101562000e6b5782815560010162000e56565b505050505050565b81516001600160401b0381111562000e8f5762000e8f62000b95565b62000ea78162000ea0845462000de8565b8462000e22565b602080601f83116001811462000edd575f841562000ec55750858301515b5f19600386901b1c1916600185901b17855562000e6b565b5f85815260208120601f198616915b8281101562000f0d5788860151825594840194600190910190840162000eec565b508582101562000f2b57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52603260045260245ffd5b5f6001820162000f6d57634e487b7160e01b5f52601160045260245ffd5b5060010190565b5f602080838503121562000f86575f80fd5b82516001600160401b0381111562000f9c575f80fd5b8301601f8101851362000fad575f80fd5b805162000fbe62000c6d8262000c25565b81815260059190911b8201830190838101908783111562000fdd575f80fd5b928401925b828410156200100857835162000ff88162000c00565b8252928401929084019062000fe2565b979650505050505050565b5f6020828403121562001024575f80fd5b5051919050565b5f82516200103e81846020870162000bdc565b9190910192915050565b5f6020828403121562001059575f80fd5b8151801515811462000de1575f80fd5b60805160a05160c051612ee5620010ef5f395f818161055a015281816123c9015261247b01525f8181610403015281816122b4015261233801525f818161058d015281816114090152818161147e015281816114ed0152818161155c0152818161165c0152818161181b01528181611aa001528181611b2d0152611cef0152612ee55ff3fe6080604052600436106101a7575f3560e01c806391d14854116100e7578063eab90da611610087578063f5a86ad411610062578063f5a86ad4146104f7578063f874225414610516578063f887ea4014610549578063fbfa77cf1461057c575f80fd5b8063eab90da61461049a578063ef99893a146104b9578063f2fde38b146104d8575f80fd5b8063c6bbd5a7116100c2578063c6bbd5a7146103f2578063d3a43ac31461043d578063d547741f1461045c578063d8baf7cf1461047b575f80fd5b806391d148541461037e578063a217fddf146103c0578063b36a4ab1146103d3575f80fd5b80635b1dc86f116101525780637ae267731161012d5780637ae267731461030257806384a33e63146103215780638980f11f146103405780638bb9c5bf1461035f575f80fd5b80635b1dc86f146102a257806369cff80d146102ce5780636b453c1f146102e3575f80fd5b80632f2ff15d116101825780632f2ff15d1461024357806336568abe146102645780634b16414014610283575f80fd5b806301ffc9a7146101b257806306fdde03146101e6578063248a9ca314610207575f80fd5b366101ae57005b5f80fd5b3480156101bd575f80fd5b506101d16101cc366004612533565b6105af565b60405190151581526020015b60405180910390f35b3480156101f1575f80fd5b506101fa610617565b6040516101dd91906125a7565b348015610212575f80fd5b506102356102213660046125b9565b5f9081526020819052604090206001015490565b6040519081526020016101dd565b34801561024e575f80fd5b5061026261025d3660046125ef565b6106a3565b005b34801561026f575f80fd5b5061026261027e3660046125ef565b6106cc565b34801561028e575f80fd5b5061026261029d3660046126d1565b61075d565b3480156102ad575f80fd5b506102c16102bc366004612760565b610a00565b6040516101dd919061278c565b3480156102d9575f80fd5b5061023560025481565b3480156102ee575f80fd5b506102626102fd3660046127d8565b610a80565b34801561030d575f80fd5b5061026261031c366004612760565b610aad565b34801561032c575f80fd5b5061026261033b3660046125b9565b610b4f565b34801561034b575f80fd5b5061026261035a3660046127f3565b610c6a565b34801561036a575f80fd5b506102626103793660046125b9565b610dad565b348015610389575f80fd5b506101d16103983660046125ef565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103cb575f80fd5b506102355f81565b3480156103de575f80fd5b506102626103ed3660046126d1565b610db8565b3480156103fd575f80fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101dd565b348015610448575f80fd5b506102626104573660046125b9565b610ffe565b348015610467575f80fd5b506102626104763660046125ef565b6111d2565b348015610486575f80fd5b506102626104953660046127d8565b6111f6565b3480156104a5575f80fd5b506102626104b436600461281d565b611220565b3480156104c4575f80fd5b506102356104d3366004612878565b6113d2565b3480156104e3575f80fd5b506102626104f23660046127d8565b6113e8565b348015610502575f80fd5b50610235610511366004612939565b6113fd565b348015610521575f80fd5b506102357f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b348015610554575f80fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b348015610587575f80fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b5f6001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061061157507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6003805461062490612a41565b80601f016020809104026020016040519081016040528092919081815260200182805461065090612a41565b801561069b5780601f106106725761010080835404028352916020019161069b565b820191905f5260205f20905b81548152906001019060200180831161067e57829003601f168201915b505050505081565b5f828152602081905260409020600101546106bd816116bd565b6106c783836116c7565b505050565b6001600160a01b038116331461074f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107598282611763565b5050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166107eb5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f5b82518110156106c7575f83828151811061080957610809612a79565b602002602001015190505f6001600160a01b0316816001600160a01b03160361083257506109ee565b5f61083c826117e0565b90505f5b81518110156109ea575f82828151811061085c5761085c612a79565b602002602001015190505f5b83518110156109d5578281146109c3575f84828151811061088b5761088b612a79565b6020908102919091018101516001600160a01b038086165f9081526004845260408082209284168252919093528220909250905b81548110156109bf57876001600160a01b03168282815481106108e4576108e4612a79565b5f918252602090912001546001600160a01b0316036109b7578154829061090d90600190612aa1565b8154811061091d5761091d612a79565b905f5260205f20015f9054906101000a90046001600160a01b031682828154811061094a5761094a612a79565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508180548061098557610985612ab4565b5f8281526020902081015f19908101805473ffffffffffffffffffffffffffffffffffffffff191690550190556109bf565b6001016108bf565b5050505b806109cd81612ac8565b915050610868565b505080806109e290612ac8565b915050610840565b5050505b806109f881612ac8565b9150506107ed565b6001600160a01b038083165f908152600460209081526040808320938516835292815290829020805483518184028101840190945280845260609392830182828015610a7357602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610a55575b5050505050905092915050565b610aaa7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826106a3565b50565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610b3b5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b6106c76001600160a01b038416835f6118d4565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610bdd5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b815f03610c2c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206761732d657374696d6174650000000000000000000000006044820152606401610746565b600282905560405182815230907ff43f23b7a28e6f8ce6843a21bd7b48bce778aa913b8c8cf459edf7d770e8d38a9060200160405180910390a25050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610cf85760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f8211610d515760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b6064820152608401610746565b610d656001600160a01b0384163384611a3a565b826001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2883604051610da091815260200190565b60405180910390a2505050565b3361075982826106cc565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610e465760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f5b82518110156106c7575f838281518110610e6457610e64612a79565b602002602001015190505f6001600160a01b0316816001600160a01b031603610e8d5750610fec565b5f610e97826117e0565b90505f5b8151811015610fe8575f828281518110610eb757610eb7612a79565b602002602001015190505f5b8351811015610fd357828114610fc1575f848281518110610ee657610ee6612a79565b6020908102919091018101516001600160a01b038086165f908152600484526040808220928416825291909352822090925090805b8254811015610f7457886001600160a01b0316838281548110610f4057610f40612a79565b5f918252602090912001546001600160a01b031603610f625760019150610f74565b80610f6c81612ac8565b915050610f1b565b5080610fb25781546001810183555f8381526020902001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038a161790555b610fbd855f19611a83565b5050505b80610fcb81612ac8565b915050610ec3565b50508080610fe090612ac8565b915050610e9b565b5050505b80610ff681612ac8565b915050610e48565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff1661108c5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f82116110e55760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b6064820152608401610746565b6040515f90339084908381818185875af1925050503d805f8114611124576040519150601f19603f3d011682016040523d82523d5f602084013e611129565b606091505b50509050806111a05760405162461bcd60e51b815260206004820152602260248201527f537769746368416461707465723a20504c53207472616e73666572206661696c60448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401610746565b6040518381525f907f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2890602001610da0565b5f828152602081905260409020600101546111ec816116bd565b6106c78383611763565b610aaa7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826111d2565b611228611b52565b6040516370a0823160e01b81526001600160a01b0382811660048301525f91908416906370a0823190602401602060405180830381865afa15801561126f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112939190612ae0565b90506112a28686868686611bab565b6040516370a0823160e01b81526001600160a01b0383811660048301525f9183918616906370a0823190602401602060405180830381865afa1580156112ea573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061130e9190612ae0565b6113189190612aa1565b90508581101561136a5760405162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e7420616d6f756e742d6f75740000000000000000006044820152606401610746565b836001600160a01b0316856001600160a01b03167f6be2041a75d9463d869b72bbf3525008cdb98c69774b368f54504594fe722f1389896040516113b8929190918252602082015260400190565b60405180910390a350506113cb60018055565b5050505050565b5f6113de848484611dc9565b90505b9392505050565b336113f35f836106a3565b6107595f826106cc565b5f336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611460576040517f62df054500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151608081015160408201516114a3916001600160a01b03909116907f000000000000000000000000000000000000000000000000000000000000000090611a3a565b604080820151608083015191517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101929092527f000000000000000000000000000000000000000000000000000000000000000016906315afd409906044016020604051808303815f875af1158015611533573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115579190612ae0565b505f807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632bfb780c846040518263ffffffff1660e01b81526004016115a69190612b98565b6060604051808303815f875af11580156115c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115e69190612baa565b9250509150805f036115f857816115fa565b805b9350835f0361160b57846040015193505b606083015160208601516040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201529082166024820152604481018690527f00000000000000000000000000000000000000000000000000000000000000009091169063ae639329906064015f604051808303815f87803b15801561169f575f80fd5b505af11580156116b1573d5f803e3d5ffd5b50505050505050919050565b610aaa8133611e2a565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16610759575f828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561171f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1615610759575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6040517fca4f28030000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526060917f00000000000000000000000000000000000000000000000000000000000000009091169063ca4f2803906024015f60405180830381865afa92505050801561188357506040513d5f823e601f3d908101601f191682016040526118809190810190612bd5565b60015b6106115760405162461bcd60e51b815260206004820152601860248201527f54696465416461707465723a20706f6f6c2d746f6b656e7300000000000000006044820152606401610746565b919050565b80158061194c5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611926573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061194a9190612ae0565b155b6119be5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610746565b6040516001600160a01b0383166024820152604481018290526106c79084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611e9c565b6040516001600160a01b0383166024820152604481018290526106c79084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611a03565b604051636eb1769f60e11b81523060048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660248301525f919084169063dd62ed3e90604401602060405180830381865afa158015611af0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b149190612ae0565b9050818110156106c7576106c76001600160a01b0384167f0000000000000000000000000000000000000000000000000000000000000000846118d4565b600260015403611ba45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610746565b6002600155565b5f611bb68484610a00565b90505f815111611c085760405162461bcd60e51b815260206004820152601560248201527f4e6f20706f6f6c7320666f72207377617070696e6700000000000000000000006044820152606401610746565b5f80611c168387878b611fd9565b90925090506001600160a01b038216611c715760405162461bcd60e51b815260206004820152600e60248201527f556e646566696e656420706f6f6c0000000000000000000000000000000000006044820152606401610746565b6040805160e0810182525f8082526001600160a01b038581166020808501919091528a8216848601529089166060840152608083018c905260a083018b905283518281529081019093529160c082019081525090505f6040518060600160405280838152602001876001600160a01b031681526020018481525090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166348c8949163f5a86ad460e01b83604051602401611d359190612c5f565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199485161790525160e084901b9092168252611d7a916004016125a7565b5f604051808303815f875af1158015611d95573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611dbc9190810190612ca3565b5050505050505050505050565b5f831580611de85750816001600160a01b0316836001600160a01b0316145b15611df457505f6113e1565b5f611dff8484610a00565b905080515f03611e12575f9150506113e1565b5f611e1f82868689611fd9565b979650505050505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1661075957611e5a8161205f565b611e65836020612071565b604051602001611e76929190612d15565b60408051601f198184030181529082905262461bcd60e51b8252610746916004016125a7565b5f80836001600160a01b031683604051611eb69190612d95565b5f604051808303815f865af19150503d805f8114611eef576040519150601f19603f3d011682016040523d82523d5f602084013e611ef4565b606091505b509150915081611f465760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646044820152606401610746565b805115611fd35780806020019051810190611f619190612db0565b611fd35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610746565b50505050565b5f80805b8651811015612055575f878281518110611ff957611ff9612a79565b602002602001015190505f6001600160a01b0316816001600160a01b0316036120225750612043565b5f61202f8289898961224c565b905083811115612040578093508194505b50505b8061204d81612ac8565b915050611fdd565b5094509492505050565b60606106116001600160a01b03831660145b60605f61207f836002612dcf565b61208a906002612de6565b67ffffffffffffffff8111156120a2576120a261261d565b6040519080825280601f01601f1916602001820160405280156120cc576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f8151811061210257612102612a79565b60200101906001600160f81b03191690815f1a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061214c5761214c612a79565b60200101906001600160f81b03191690815f1a9053505f61216e846002612dcf565b612179906001612de6565b90505b60018111156121fd577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121ba576121ba612a79565b1a60f81b8282815181106121d0576121d0612a79565b60200101906001600160f81b03191690815f1a90535060049490941c936121f681612df9565b905061217c565b5083156113e15760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610746565b5f81158061226b5750826001600160a01b0316846001600160a01b0316145b1561227757505f61252b565b604080515f815260208101918290527fa2c70b10000000000000000000000000000000000000000000000000000000009091526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a2c70b10906122f090889088908890889060248101612e0e565b602060405180830381865afa925050508015612329575060408051601f3d908101601f1916820190925261232691810190612ae0565b60015b1561233557905061252b565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c61209a46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612392573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123b69190612e47565b90506001600160a01b0381166123e957507f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b0381166123fa5750305b604080515f808252602082019092527f3ebc54e50000000000000000000000000000000000000000000000000000000090612442908990899089908990889060448101612e62565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505090505f807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836040516124b19190612d95565b5f60405180830381855afa9150503d805f81146124e9576040519150601f19603f3d011682016040523d82523d5f602084013e6124ee565b606091505b50915091508115806124ff57508051155b15612510575f94505050505061252b565b808060200190518101906125249190612ae0565b9450505050505b949350505050565b5f60208284031215612543575f80fd5b81356001600160e01b0319811681146113e1575f80fd5b5f5b8381101561257457818101518382015260200161255c565b50505f910152565b5f815180845261259381602086016020860161255a565b601f01601f19169290920160200192915050565b602081525f6113e1602083018461257c565b5f602082840312156125c9575f80fd5b5035919050565b6001600160a01b0381168114610aaa575f80fd5b80356118cf816125d0565b5f8060408385031215612600575f80fd5b823591506020830135612612816125d0565b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156126545761265461261d565b60405290565b60405160e0810167ffffffffffffffff811182821017156126545761265461261d565b604051601f8201601f1916810167ffffffffffffffff811182821017156126a6576126a661261d565b604052919050565b5f67ffffffffffffffff8211156126c7576126c761261d565b5060051b60200190565b5f60208083850312156126e2575f80fd5b823567ffffffffffffffff8111156126f8575f80fd5b8301601f81018513612708575f80fd5b803561271b612716826126ae565b61267d565b81815260059190911b82018301908381019087831115612739575f80fd5b928401925b82841015611e1f578335612751816125d0565b8252928401929084019061273e565b5f8060408385031215612771575f80fd5b823561277c816125d0565b91506020830135612612816125d0565b602080825282518282018190525f9190848201906040850190845b818110156127cc5783516001600160a01b0316835292840192918401916001016127a7565b50909695505050505050565b5f602082840312156127e8575f80fd5b81356113e1816125d0565b5f8060408385031215612804575f80fd5b823561280f816125d0565b946020939093013593505050565b5f805f805f60a08688031215612831575f80fd5b8535945060208601359350604086013561284a816125d0565b9250606086013561285a816125d0565b9150608086013561286a816125d0565b809150509295509295909350565b5f805f6060848603121561288a575f80fd5b83359250602084013561289c816125d0565b915060408401356128ac816125d0565b809150509250925092565b8035600281106118cf575f80fd5b5f67ffffffffffffffff8211156128de576128de61261d565b50601f01601f191660200190565b5f82601f8301126128fb575f80fd5b8135612909612716826128c5565b81815284602083860101111561291d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215612949575f80fd5b813567ffffffffffffffff80821115612960575f80fd5b9083019060608286031215612973575f80fd5b61297b612631565b823582811115612989575f80fd5b830160e0818803121561299a575f80fd5b6129a261265a565b6129ab826128b7565b81526129b9602083016125e4565b60208201526129ca604083016125e4565b60408201526129db606083016125e4565b60608201526080820135608082015260a082013560a082015260c082013584811115612a05575f80fd5b612a11898285016128ec565b60c083015250825250612a26602084016125e4565b60208201526040830135604082015280935050505092915050565b600181811c90821680612a5557607f821691505b602082108103612a7357634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8181038181111561061157610611612a8d565b634e487b7160e01b5f52603160045260245ffd5b5f60018201612ad957612ad9612a8d565b5060010190565b5f60208284031215612af0575f80fd5b5051919050565b5f815160028110612b1657634e487b7160e01b5f52602160045260245ffd5b808452506020820151612b3460208501826001600160a01b03169052565b506040820151612b4f60408501826001600160a01b03169052565b506060820151612b6a60608501826001600160a01b03169052565b506080820151608084015260a082015160a084015260c082015160e060c085015261252b60e085018261257c565b602081525f6113e16020830184612af7565b5f805f60608486031215612bbc575f80fd5b8351925060208401519150604084015190509250925092565b5f6020808385031215612be6575f80fd5b825167ffffffffffffffff811115612bfc575f80fd5b8301601f81018513612c0c575f80fd5b8051612c1a612716826126ae565b81815260059190911b82018301908381019087831115612c38575f80fd5b928401925b82841015611e1f578351612c50816125d0565b82529284019290840190612c3d565b602081525f825160606020840152612c7a6080840182612af7565b90506001600160a01b036020850151166040840152604084015160608401528091505092915050565b5f60208284031215612cb3575f80fd5b815167ffffffffffffffff811115612cc9575f80fd5b8201601f81018413612cd9575f80fd5b8051612ce7612716826128c5565b818152856020838501011115612cfb575f80fd5b612d0c82602083016020860161255a565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351612d4c81601785016020880161255a565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612d8981602884016020880161255a565b01602801949350505050565b5f8251612da681846020870161255a565b9190910192915050565b5f60208284031215612dc0575f80fd5b815180151581146113e1575f80fd5b808202811582820484141761061157610611612a8d565b8082018082111561061157610611612a8d565b5f81612e0757612e07612a8d565b505f190190565b5f6001600160a01b038088168352808716602084015280861660408401525083606083015260a06080830152611e1f60a083018461257c565b5f60208284031215612e57575f80fd5b81516113e1816125d0565b5f6001600160a01b0380891683528088166020840152808716604084015285606084015280851660808401525060c060a0830152612ea360c083018461257c565b9897505050505050505056fea2646970667358221220573556ee626d0a819527f7f828829a08ddaff5185e72e73cc3dc74b10bdf89e464736f6c63430008140033a54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d394d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d000000000000000000000000dc09fcdc3ba071e3c6ca8d344849aec0cd4e25a30000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002d2a8000000000000000000000000d7b324ef7a246c7c77fbee99aed08e0bedca692d000000000000000000000000000000000000000000000000000000000000000b5469646541646170746572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000346b508712a0443de7b7c3e7e90d940d6cf8cac7000000000000000000000000c23c09f8b908e38caa641ff9b1a577d75f2c2498000000000000000000000000a481a20aeac229ba05ba3c9a0c7547e09793dfa90000000000000000000000008662d605bb3554907cd80c60ee99a6e3b53f1fc100000000000000000000000018515a8d416d7709e0be994415d460a1c2e427710000000000000000000000004db2c44496a7039727950b5ea34db6448fdcaf43000000000000000000000000e8dd98d9c63c750bedb081b6bd4dc4f60fc2d0410000000000000000000000006926c634e0444799f48c1a328f616dd8084fe38b000000000000000000000000418058356fb3f30c0d25528768f01a28c0fb27e7000000000000000000000000f39b2485e34f282fb3d2db6b0f1dbfb78b2adda6000000000000000000000000f20d005bf1fe3aaa743e38b49e457ec049c3c1e80000000000000000000000005d504b96b9035bf89a12aa0dbc96b12556993ca70000000000000000000000008ae7f93479f90ae6ea123d60c683325006c11a92000000000000000000000000d503d2f5b84810dfc137db77ecfac20f74f11fc9000000000000000000000000d591e7a2a5bd04846340aadda7236c332c507a43

Deployed ByteCode

0x6080604052600436106101a7575f3560e01c806391d14854116100e7578063eab90da611610087578063f5a86ad411610062578063f5a86ad4146104f7578063f874225414610516578063f887ea4014610549578063fbfa77cf1461057c575f80fd5b8063eab90da61461049a578063ef99893a146104b9578063f2fde38b146104d8575f80fd5b8063c6bbd5a7116100c2578063c6bbd5a7146103f2578063d3a43ac31461043d578063d547741f1461045c578063d8baf7cf1461047b575f80fd5b806391d148541461037e578063a217fddf146103c0578063b36a4ab1146103d3575f80fd5b80635b1dc86f116101525780637ae267731161012d5780637ae267731461030257806384a33e63146103215780638980f11f146103405780638bb9c5bf1461035f575f80fd5b80635b1dc86f146102a257806369cff80d146102ce5780636b453c1f146102e3575f80fd5b80632f2ff15d116101825780632f2ff15d1461024357806336568abe146102645780634b16414014610283575f80fd5b806301ffc9a7146101b257806306fdde03146101e6578063248a9ca314610207575f80fd5b366101ae57005b5f80fd5b3480156101bd575f80fd5b506101d16101cc366004612533565b6105af565b60405190151581526020015b60405180910390f35b3480156101f1575f80fd5b506101fa610617565b6040516101dd91906125a7565b348015610212575f80fd5b506102356102213660046125b9565b5f9081526020819052604090206001015490565b6040519081526020016101dd565b34801561024e575f80fd5b5061026261025d3660046125ef565b6106a3565b005b34801561026f575f80fd5b5061026261027e3660046125ef565b6106cc565b34801561028e575f80fd5b5061026261029d3660046126d1565b61075d565b3480156102ad575f80fd5b506102c16102bc366004612760565b610a00565b6040516101dd919061278c565b3480156102d9575f80fd5b5061023560025481565b3480156102ee575f80fd5b506102626102fd3660046127d8565b610a80565b34801561030d575f80fd5b5061026261031c366004612760565b610aad565b34801561032c575f80fd5b5061026261033b3660046125b9565b610b4f565b34801561034b575f80fd5b5061026261035a3660046127f3565b610c6a565b34801561036a575f80fd5b506102626103793660046125b9565b610dad565b348015610389575f80fd5b506101d16103983660046125ef565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103cb575f80fd5b506102355f81565b3480156103de575f80fd5b506102626103ed3660046126d1565b610db8565b3480156103fd575f80fd5b506104257f000000000000000000000000dc09fcdc3ba071e3c6ca8d344849aec0cd4e25a381565b6040516001600160a01b0390911681526020016101dd565b348015610448575f80fd5b506102626104573660046125b9565b610ffe565b348015610467575f80fd5b506102626104763660046125ef565b6111d2565b348015610486575f80fd5b506102626104953660046127d8565b6111f6565b3480156104a5575f80fd5b506102626104b436600461281d565b611220565b3480156104c4575f80fd5b506102356104d3366004612878565b6113d2565b3480156104e3575f80fd5b506102626104f23660046127d8565b6113e8565b348015610502575f80fd5b50610235610511366004612939565b6113fd565b348015610521575f80fd5b506102357f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b348015610554575f80fd5b506104257f000000000000000000000000d7b324ef7a246c7c77fbee99aed08e0bedca692d81565b348015610587575f80fd5b506104257f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d81565b5f6001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061061157507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6003805461062490612a41565b80601f016020809104026020016040519081016040528092919081815260200182805461065090612a41565b801561069b5780601f106106725761010080835404028352916020019161069b565b820191905f5260205f20905b81548152906001019060200180831161067e57829003601f168201915b505050505081565b5f828152602081905260409020600101546106bd816116bd565b6106c783836116c7565b505050565b6001600160a01b038116331461074f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107598282611763565b5050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166107eb5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f5b82518110156106c7575f83828151811061080957610809612a79565b602002602001015190505f6001600160a01b0316816001600160a01b03160361083257506109ee565b5f61083c826117e0565b90505f5b81518110156109ea575f82828151811061085c5761085c612a79565b602002602001015190505f5b83518110156109d5578281146109c3575f84828151811061088b5761088b612a79565b6020908102919091018101516001600160a01b038086165f9081526004845260408082209284168252919093528220909250905b81548110156109bf57876001600160a01b03168282815481106108e4576108e4612a79565b5f918252602090912001546001600160a01b0316036109b7578154829061090d90600190612aa1565b8154811061091d5761091d612a79565b905f5260205f20015f9054906101000a90046001600160a01b031682828154811061094a5761094a612a79565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508180548061098557610985612ab4565b5f8281526020902081015f19908101805473ffffffffffffffffffffffffffffffffffffffff191690550190556109bf565b6001016108bf565b5050505b806109cd81612ac8565b915050610868565b505080806109e290612ac8565b915050610840565b5050505b806109f881612ac8565b9150506107ed565b6001600160a01b038083165f908152600460209081526040808320938516835292815290829020805483518184028101840190945280845260609392830182828015610a7357602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610a55575b5050505050905092915050565b610aaa7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826106a3565b50565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610b3b5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b6106c76001600160a01b038416835f6118d4565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610bdd5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b815f03610c2c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206761732d657374696d6174650000000000000000000000006044820152606401610746565b600282905560405182815230907ff43f23b7a28e6f8ce6843a21bd7b48bce778aa913b8c8cf459edf7d770e8d38a9060200160405180910390a25050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610cf85760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f8211610d515760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b6064820152608401610746565b610d656001600160a01b0384163384611a3a565b826001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2883604051610da091815260200190565b60405180910390a2505050565b3361075982826106cc565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610e465760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f5b82518110156106c7575f838281518110610e6457610e64612a79565b602002602001015190505f6001600160a01b0316816001600160a01b031603610e8d5750610fec565b5f610e97826117e0565b90505f5b8151811015610fe8575f828281518110610eb757610eb7612a79565b602002602001015190505f5b8351811015610fd357828114610fc1575f848281518110610ee657610ee6612a79565b6020908102919091018101516001600160a01b038086165f908152600484526040808220928416825291909352822090925090805b8254811015610f7457886001600160a01b0316838281548110610f4057610f40612a79565b5f918252602090912001546001600160a01b031603610f625760019150610f74565b80610f6c81612ac8565b915050610f1b565b5080610fb25781546001810183555f8381526020902001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038a161790555b610fbd855f19611a83565b5050505b80610fcb81612ac8565b915050610ec3565b50508080610fe090612ac8565b915050610e9b565b5050505b80610ff681612ac8565b915050610e48565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff1661108c5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b6064820152608401610746565b5f82116110e55760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b6064820152608401610746565b6040515f90339084908381818185875af1925050503d805f8114611124576040519150601f19603f3d011682016040523d82523d5f602084013e611129565b606091505b50509050806111a05760405162461bcd60e51b815260206004820152602260248201527f537769746368416461707465723a20504c53207472616e73666572206661696c60448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401610746565b6040518381525f907f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2890602001610da0565b5f828152602081905260409020600101546111ec816116bd565b6106c78383611763565b610aaa7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826111d2565b611228611b52565b6040516370a0823160e01b81526001600160a01b0382811660048301525f91908416906370a0823190602401602060405180830381865afa15801561126f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112939190612ae0565b90506112a28686868686611bab565b6040516370a0823160e01b81526001600160a01b0383811660048301525f9183918616906370a0823190602401602060405180830381865afa1580156112ea573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061130e9190612ae0565b6113189190612aa1565b90508581101561136a5760405162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e7420616d6f756e742d6f75740000000000000000006044820152606401610746565b836001600160a01b0316856001600160a01b03167f6be2041a75d9463d869b72bbf3525008cdb98c69774b368f54504594fe722f1389896040516113b8929190918252602082015260400190565b60405180910390a350506113cb60018055565b5050505050565b5f6113de848484611dc9565b90505b9392505050565b336113f35f836106a3565b6107595f826106cc565b5f336001600160a01b037f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d1614611460576040517f62df054500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151608081015160408201516114a3916001600160a01b03909116907f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d90611a3a565b604080820151608083015191517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101929092527f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d16906315afd409906044016020604051808303815f875af1158015611533573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115579190612ae0565b505f807f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d6001600160a01b0316632bfb780c846040518263ffffffff1660e01b81526004016115a69190612b98565b6060604051808303815f875af11580156115c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115e69190612baa565b9250509150805f036115f857816115fa565b805b9350835f0361160b57846040015193505b606083015160208601516040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201529082166024820152604481018690527f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d9091169063ae639329906064015f604051808303815f87803b15801561169f575f80fd5b505af11580156116b1573d5f803e3d5ffd5b50505050505050919050565b610aaa8133611e2a565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16610759575f828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561171f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1615610759575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6040517fca4f28030000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526060917f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d9091169063ca4f2803906024015f60405180830381865afa92505050801561188357506040513d5f823e601f3d908101601f191682016040526118809190810190612bd5565b60015b6106115760405162461bcd60e51b815260206004820152601860248201527f54696465416461707465723a20706f6f6c2d746f6b656e7300000000000000006044820152606401610746565b919050565b80158061194c5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611926573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061194a9190612ae0565b155b6119be5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610746565b6040516001600160a01b0383166024820152604481018290526106c79084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611e9c565b6040516001600160a01b0383166024820152604481018290526106c79084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611a03565b604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d811660248301525f919084169063dd62ed3e90604401602060405180830381865afa158015611af0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b149190612ae0565b9050818110156106c7576106c76001600160a01b0384167f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d846118d4565b600260015403611ba45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610746565b6002600155565b5f611bb68484610a00565b90505f815111611c085760405162461bcd60e51b815260206004820152601560248201527f4e6f20706f6f6c7320666f72207377617070696e6700000000000000000000006044820152606401610746565b5f80611c168387878b611fd9565b90925090506001600160a01b038216611c715760405162461bcd60e51b815260206004820152600e60248201527f556e646566696e656420706f6f6c0000000000000000000000000000000000006044820152606401610746565b6040805160e0810182525f8082526001600160a01b038581166020808501919091528a8216848601529089166060840152608083018c905260a083018b905283518281529081019093529160c082019081525090505f6040518060600160405280838152602001876001600160a01b031681526020018481525090507f000000000000000000000000634f6b9cd1f860314871548d2224362825384b2d6001600160a01b03166348c8949163f5a86ad460e01b83604051602401611d359190612c5f565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199485161790525160e084901b9092168252611d7a916004016125a7565b5f604051808303815f875af1158015611d95573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611dbc9190810190612ca3565b5050505050505050505050565b5f831580611de85750816001600160a01b0316836001600160a01b0316145b15611df457505f6113e1565b5f611dff8484610a00565b905080515f03611e12575f9150506113e1565b5f611e1f82868689611fd9565b979650505050505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1661075957611e5a8161205f565b611e65836020612071565b604051602001611e76929190612d15565b60408051601f198184030181529082905262461bcd60e51b8252610746916004016125a7565b5f80836001600160a01b031683604051611eb69190612d95565b5f604051808303815f865af19150503d805f8114611eef576040519150601f19603f3d011682016040523d82523d5f602084013e611ef4565b606091505b509150915081611f465760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646044820152606401610746565b805115611fd35780806020019051810190611f619190612db0565b611fd35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610746565b50505050565b5f80805b8651811015612055575f878281518110611ff957611ff9612a79565b602002602001015190505f6001600160a01b0316816001600160a01b0316036120225750612043565b5f61202f8289898961224c565b905083811115612040578093508194505b50505b8061204d81612ac8565b915050611fdd565b5094509492505050565b60606106116001600160a01b03831660145b60605f61207f836002612dcf565b61208a906002612de6565b67ffffffffffffffff8111156120a2576120a261261d565b6040519080825280601f01601f1916602001820160405280156120cc576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f8151811061210257612102612a79565b60200101906001600160f81b03191690815f1a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061214c5761214c612a79565b60200101906001600160f81b03191690815f1a9053505f61216e846002612dcf565b612179906001612de6565b90505b60018111156121fd577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121ba576121ba612a79565b1a60f81b8282815181106121d0576121d0612a79565b60200101906001600160f81b03191690815f1a90535060049490941c936121f681612df9565b905061217c565b5083156113e15760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610746565b5f81158061226b5750826001600160a01b0316846001600160a01b0316145b1561227757505f61252b565b604080515f815260208101918290527fa2c70b10000000000000000000000000000000000000000000000000000000009091526001600160a01b037f000000000000000000000000dc09fcdc3ba071e3c6ca8d344849aec0cd4e25a3169063a2c70b10906122f090889088908890889060248101612e0e565b602060405180830381865afa925050508015612329575060408051601f3d908101601f1916820190925261232691810190612ae0565b60015b1561233557905061252b565b5f7f000000000000000000000000dc09fcdc3ba071e3c6ca8d344849aec0cd4e25a36001600160a01b031663c61209a46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612392573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123b69190612e47565b90506001600160a01b0381166123e957507f000000000000000000000000d7b324ef7a246c7c77fbee99aed08e0bedca692d5b6001600160a01b0381166123fa5750305b604080515f808252602082019092527f3ebc54e50000000000000000000000000000000000000000000000000000000090612442908990899089908990889060448101612e62565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505090505f807f000000000000000000000000d7b324ef7a246c7c77fbee99aed08e0bedca692d6001600160a01b0316836040516124b19190612d95565b5f60405180830381855afa9150503d805f81146124e9576040519150601f19603f3d011682016040523d82523d5f602084013e6124ee565b606091505b50915091508115806124ff57508051155b15612510575f94505050505061252b565b808060200190518101906125249190612ae0565b9450505050505b949350505050565b5f60208284031215612543575f80fd5b81356001600160e01b0319811681146113e1575f80fd5b5f5b8381101561257457818101518382015260200161255c565b50505f910152565b5f815180845261259381602086016020860161255a565b601f01601f19169290920160200192915050565b602081525f6113e1602083018461257c565b5f602082840312156125c9575f80fd5b5035919050565b6001600160a01b0381168114610aaa575f80fd5b80356118cf816125d0565b5f8060408385031215612600575f80fd5b823591506020830135612612816125d0565b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156126545761265461261d565b60405290565b60405160e0810167ffffffffffffffff811182821017156126545761265461261d565b604051601f8201601f1916810167ffffffffffffffff811182821017156126a6576126a661261d565b604052919050565b5f67ffffffffffffffff8211156126c7576126c761261d565b5060051b60200190565b5f60208083850312156126e2575f80fd5b823567ffffffffffffffff8111156126f8575f80fd5b8301601f81018513612708575f80fd5b803561271b612716826126ae565b61267d565b81815260059190911b82018301908381019087831115612739575f80fd5b928401925b82841015611e1f578335612751816125d0565b8252928401929084019061273e565b5f8060408385031215612771575f80fd5b823561277c816125d0565b91506020830135612612816125d0565b602080825282518282018190525f9190848201906040850190845b818110156127cc5783516001600160a01b0316835292840192918401916001016127a7565b50909695505050505050565b5f602082840312156127e8575f80fd5b81356113e1816125d0565b5f8060408385031215612804575f80fd5b823561280f816125d0565b946020939093013593505050565b5f805f805f60a08688031215612831575f80fd5b8535945060208601359350604086013561284a816125d0565b9250606086013561285a816125d0565b9150608086013561286a816125d0565b809150509295509295909350565b5f805f6060848603121561288a575f80fd5b83359250602084013561289c816125d0565b915060408401356128ac816125d0565b809150509250925092565b8035600281106118cf575f80fd5b5f67ffffffffffffffff8211156128de576128de61261d565b50601f01601f191660200190565b5f82601f8301126128fb575f80fd5b8135612909612716826128c5565b81815284602083860101111561291d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215612949575f80fd5b813567ffffffffffffffff80821115612960575f80fd5b9083019060608286031215612973575f80fd5b61297b612631565b823582811115612989575f80fd5b830160e0818803121561299a575f80fd5b6129a261265a565b6129ab826128b7565b81526129b9602083016125e4565b60208201526129ca604083016125e4565b60408201526129db606083016125e4565b60608201526080820135608082015260a082013560a082015260c082013584811115612a05575f80fd5b612a11898285016128ec565b60c083015250825250612a26602084016125e4565b60208201526040830135604082015280935050505092915050565b600181811c90821680612a5557607f821691505b602082108103612a7357634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8181038181111561061157610611612a8d565b634e487b7160e01b5f52603160045260245ffd5b5f60018201612ad957612ad9612a8d565b5060010190565b5f60208284031215612af0575f80fd5b5051919050565b5f815160028110612b1657634e487b7160e01b5f52602160045260245ffd5b808452506020820151612b3460208501826001600160a01b03169052565b506040820151612b4f60408501826001600160a01b03169052565b506060820151612b6a60608501826001600160a01b03169052565b506080820151608084015260a082015160a084015260c082015160e060c085015261252b60e085018261257c565b602081525f6113e16020830184612af7565b5f805f60608486031215612bbc575f80fd5b8351925060208401519150604084015190509250925092565b5f6020808385031215612be6575f80fd5b825167ffffffffffffffff811115612bfc575f80fd5b8301601f81018513612c0c575f80fd5b8051612c1a612716826126ae565b81815260059190911b82018301908381019087831115612c38575f80fd5b928401925b82841015611e1f578351612c50816125d0565b82529284019290840190612c3d565b602081525f825160606020840152612c7a6080840182612af7565b90506001600160a01b036020850151166040840152604084015160608401528091505092915050565b5f60208284031215612cb3575f80fd5b815167ffffffffffffffff811115612cc9575f80fd5b8201601f81018413612cd9575f80fd5b8051612ce7612716826128c5565b818152856020838501011115612cfb575f80fd5b612d0c82602083016020860161255a565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351612d4c81601785016020880161255a565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612d8981602884016020880161255a565b01602801949350505050565b5f8251612da681846020870161255a565b9190910192915050565b5f60208284031215612dc0575f80fd5b815180151581146113e1575f80fd5b808202811582820484141761061157610611612a8d565b8082018082111561061157610611612a8d565b5f81612e0757612e07612a8d565b505f190190565b5f6001600160a01b038088168352808716602084015280861660408401525083606083015260a06080830152611e1f60a083018461257c565b5f60208284031215612e57575f80fd5b81516113e1816125d0565b5f6001600160a01b0380891683528088166020840152808716604084015285606084015280851660808401525060c060a0830152612ea360c083018461257c565b9897505050505050505056fea2646970667358221220573556ee626d0a819527f7f828829a08ddaff5185e72e73cc3dc74b10bdf89e464736f6c63430008140033