ETH Price: $3,363.49 (-2.59%)
Gas: 4.62 Gwei

Contract

0x5999dD8b46d5d3363C6563FAC3cEE2a6420A3aC7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Liquidate Positi...143970752022-03-16 10:35:121016 days ago1647426912IN
0x5999dD8b...6420A3aC7
0 ETH0.0108462427.68531527
Liquidate Positi...143970662022-03-16 10:33:371016 days ago1647426817IN
0x5999dD8b...6420A3aC7
0 ETH0.0115717833.8507602
Liquidate Positi...143970582022-03-16 10:31:291016 days ago1647426689IN
0x5999dD8b...6420A3aC7
0 ETH0.0137110530.0839296
Withdraw133142992021-09-28 12:36:261185 days ago1632832586IN
0x5999dD8b...6420A3aC7
0 ETH0.0020980350.90700848
Liquidate Positi...125155812021-05-27 9:23:051309 days ago1622107385IN
0x5999dD8b...6420A3aC7
0 ETH0.0045386832
Withdraw123788742021-05-06 5:22:131330 days ago1620278533IN
0x5999dD8b...6420A3aC7
0 ETH0.00192540
Close Position123764952021-05-05 20:47:551331 days ago1620247675IN
0x5999dD8b...6420A3aC7
0 ETH0.0213440886
Withdraw122912542021-04-22 17:02:061344 days ago1619110926IN
0x5999dD8b...6420A3aC7
0 ETH0.00745937155
Close Position122905952021-04-22 14:33:251344 days ago1619102005IN
0x5999dD8b...6420A3aC7
0 ETH0.03181616123
Withdraw120844992021-03-21 21:09:381376 days ago1616360978IN
0x5999dD8b...6420A3aC7
0 ETH0.0096339204
Close Position120844312021-03-21 20:52:261376 days ago1616359946IN
0x5999dD8b...6420A3aC7
0 ETH0.04260286167
Open Long Positi...120264802021-03-12 22:47:111385 days ago1615589231IN
0x5999dD8b...6420A3aC7
0 ETH0.08689308152.3
Liquidate Positi...119996972021-03-08 19:19:461389 days ago1615231186IN
0x5999dD8b...6420A3aC7
0 ETH0.03564933139
Withdraw119974162021-03-08 10:58:341389 days ago1615201114IN
0x5999dD8b...6420A3aC7
0 ETH0.0028980990
Withdraw119970812021-03-08 9:38:551389 days ago1615196335IN
0x5999dD8b...6420A3aC7
0 ETH0.00500585106
Close Position119970742021-03-08 9:37:151389 days ago1615196235IN
0x5999dD8b...6420A3aC7
0 ETH0.0217112197
Deposit119965402021-03-08 7:38:381389 days ago1615189118IN
0x5999dD8b...6420A3aC7
0 ETH0.0062234100
Liquidate Positi...119961912021-03-08 6:14:541389 days ago1615184094IN
0x5999dD8b...6420A3aC7
0 ETH0.014669581
Withdraw119930392021-03-07 18:52:591390 days ago1615143179IN
0x5999dD8b...6420A3aC7
0 ETH0.01038686220
Open Long Positi...119837772021-03-06 8:32:021391 days ago1615019522IN
0x5999dD8b...6420A3aC7
0 ETH0.0519190491
Deposit119836992021-03-06 8:13:291391 days ago1615018409IN
0x5999dD8b...6420A3aC7
0 ETH0.0039204283
Withdraw119826802021-03-06 4:29:271391 days ago1615004967IN
0x5999dD8b...6420A3aC7
0 ETH0.0029279562
Withdraw119824872021-03-06 3:47:031391 days ago1615002423IN
0x5999dD8b...6420A3aC7
0 ETH0.0036344777
Deposit119813632021-03-05 23:43:411392 days ago1614987821IN
0x5999dD8b...6420A3aC7
0 ETH0.0041093587
Deposit119803182021-03-05 19:47:061392 days ago1614973626IN
0x5999dD8b...6420A3aC7
0 ETH0.00431935134
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UniMexMargin

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-01-18
*/

// SPDX-License-Identifier: UNLICENSED
// File: @openzeppelin/contracts/utils/EnumerableSet.sol


pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint256(_at(set._inner, index)));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

// File: @openzeppelin/contracts/utils/Address.sol


pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/GSN/Context.sol


pragma solidity >=0.6.0 <0.8.0;

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

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

// File: @openzeppelin/contracts/access/AccessControl.sol


pragma solidity >=0.6.0 <0.8.0;




/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * 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:
 *
 * ```
 * 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}:
 *
 * ```
 * 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.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @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 {_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) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @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 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.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _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.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _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 granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        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.
     *
     * [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}.
     * ====
     */
    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 {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// File: @openzeppelin/contracts/access/Ownable.sol


pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/math/SafeMath.sol


pragma solidity >=0.6.0 <0.8.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

// File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol


pragma solidity >=0.6.0 <0.8.0;




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

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

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

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

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

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

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

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

// File: contracts/Uniswap.sol


pragma solidity 0.6.12;


interface IUniswapV2Pair {
    function getReserves() external view returns (uint112 r0, uint112 r1, uint32 blockTimestampLast);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
}

interface IUniswapV2Factory {
    function getPair(address a, address b) external view returns (address p);
}

interface IUniswapV2Router02 {
    function WETH() external returns (address);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

library UniswapV2Library {
    using SafeMath for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UV2: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UV2: ZERO_ADDRESS');
    }
    
    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UV2: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UV2: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }
}

// File: contracts/IUniMexFactory.sol


pragma solidity 0.6.12;

interface IUniMexFactory {
  function getPool(address) external returns(address);
  function getMaxLeverage(address) external returns(uint256);
  function allowedMargins(address) external returns (bool);
  function utilizationScaled(address token) external pure returns(uint256);
}

// File: contracts/UniMexMargin.sol


pragma solidity 0.6.12;







interface IUniMexStaking {
    function distribute(uint256 _amount) external;
}

interface IUniMexPool {
    function borrow(uint256 _amount) external;
    function distribute(uint256 _amount) external;
    function repay(uint256 _amount) external returns (bool);
}

contract UniMexMargin is Ownable, AccessControl {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    bytes32 public constant LIQUIDATOR_ROLE = keccak256("LIQUIDATOR_ROLE");

    address private WETH_ADDRESS;
    IERC20 public WETH;
    uint256 public constant MAG = 1e18;
    uint256 public constant LIQUIDATION_MARGIN = 11*1e17; //10%
    uint256 public liquidationBonus = 9 * 1e16;
    uint256 public borrowInterestPercentScaled = 100; //10%
    uint256 public constant YEAR = 31536000;
    uint256 public positionNonce = 0;
    bool public paused = false;
    
    struct Position {
        bytes32 id;
        address token;
        address owner;
        uint256 owed;
        uint256 input;
        uint256 commitment;
        uint256 leverage;
        uint256 startTimestamp;
        bool isShort;
        uint256 borrowInterest;
    }
    
    mapping(bytes32 => Position) public positionInfo;
    mapping(address => uint256) public balanceOf;
    mapping(address => uint256) public escrow;
    
    IUniMexStaking public staking;
    IUniMexFactory public unimex_factory;
    IUniswapV2Factory public uniswap_factory;
    IUniswapV2Router02 public uniswap_router;

    event OnClosePosition(
        bytes32 indexed positionId,
        address token,
        address indexed owner,
        uint256 owed,
        uint256 input,
        uint256 commitment,
        uint256 leverage,
        uint256 startTimestamp,
        bool isShort,
        uint256 borrowInterest,
        uint256 liquidationBonus, //amount that went to liquidator when position was liquidated. 0 if position was closed
        uint256 scaledCloseRate // weth/token multiplied by 1e18
    );

    event OnOpenPosition(
        address indexed sender,
        bytes32 positionId,
        bool isShort,
        address indexed token
    );

    event OnAddCommitment(
        bytes32 indexed positionId,
        uint256 amount
    );

    //to prevent flashloans
    modifier isHuman() {
        require(msg.sender == tx.origin);
        _;
    }

    constructor(
        address _staking,
        address _factory,
        address _weth,
        address _uniswap_factory,
        address _uniswap_router
    ) public {
        staking = IUniMexStaking(_staking);
        unimex_factory = IUniMexFactory(_factory);
        WETH_ADDRESS = _weth;
        WETH = IERC20(_weth);
        uniswap_factory = IUniswapV2Factory(_uniswap_factory);
        uniswap_router = IUniswapV2Router02(_uniswap_router);

        // Grant the contract deployer the default admin role: it will be able
        // to grant and revoke any roles
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    function deposit(uint256 _amount) public {
        WETH.safeTransferFrom(msg.sender, address(this), _amount);
        balanceOf[msg.sender] = balanceOf[msg.sender].add(_amount);
    }

    function withdraw(uint256 _amount) public {
        require(balanceOf[msg.sender] >= _amount);
        balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
        WETH.safeTransfer(msg.sender, _amount);
    }

    function calculateBorrowInterest(bytes32 positionId) public view returns (uint256) {
        Position storage position = positionInfo[positionId];
        uint256 loanTime = block.timestamp.sub(position.startTimestamp);
        return position.owed.mul(loanTime).mul(position.borrowInterest).div(1000).div(YEAR);
    }

    function openShortPosition(address token, uint256 amount, uint256 scaledLeverage, uint256 minimalSwapAmount) public isHuman {
        _openPosition(token, amount, scaledLeverage, minimalSwapAmount, true);
    }

    function openLongPosition(address token, uint256 amount, uint256 scaledLeverage, uint256 minimalSwapAmount) public isHuman {
        _openPosition(token, amount, scaledLeverage, minimalSwapAmount, false);
    }

    function _openPosition(address token, uint256 amount, uint256 scaledLeverage, uint256 minimalSwapAmount, bool isShort) private {
        require(!paused, "PAUSED");
        require(amount > 0, "AMOUNT_ZERO");
        address pool = unimex_factory.getPool(address(isShort ? IERC20(token) : WETH));

        require(pool != address(0), "POOL_DOES_NOT_EXIST");
        require(scaledLeverage <= unimex_factory.getMaxLeverage(token).mul(MAG), "LEVERAGE_EXCEEDS_MAX");

        uint amountInWeth = isShort ? calculateConvertedValue(token, WETH_ADDRESS, amount) : amount;
        uint256 commitment = getCommitment(amountInWeth, scaledLeverage);
        require(balanceOf[msg.sender] >= commitment.add(liquidationBonus), "NO_BALANCE");

        IUniMexPool(pool).borrow(amount);

        uint256 swap;

        {
            (address baseToken, address quoteToken) = isShort ? (token, WETH_ADDRESS) : (WETH_ADDRESS, token);
            swap = swapTokens(baseToken, quoteToken, amount);
            require(swap >= minimalSwapAmount, "INSUFFICIENT_SWAP");
        }

        uint256 fees = (swap.mul(8)).div(1000);

        swap = swap.sub(fees); // swap minus fees

        if(!isShort) {
            fees = swapTokens(token, WETH_ADDRESS, fees); // convert fees to ETH
        }

        transferFees(fees, pool);

        transferUserToEscrow(msg.sender, msg.sender, commitment.add(liquidationBonus));

        positionNonce = positionNonce + 1; //possible overflow is ok
        bytes32 positionId = getPositionId(
            msg.sender,
            token,
            amount,
            scaledLeverage,
            positionNonce
        );

        Position memory position = Position({
        owed: amount,
        input: swap,
        commitment: commitment.add(liquidationBonus),
        owner: msg.sender,
        startTimestamp: block.timestamp,
        isShort: isShort,
        leverage: scaledLeverage,
        token: token,
        id: positionId,
        borrowInterest: borrowInterestPercentScaled
        });

        positionInfo[position.id] = position;

        emit OnOpenPosition(msg.sender, position.id, isShort, token);
    }

    function addCommitmentToPosition(bytes32 positionId, uint256 amount) public {
        Position storage position = positionInfo[positionId];
        require(position.owner != address(0), "NO_POSITION");
        position.commitment = position.commitment.add(amount);
        WETH.safeTransferFrom(msg.sender, address(this), amount);
        escrow[position.owner] = escrow[position.owner].add(amount);
        emit OnAddCommitment(positionId, amount);
    }

    function closePosition(bytes32 positionId, uint256 minimalSwapAmount) external isHuman {
        Position storage position = positionInfo[positionId];
        require(position.owner != address(0), "NO_OPEN_POSITION");
        require(msg.sender == position.owner, "BORROWER_ONLY");
        uint256 scaledRate;
        if(position.isShort) {
            scaledRate = _closeShort(position, minimalSwapAmount);
        }else{
            scaledRate = _closeLong(position, minimalSwapAmount);
        }
        deletePosition(position, 0, scaledRate);
    }

    function _closeShort(Position storage position, uint256 minimalSwapAmount) private returns (uint256){
        uint256 input = position.input;
        uint256 owed = position.owed;
        uint256 commitment = position.commitment;

        address pool = unimex_factory.getPool(position.token);

        uint256 poolInterestInTokens = calculateBorrowInterest(position.id);
        uint256 swap = swapTokens(WETH_ADDRESS, position.token, input);
        require(swap >= minimalSwapAmount, "INSUFFICIENT_SWAP");
        uint256 scaledRate = calculateScaledRate(input, swap);
        require(swap >= owed.add(poolInterestInTokens).mul(input).div(input.add(commitment)), "LIQUIDATE_ONLY");

        bool isProfit = owed < swap;
        uint256 amount;

        uint256 fees = poolInterestInTokens > 0 ? calculateConvertedValue(position.token, address(WETH), poolInterestInTokens) : 0;
        if(isProfit) {
            uint256 profitInTokens = swap.sub(owed);
            amount = swapTokens(position.token, WETH_ADDRESS, profitInTokens); //profit in eth
        } else {
            uint256 commitmentInTokens = swapTokens(WETH_ADDRESS, position.token, commitment);
            uint256 remainder = owed.sub(swap);
            require(commitmentInTokens >= remainder, "LIQUIDATE_ONLY");
            amount = swapTokens(position.token, WETH_ADDRESS, commitmentInTokens.sub(remainder)); //return to user's balance
        }
        if(isProfit) {
            if(amount >= fees) {
                transferEscrowToUser(position.owner, position.owner, commitment);
                transferToUser(position.owner, amount.sub(fees));
            } else {
                uint256 remainder = fees.sub(amount);
                transferEscrowToUser(position.owner, position.owner, commitment.sub(remainder));
                transferEscrowToUser(position.owner, address(0), remainder);
            }
        } else {
            require(amount >= fees, "LIQUIDATE_ONLY"); //safety check
            transferEscrowToUser(position.owner, address(0x0), commitment);
            transferToUser(position.owner, amount.sub(fees));
        }
        transferFees(fees, pool);

        transferToPool(pool, position.token, owed);

        return scaledRate;
    }

    function _closeLong(Position storage position, uint256 minimalSwapAmount) private returns (uint256){
        uint256 input = position.input;
        uint256 owed = position.owed;
        address pool = unimex_factory.getPool(WETH_ADDRESS);

        uint256 fees = calculateBorrowInterest(position.id);
        uint256 swap = swapTokens(position.token, WETH_ADDRESS, input);
        require(swap >= minimalSwapAmount, "INSUFFICIENT_SWAP");
        uint256 scaledRate = calculateScaledRate(swap, input);
        require(swap.add(position.commitment) >= owed.add(fees), "LIQUIDATE_ONLY");

        uint256 commitment = position.commitment;

        bool isProfit = swap >= owed;

        uint256 amount = isProfit ? swap.sub(owed) : commitment.sub(owed.sub(swap));

        transferToPool(pool, WETH_ADDRESS, owed);

        transferFees(fees, pool);

        transferEscrowToUser(position.owner, isProfit ? position.owner : address(0x0), commitment);

        transferToUser(position.owner, amount.sub(fees));
        return scaledRate;
    }


    /**
    * @dev helper function, indicates when a position can be liquidated.
    * Liquidation threshold is when position input plus commitment can be converted to 110% of owed tokens
    */
    function canLiquidate(bytes32 positionId) public view returns(bool) {
        Position storage position = positionInfo[positionId];
        uint256 canReturn;
        if(position.isShort) {
            uint positionBalance = position.input.add(position.commitment);
            uint valueToConvert = positionBalance < liquidationBonus ? 0 : positionBalance.sub(liquidationBonus);
            canReturn = calculateConvertedValue(WETH_ADDRESS, position.token, valueToConvert);
        } else {
            uint canReturnOverall = calculateConvertedValue(position.token, WETH_ADDRESS, position.input)
                    .add(position.commitment);
            canReturn = canReturnOverall < liquidationBonus ? 0 : canReturnOverall.sub(liquidationBonus);
        }
        uint256 poolInterest = calculateBorrowInterest(position.id);
        return canReturn < position.owed.add(poolInterest).mul(LIQUIDATION_MARGIN).div(MAG);
    }

    /**
    * @dev Liquidates position and sends a liquidation bonus from user's commitment to a caller.
    * can only be called from account that has the LIQUIDATOR role
    */
    function liquidatePosition(bytes32 positionId, uint256 minimalSwapAmount) external isHuman {
        Position storage position = positionInfo[positionId];
        require(position.owner != address(0), "NO_OPEN_POSITION");
        require(hasRole(LIQUIDATOR_ROLE, msg.sender) || position.owner == msg.sender, "NOT_LIQUIDATOR");
        uint256 canReturn;
        uint poolInterest = calculateBorrowInterest(position.id);

        uint256 liquidatorBonus;
        uint256 scaledRate;
        if(position.isShort) {
            uint256 positionBalance = position.input.add(position.commitment);
            uint256 valueToConvert;
            (valueToConvert, liquidatorBonus) = _safeSubtract(positionBalance, liquidationBonus);
            canReturn = swapTokens(WETH_ADDRESS, position.token, valueToConvert);
            require(canReturn >= minimalSwapAmount, "INSUFFICIENT_SWAP");
            scaledRate = calculateScaledRate(valueToConvert, canReturn);
        } else {
            uint256 swap = swapTokens(position.token, WETH_ADDRESS, position.input);
            require(swap >= minimalSwapAmount, "INSUFFICIENT_SWAP");
            scaledRate = calculateScaledRate(swap, position.input);
            uint256 canReturnOverall = swap.add(position.commitment);
            (canReturn, liquidatorBonus) = _safeSubtract(canReturnOverall, liquidationBonus);
        }
        require(canReturn < position.owed.add(poolInterest).mul(LIQUIDATION_MARGIN).div(MAG), "CANNOT_LIQUIDATE");

        _liquidate(position, canReturn, poolInterest);

        transferEscrowToUser(position.owner, address(0x0), position.commitment);
        WETH.safeTransfer(msg.sender, liquidatorBonus);

        deletePosition(position, liquidatorBonus, scaledRate);
    }

    function _liquidate(Position memory position, uint256 canReturn, uint fees) private {
        address baseToken = position.isShort ? position.token : WETH_ADDRESS;
        address pool = unimex_factory.getPool(baseToken);
        if(canReturn > position.owed) {
            transferToPool(pool, baseToken, position.owed);
            uint256 remainder = canReturn.sub(position.owed);
            if(remainder > fees) { //can pay fees completely
                if(position.isShort) {
                    remainder = swapTokens(position.token, WETH_ADDRESS, remainder);
                    if(fees > 0) { //with fees == 0 calculation is reverted with "UV2: insufficient input amount"
                        fees = calculateConvertedValue(position.token, WETH_ADDRESS, fees);
                        if(fees > remainder) { //safety check
                            fees = remainder;
                        }
                    }
                }
                transferFees(fees, pool);
                transferToUser(position.owner, remainder.sub(fees));
            } else { //all is left is for fees
                if(position.isShort) {
                    //convert remainder to weth
                    remainder = swapTokens(position.token, WETH_ADDRESS, canReturn.sub(position.owed));
                }
                transferFees(remainder, pool);
            }
        } else {
            //return to pool all that's left
            transferToPool(pool, baseToken, canReturn);
        }
    }

    function setStaking(address _staking) external onlyOwner {
        require(_staking != address(0));
        staking = IUniMexStaking(_staking);
    }

    /**
    * @dev called by the owner to pause, triggers stopped state
    */
    function pause() onlyOwner public {
        paused = true;
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() onlyOwner public {
        paused = false;
    }

    /**
    * @dev set bonus for position liquidation. Can only be called from accounts with LIQUIDATOR role.
    */
    function setLiquidationBonus(uint256 _liquidationBonus) external {
        require(hasRole(LIQUIDATOR_ROLE, msg.sender), "NOT_LIQUIDATOR");
        require(_liquidationBonus > 0, "ZERO_LIQUIDATION_BONUS");
        require(_liquidationBonus <= 0.5 ether, "LIQUIDATION_BONUS_EXCEEDS_MAX");
        liquidationBonus = _liquidationBonus;
    }

    /**
    * @dev set interest rate for tokens owed from pools. Scaled to 10 (e.g. 150 is 15%)
    */
    function setBorrowPercent(uint256 _newPercentScaled) external onlyOwner {
        borrowInterestPercentScaled = _newPercentScaled;
    }

    function calculateScaledRate(uint256 wethAmount, uint256 tokenAmount) private pure returns (uint256 scaledRate){
        if(tokenAmount == 0) {
            return 0;
        }
        return wethAmount.mul(MAG).div(tokenAmount);
    }

    function transferUserToEscrow(address from, address to, uint256 amount) private {
        require(balanceOf[from] >= amount);
        balanceOf[from] = balanceOf[from].sub(amount);
        escrow[to] = escrow[to].add(amount);
    }

    function transferEscrowToUser(address from, address to, uint256 amount) private {
        require(escrow[from] >= amount);
        escrow[from] = escrow[from].sub(amount);
        balanceOf[to] = balanceOf[to].add(amount);
    }

    function transferToUser(address to, uint256 amount) private {
        balanceOf[to] = balanceOf[to].add(amount);
    }

    function getPositionId(
        address maker,
        address token,
        uint256 amount,
        uint256 leverage,
        uint256 nonce
    ) private pure returns (bytes32 positionId) {
        //date acts as a nonce
        positionId = keccak256(
            abi.encodePacked(maker, token, amount, leverage, nonce)
        );
    }

    function calculateConvertedValue(address baseToken, address quoteToken, uint256 amount) private view returns (uint256) {
        address token0;
        address token1;
        (token0, token1) = UniswapV2Library.sortTokens(baseToken, quoteToken);
        IUniswapV2Pair pair = IUniswapV2Pair(uniswap_factory.getPair(token0, token1));
        (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
        uint256 value;
        if (token1 == baseToken) {
            value = UniswapV2Library.getAmountOut(amount, reserve1, reserve0);
        } else {
            value = UniswapV2Library.getAmountOut(amount, reserve0, reserve1);
        }
        return value;
    }

    function swapTokens(address baseToken, address quoteToken, uint256 input) private returns (uint256 swap) {
        if(input == 0) {
            return 0;
        }
        IERC20(baseToken).approve(address(uniswap_router), input);
        address[] memory path = new address[](2);
        path[0] = baseToken;
        path[1] = quoteToken;
        uint256 balanceBefore = IERC20(quoteToken).balanceOf(address(this));

        IUniswapV2Router02(uniswap_router).swapExactTokensForTokensSupportingFeeOnTransferTokens(
            input,
            0, //checks are done after swap in caller functions
            path,
            address(this),
            block.timestamp
        );

        uint256 balanceAfter = IERC20(quoteToken).balanceOf(address(this));
        swap = balanceAfter.sub(balanceBefore);
    }

    function getCommitment(uint256 _amount, uint scaledLeverage) private pure returns (uint256 commitment) {
        commitment = (_amount.mul(MAG)).div(scaledLeverage);
    }

    function transferFees(uint256 fees, address pool) private {
        uint256 halfFees = fees.div(2);

        // Pool fees
        WETH.approve(pool, halfFees);
        IUniMexPool(pool).distribute(halfFees);

        // Staking Fees
        WETH.approve(address(staking), fees.sub(halfFees));
        staking.distribute(fees.sub(halfFees));
    }

    function transferToPool(address pool, address token, uint256 amount) private {
        IERC20(token).approve(pool, amount);
        IUniMexPool(pool).repay(amount);
    }


    function _safeSubtract(uint256 from, uint256 amount) private pure returns (uint256 remainder, uint256 subtractedAmount) {
        if(from < amount) {
            remainder = 0;
            subtractedAmount = from;
        } else {
            remainder = from.sub(amount);
            subtractedAmount = amount;
        }
    }

    function deletePosition(Position storage position, uint liquidatedAmount, uint scaledRate) private {
        emit OnClosePosition(
            position.id,
            position.token,
            position.owner,
            position.owed,
            position.input,
            position.commitment,
            position.leverage,
            position.startTimestamp,
            position.isShort,
            position.borrowInterest,
            liquidatedAmount,
            scaledRate
        );
        delete positionInfo[position.id];
    }

}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_staking","type":"address"},{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_uniswap_factory","type":"address"},{"internalType":"address","name":"_uniswap_router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"positionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"OnAddCommitment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"positionId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"owed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"input","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"commitment","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"leverage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isShort","type":"bool"},{"indexed":false,"internalType":"uint256","name":"borrowInterest","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"liquidationBonus","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"scaledCloseRate","type":"uint256"}],"name":"OnClosePosition","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"bytes32","name":"positionId","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"isShort","type":"bool"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"OnOpenPosition","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDATION_MARGIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAG","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"YEAR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"positionId","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addCommitmentToPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowInterestPercentScaled","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"positionId","type":"bytes32"}],"name":"calculateBorrowInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"positionId","type":"bytes32"}],"name":"canLiquidate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"positionId","type":"bytes32"},{"internalType":"uint256","name":"minimalSwapAmount","type":"uint256"}],"name":"closePosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"escrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"positionId","type":"bytes32"},{"internalType":"uint256","name":"minimalSwapAmount","type":"uint256"}],"name":"liquidatePosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidationBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"scaledLeverage","type":"uint256"},{"internalType":"uint256","name":"minimalSwapAmount","type":"uint256"}],"name":"openLongPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"scaledLeverage","type":"uint256"},{"internalType":"uint256","name":"minimalSwapAmount","type":"uint256"}],"name":"openShortPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"positionInfo","outputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"owed","type":"uint256"},{"internalType":"uint256","name":"input","type":"uint256"},{"internalType":"uint256","name":"commitment","type":"uint256"},{"internalType":"uint256","name":"leverage","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"bool","name":"isShort","type":"bool"},{"internalType":"uint256","name":"borrowInterest","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positionNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPercentScaled","type":"uint256"}],"name":"setBorrowPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidationBonus","type":"uint256"}],"name":"setLiquidationBonus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staking","type":"address"}],"name":"setStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"contract IUniMexStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unimex_factory","outputs":[{"internalType":"contract IUniMexFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswap_factory","outputs":[{"internalType":"contract IUniswapV2Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswap_router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405267013fbe85edc90000600455606460055560006006556007805460ff191690553480156200003157600080fd5b5060405162003cc938038062003cc9833981810160405260a08110156200005757600080fd5b5080516020820151604083015160608401516080909401519293919290919060006200008262000148565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600b80546001600160a01b038088166001600160a01b031992831617909255600c80548784169083161790556002805486841690831681179091556003805483169091179055600d8054858416908316179055600e8054928416929091169190911790556200013d6000336200014c565b50505050506200025e565b3390565b6200015882826200015c565b5050565b60008281526001602090815260409091206200018391839062001645620001d7821b17901c565b1562000158576200019362000148565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001ee836001600160a01b038416620001f7565b90505b92915050565b600062000205838362000246565b6200023d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001f1565b506000620001f1565b60009081526001919091016020526040902054151590565b613a5b806200026e6000396000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c80638456cb59116101465780639e966634116100c3578063c167f09911610087578063c167f099146105fb578063ca15c8731461061e578063d547741f1461063b578063dfeba59e14610667578063eb7aece11461068a578063f2fde38b146106ad57610253565b80639e966634146105be578063a217fddf146105c6578063ad5c4648146105ce578063b6b55f25146105d6578063b98d1fe2146105f357610253565b80638ff390991161010a5780638ff39099146105395780639010d07c1461055f5780639052be611461058257806391d148541461058a57806397bd1017146105b657610253565b80638456cb59146104b75780638ab10c73146104bf5780638ac4edb2146104f75780638da5cb5b146105145780638f7b18221461051c57610253565b80634cf088d9116101d457806370a082311161019857806370a0823114610441578063715018a6146104675780637b7c1f4c1461046f5780637f54c66e1461047757806383914540146104af57610253565b80634cf088d9146103d257806357d3c7c3146103da5780635c975abb14610400578063617f05a01461041c57806361ba15081461042457610253565b80632e1a7d4d1161021b5780632e1a7d4d1461034d5780632f2ff15d1461036a57806336568abe146103965780633f4ba83a146103c25780634c4be8a6146103ca57610253565b80631410c18b1461025857806316d8887a1461027c5780631750832b14610296578063248a9ca31461031157806328842d4f1461032e575b600080fd5b6102606106d3565b604080516001600160a01b039092168252519081900360200190f35b6102846106e2565b60408051918252519081900360200190f35b6102b3600480360360208110156102ac57600080fd5b5035610706565b604080519a8b526001600160a01b03998a1660208c015297909816898801526060890195909552608088019390935260a087019190915260c086015260e0850152151561010084015261012083019190915251908190036101400190f35b6102846004803603602081101561032757600080fd5b5035610768565b61034b6004803603602081101561034457600080fd5b503561077d565b005b61034b6004803603602081101561036357600080fd5b5035610899565b61034b6004803603604081101561038057600080fd5b50803590602001356001600160a01b03166108fe565b61034b600480360360408110156103ac57600080fd5b50803590602001356001600160a01b031661096a565b61034b6109cb565b610284610a2f565b610260610a3b565b610284600480360360208110156103f057600080fd5b50356001600160a01b0316610a4a565b610408610a5c565b604080519115158252519081900360200190f35b610284610a65565b6104086004803603602081101561043a57600080fd5b5035610a71565b6102846004803603602081101561045757600080fd5b50356001600160a01b0316610bb0565b61034b610bc2565b610284610c64565b61034b6004803603608081101561048d57600080fd5b506001600160a01b038135169060208101359060408101359060600135610c6a565b610284610c8a565b61034b610c92565b61034b600480360360808110156104d557600080fd5b506001600160a01b038135169060208101359060408101359060600135610cf9565b61034b6004803603602081101561050d57600080fd5b5035610d13565b610260610d70565b6102846004803603602081101561053257600080fd5b5035610d7f565b61034b6004803603602081101561054f57600080fd5b50356001600160a01b0316610dd6565b6102606004803603604081101561057557600080fd5b5080359060200135610e63565b610260610e84565b610408600480360360408110156105a057600080fd5b50803590602001356001600160a01b0316610e93565b610284610eab565b610284610eb1565b610284610eb7565b610260610ebc565b61034b600480360360208110156105ec57600080fd5b5035610ecb565b610260610f10565b61034b6004803603604081101561061157600080fd5b5080359060200135610f1f565b6102846004803603602081101561063457600080fd5b50356112de565b61034b6004803603604081101561065157600080fd5b50803590602001356001600160a01b03166112f5565b61034b6004803603604081101561067d57600080fd5b508035906020013561134e565b61034b600480360360408110156106a057600080fd5b5080359060200135611445565b61034b600480360360208110156106c357600080fd5b50356001600160a01b031661154d565b600c546001600160a01b031681565b7f5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c1681565b6008602081905260009182526040909120805460018201546002830154600384015460048501546005860154600687015460078801549888015460099098015496986001600160a01b03968716989690951696939592949193909260ff16908a565b60009081526001602052604090206002015490565b6107a77f5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c1633610e93565b6107e9576040805162461bcd60e51b815260206004820152600e60248201526d2727aa2fa624a8aaa4a220aa27a960911b604482015290519081900360640190fd5b60008111610837576040805162461bcd60e51b81526020600482015260166024820152755a45524f5f4c49515549444154494f4e5f424f4e555360501b604482015290519081900360640190fd5b6706f05b59d3b20000811115610894576040805162461bcd60e51b815260206004820152601d60248201527f4c49515549444154494f4e5f424f4e55535f455843454544535f4d4158000000604482015290519081900360640190fd5b600455565b336000908152600960205260409020548111156108b557600080fd5b336000908152600960205260409020546108cf908261165a565b336000818152600960205260409020919091556003546108fb916001600160a01b03909116908361169c565b50565b6000828152600160205260409020600201546109219061091c6116f3565b610e93565b61095c5760405162461bcd60e51b815260040180806020018281038252602f8152602001806138e1602f913960400191505060405180910390fd5b61096682826116f7565b5050565b6109726116f3565b6001600160a01b0316816001600160a01b0316146109c15760405162461bcd60e51b815260040180806020018281038252602f8152602001806139f7602f913960400191505060405180910390fd5b6109668282611760565b6109d36116f3565b6000546001600160a01b03908116911614610a23576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6007805460ff19169055565b670de0b6b3a764000081565b600b546001600160a01b031681565b600a6020526000908152604090205481565b60075460ff1681565b670f43fc2c04ee000081565b6000818152600860208190526040822090810154829060ff1615610afa576000610aac836005015484600401546117c990919063ffffffff16565b905060006004548210610acc57600454610ac790839061165a565b610acf565b60005b6002546001860154919250610af1916001600160a01b03918216911683611823565b92505050610b59565b600582015460018301546002546004850154600093610b34939092610b2e926001600160a01b039283169290911690611823565b906117c9565b90506004548110610b5257600454610b4d90829061165a565b610b55565b60005b9150505b6000610b688360000154610d7f565b9050610ba5670de0b6b3a7640000610b9f670f43fc2c04ee0000610b998588600301546117c990919063ffffffff16565b90611992565b906119eb565b909110949350505050565b60096020526000908152604090205481565b610bca6116f3565b6000546001600160a01b03908116911614610c1a576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60045481565b333214610c7657600080fd5b610c84848484846000611a2d565b50505050565b6301e1338081565b610c9a6116f3565b6000546001600160a01b03908116911614610cea576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6007805460ff19166001179055565b333214610d0557600080fd5b610c84848484846001611a2d565b610d1b6116f3565b6000546001600160a01b03908116911614610d6b576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b600555565b6000546001600160a01b031690565b600081815260086020526040812060078101548290610d9f90429061165a565b9050610dce6301e13380610b9f6103e8610b9f8660090154610b9987896003015461199290919063ffffffff16565b949350505050565b610dde6116f3565b6000546001600160a01b03908116911614610e2e576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6001600160a01b038116610e4157600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600160205260408120610e7b9083611feb565b90505b92915050565b600e546001600160a01b031681565b6000828152600160205260408120610e7b9083611ff7565b60065481565b60055481565b600081565b6003546001600160a01b031681565b600354610ee3906001600160a01b031633308461200c565b33600090815260096020526040902054610efd90826117c9565b3360009081526009602052604090205550565b600d546001600160a01b031681565b333214610f2b57600080fd5b600082815260086020526040902060028101546001600160a01b0316610f8b576040805162461bcd60e51b815260206004820152601060248201526f2727afa7a822a72fa827a9a4aa24a7a760811b604482015290519081900360640190fd5b610fb57f5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c1633610e93565b80610fcc575060028101546001600160a01b031633145b61100e576040805162461bcd60e51b815260206004820152600e60248201526d2727aa2fa624a8aaa4a220aa27a960911b604482015290519081900360640190fd5b60008061101e8360000154610d7f565b6008840154909150600090819060ff16156110e3576000611050866005015487600401546117c990919063ffffffff16565b9050600061106082600454612066565b60025460018a0154919650919250611085916001600160a01b03908116911683612093565b9550878610156110d0576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b6110da818761235f565b92505050611195565b6001850154600254600487015460009261110b926001600160a01b0391821692911690612093565b905086811015611156576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b61116481876004015461235f565b9150600061117f8760050154836117c990919063ffffffff16565b905061118d81600454612066565b909650935050505b6111c4670de0b6b3a7640000610b9f670f43fc2c04ee0000610b99878a600301546117c990919063ffffffff16565b841061120a576040805162461bcd60e51b815260206004820152601060248201526f43414e4e4f545f4c495155494441544560801b604482015290519081900360640190fd5b60408051610140810182528654815260018701546001600160a01b039081166020830152600288015416918101919091526003860154606082015260048601546080820152600586015460a0820152600686015460c0820152600786015460e0820152600886015460ff1615156101008201526009860154610120820152611293908585612384565b600285015460058601546112b3916001600160a01b031690600090612544565b6003546112ca906001600160a01b0316338461169c565b6112d58583836125e3565b50505050505050565b6000818152600160205260408120610e7e90612702565b6000828152600160205260409020600201546113139061091c6116f3565b6109c15760405162461bcd60e51b815260040180806020018281038252603081526020018061395c6030913960400191505060405180910390fd5b33321461135a57600080fd5b600082815260086020526040902060028101546001600160a01b03166113ba576040805162461bcd60e51b815260206004820152601060248201526f2727afa7a822a72fa827a9a4aa24a7a760811b604482015290519081900360640190fd5b60028101546001600160a01b0316331461140b576040805162461bcd60e51b815260206004820152600d60248201526c424f52524f5745525f4f4e4c5960981b604482015290519081900360640190fd5b600881015460009060ff161561142c57611425828461270d565b9050611439565b6114368284612aea565b90505b610c84826000836125e3565b600082815260086020526040902060028101546001600160a01b03166114a0576040805162461bcd60e51b815260206004820152600b60248201526a2727afa827a9a4aa24a7a760a91b604482015290519081900360640190fd5b60058101546114af90836117c9565b60058201556003546114cc906001600160a01b031633308561200c565b60028101546001600160a01b03166000908152600a60205260409020546114f390836117c9565b60028201546001600160a01b03166000908152600a6020908152604091829020929092558051848152905185927f682649e7cb633bdde5a1b1577afb7f59883fd6bf5ba83401cc2f4134ba631bad928290030190a2505050565b6115556116f3565b6000546001600160a01b039081169116146115a5576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6001600160a01b0381166115ea5760405162461bcd60e51b81526004018080602001828103825260268152602001806139106026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610e7b836001600160a01b038416612d1c565b6000610e7b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612d66565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526116ee908490612dfd565b505050565b3390565b600082815260016020526040902061170f9082611645565b156109665761171c6116f3565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526001602052604090206117789082612eae565b15610966576117856116f3565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610e7b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008060006118328686612ec3565b600d546040805163e6a4390560e01b81526001600160a01b0380861660048301528085166024830152915194965092945060009391169163e6a43905916044808301926020929190829003018186803b15801561188e57600080fd5b505afa1580156118a2573d6000803e3d6000fd5b505050506040513d60208110156118b857600080fd5b505160408051630240bc6b60e21b8152905191925060009182916001600160a01b03851691630902f1ac91600480820192606092909190829003018186803b15801561190357600080fd5b505afa158015611917573d6000803e3d6000fd5b505050506040513d606081101561192d57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905060006001600160a01b03858116908b1614156119755761196e888385612fa4565b9050611983565b611980888484612fa4565b90505b955050505050505b9392505050565b6000826119a157506000610e7e565b828202828482816119ae57fe5b0414610e7b5760405162461bcd60e51b815260040180806020018281038252602181526020018061398c6021913960400191505060405180910390fd5b6000610e7b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506130a2565b60075460ff1615611a6e576040805162461bcd60e51b815260206004820152600660248201526514105554d15160d21b604482015290519081900360640190fd5b60008411611ab1576040805162461bcd60e51b815260206004820152600b60248201526a414d4f554e545f5a45524f60a81b604482015290519081900360640190fd5b600c546000906001600160a01b031663bbe4f6db83611adb576003546001600160a01b0316611add565b875b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015611b1c57600080fd5b505af1158015611b30573d6000803e3d6000fd5b505050506040513d6020811015611b4657600080fd5b505190506001600160a01b038116611b9b576040805162461bcd60e51b81526020600482015260136024820152721413d3d317d113d154d7d393d517d1561254d5606a1b604482015290519081900360640190fd5b600c546040805163808d856b60e01b81526001600160a01b0389811660048301529151611c2793670de0b6b3a764000093169163808d856b9160248083019260209291908290030181600087803b158015611bf557600080fd5b505af1158015611c09573d6000803e3d6000fd5b505050506040513d6020811015611c1f57600080fd5b505190611992565b841115611c72576040805162461bcd60e51b81526020600482015260146024820152730988aac8aa4828e8abe8ab0868a8a88a6be9a82b60631b604482015290519081900360640190fd5b600082611c7f5785611c97565b600254611c979088906001600160a01b031688611823565b90506000611ca58287613107565b9050611cbc600454826117c990919063ffffffff16565b336000908152600960205260409020541015611d0c576040805162461bcd60e51b815260206004820152600a6024820152694e4f5f42414c414e434560b01b604482015290519081900360640190fd5b826001600160a01b031663c5ebeaec886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611d5257600080fd5b505af1158015611d66573d6000803e3d6000fd5b50505050600080600086611d86576002546001600160a01b03168b611d95565b6002548b906001600160a01b03165b91509150611da482828c612093565b925087831015611def576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b5060009050611e056103e8610b9f846008611992565b9050611e11828261165a565b915085611e3357600254611e30908b906001600160a01b031683612093565b90505b611e3d818661311f565b611e5c3333611e57600454876117c990919063ffffffff16565b61330a565b6006546001016006819055506000611e79338c8c8c6006546133a9565b9050611e83613854565b6040518061014001604052808381526020018d6001600160a01b03168152602001336001600160a01b031681526020018c8152602001858152602001611ed4600454886117c990919063ffffffff16565b815260208082018d9052426040808401919091528b1515606080850182905260058054608096870152865160009081526008808752908590208851808255898801516001830180546001600160a01b03199081166001600160a01b03938416179091558b890151600285018054909216908316179055948a0151600383015597890151600482015560a08901519281019290925560c0880151600683015560e08801516007830155610100880151908201805460ff19169115159190911790556101208701516009909101558251948552928401528051939450908f169233927fef9d0fe2c313eedf661ab58ae77f6b5e1d4ae0f604597251095e254d8b7f34b992908290030190a3505050505050505050505050565b6000610e7b8383613409565b6000610e7b836001600160a01b03841661346d565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610c84908590612dfd565b6000808284101561207c5750600090508261208c565b612086848461165a565b91508290505b9250929050565b6000816120a25750600061198b565b600e546040805163095ea7b360e01b81526001600160a01b0392831660048201526024810185905290519186169163095ea7b3916044808201926020929091908290030181600087803b1580156120f857600080fd5b505af115801561210c573d6000803e3d6000fd5b505050506040513d602081101561212257600080fd5b50506040805160028082526060808301845292602083019080368337019050509050848160008151811061215257fe5b60200260200101906001600160a01b031690816001600160a01b031681525050838160018151811061218057fe5b6001600160a01b03928316602091820292909201810191909152604080516370a0823160e01b815230600482015290516000938816926370a082319260248082019391829003018186803b1580156121d757600080fd5b505afa1580156121eb573d6000803e3d6000fd5b505050506040513d602081101561220157600080fd5b5051600e54604051635c11d79560e01b8152600481018781526000602483018190523060648401819052426084850181905260a060448601908152895160a487015289519798506001600160a01b0390961696635c11d795968c9694958b95909260c490910190602087810191028083838b5b8381101561228c578181015183820152602001612274565b505050509050019650505050505050600060405180830381600087803b1580156122b557600080fd5b505af11580156122c9573d6000803e3d6000fd5b505050506000856001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561231c57600080fd5b505afa158015612330573d6000803e3d6000fd5b505050506040513d602081101561234657600080fd5b50519050612354818361165a565b979650505050505050565b60008161236e57506000610e7e565b610e7b82610b9f85670de0b6b3a7640000611992565b60008361010001516123a1576002546001600160a01b03166123a7565b83602001515b600c546040805163bbe4f6db60e01b81526001600160a01b0380851660048301529151939450600093919092169163bbe4f6db91602480830192602092919082900301818787803b1580156123fb57600080fd5b505af115801561240f573d6000803e3d6000fd5b505050506040513d602081101561242557600080fd5b505160608601519091508411156125325761244581838760600151613485565b600061245e86606001518661165a90919063ffffffff16565b9050838111156124e857856101000151156124c157602086015160025461248f91906001600160a01b031683612093565b905083156124c15760208601516002546124b391906001600160a01b031686611823565b9350808411156124c1578093505b6124cb848361311f565b60408601516124e3906124de838761165a565b61357b565b61252c565b85610100015115612522576020860151600254606088015161251f92916001600160a01b03169061251a90899061165a565b612093565b90505b61252c818361311f565b5061253d565b61253d818386613485565b5050505050565b6001600160a01b0383166000908152600a602052604090205481111561256957600080fd5b6001600160a01b0383166000908152600a602052604090205461258c908261165a565b6001600160a01b038085166000908152600a60209081526040808320949094559185168152600990915220546125c290826117c9565b6001600160a01b039092166000908152600960205260409020919091555050565b600283015483546001850154600386015460048701546005880154600689015460078a015460088b015460098c0154604080516001600160a01b03998a1681526020810198909852878101969096526060870194909452608086019290925260a085015260ff16151560c084015260e0830152610100820187905261012082018690525191909316927f1e77073a3efcb7a158e414362bfade8a7dba051e357736e6f0e603efec31d09891908190036101400190a3505054600090815260086020819052604082208281556001810180546001600160a01b031990811690915560028201805490911690556003810183905560048101839055600581018390556006810183905560078101839055908101805460ff1916905560090155565b6000610e7e826135be565b60048083015460038401546005850154600c5460018701546040805163bbe4f6db60e01b81526001600160a01b0392831697810197909752516000968793929092169163bbe4f6db91602480830192602092919082900301818787803b15801561277657600080fd5b505af115801561278a573d6000803e3d6000fd5b505050506040513d60208110156127a057600080fd5b505187549091506000906127b390610d7f565b60025460018a01549192506000916127d8916001600160a01b03908116911688612093565b905087811015612823576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b600061282f878361235f565b905061284c61283e88876117c9565b610b9f89610b998a886117c9565b821015612891576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b818610600080856128a35760006128c2565b60018d01546003546128c2916001600160a01b03908116911688611823565b905082156129005760006128d6868b61165a565b60018f01546002549192506128f8916001600160a01b03918216911683612093565b9250506129a0565b60025460018e0154600091612922916001600160a01b0391821691168b612093565b905060006129308b8861165a565b905080821015612978576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b60018f015460025461299b916001600160a01b03908116911661251a858561165a565b935050505b8215612a39578082106129e75760028d01546129c6906001600160a01b0316808a612544565b60028d01546129e2906001600160a01b03166124de848461165a565b612a34565b60006129f3828461165a565b60028f0154909150612a18906001600160a01b031680612a138c8561165a565b612544565b60028e0154612a32906001600160a01b0316600083612544565b505b612ab5565b80821015612a7f576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b60028d0154612a99906001600160a01b031660008a612544565b60028d0154612ab5906001600160a01b03166124de848461165a565b612abf818861311f565b60018d0154612ad99088906001600160a01b03168b613485565b50919b9a5050505050505050505050565b6004808301546003840154600c546002546040805163bbe4f6db60e01b81526001600160a01b0392831696810196909652516000958693929092169163bbe4f6db91602480830192602092919082900301818787803b158015612b4c57600080fd5b505af1158015612b60573d6000803e3d6000fd5b505050506040513d6020811015612b7657600080fd5b50518654909150600090612b8990610d7f565b6001880154600254919250600091612bae916001600160a01b03908116911687612093565b905086811015612bf9576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b6000612c05828761235f565b9050612c1185846117c9565b60058a0154612c219084906117c9565b1015612c65576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b600589015485831015600081612c8e57612c89612c82898761165a565b849061165a565b612c98565b612c98858961165a565b600254909150612cb39088906001600160a01b03168a613485565b612cbd868861311f565b60028c0154612cf0906001600160a01b031683612cdb576000612cea565b60028e01546001600160a01b03165b85612544565b60028c0154612d0c906001600160a01b03166124de838961165a565b50919a9950505050505050505050565b6000612d28838361346d565b612d5e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610e7e565b506000610e7e565b60008184841115612df55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612dba578181015183820152602001612da2565b50505050905090810190601f168015612de75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6060612e52826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166135c29092919063ffffffff16565b8051909150156116ee57808060200190516020811015612e7157600080fd5b50516116ee5760405162461bcd60e51b815260040180806020018281038252602a8152602001806139cd602a913960400191505060405180910390fd5b6000610e7b836001600160a01b0384166135d1565b600080826001600160a01b0316846001600160a01b03161415612f2d576040805162461bcd60e51b815260206004820152601860248201527f5556323a204944454e544943414c5f4144445245535345530000000000000000604482015290519081900360640190fd5b826001600160a01b0316846001600160a01b031610612f4d578284612f50565b83835b90925090506001600160a01b03821661208c576040805162461bcd60e51b81526020600482015260116024820152705556323a205a45524f5f4144445245535360781b604482015290519081900360640190fd5b6000808411612ffa576040805162461bcd60e51b815260206004820152601e60248201527f5556323a20494e53554646494349454e545f494e5055545f414d4f554e540000604482015290519081900360640190fd5b60008311801561300a5750600082115b61305b576040805162461bcd60e51b815260206004820152601b60248201527f5556323a20494e53554646494349454e545f4c49515549444954590000000000604482015290519081900360640190fd5b6000613069856103e5611992565b905060006130778285611992565b9050600061308b83610b2e886103e8611992565b905080828161309657fe5b04979650505050505050565b600081836130f15760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612dba578181015183820152602001612da2565b5060008385816130fd57fe5b0495945050505050565b6000610e7b82610b9f85670de0b6b3a7640000611992565b600061312c8360026119eb565b6003546040805163095ea7b360e01b81526001600160a01b03868116600483015260248201859052915193945091169163095ea7b3916044808201926020929091908290030181600087803b15801561318457600080fd5b505af1158015613198573d6000803e3d6000fd5b505050506040513d60208110156131ae57600080fd5b5050604080516391c05b0b60e01b81526004810183905290516001600160a01b038416916391c05b0b91602480830192600092919082900301818387803b1580156131f857600080fd5b505af115801561320c573d6000803e3d6000fd5b5050600354600b546001600160a01b03918216935063095ea7b3925016613233868561165a565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561327957600080fd5b505af115801561328d573d6000803e3d6000fd5b505050506040513d60208110156132a357600080fd5b5050600b546001600160a01b03166391c05b0b6132c0858461165a565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156132f657600080fd5b505af11580156112d5573d6000803e3d6000fd5b6001600160a01b03831660009081526009602052604090205481111561332f57600080fd5b6001600160a01b038316600090815260096020526040902054613352908261165a565b6001600160a01b038085166000908152600960209081526040808320949094559185168152600a909152205461338890826117c9565b6001600160a01b039092166000908152600a60205260409020919091555050565b604080516bffffffffffffffffffffffff19606097881b81166020808401919091529690971b9096166034870152604886019390935260688501919091526088808501919091528151808503909101815260a89093019052815191012090565b8154600090821061344b5760405162461bcd60e51b81526004018080602001828103825260228152602001806138bf6022913960400191505060405180910390fd5b82600001828154811061345a57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b816001600160a01b031663095ea7b384836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156134dc57600080fd5b505af11580156134f0573d6000803e3d6000fd5b505050506040513d602081101561350657600080fd5b505060408051631b8fec7360e11b81526004810183905290516001600160a01b0385169163371fd8e69160248083019260209291908290030181600087803b15801561355157600080fd5b505af1158015613565573d6000803e3d6000fd5b505050506040513d602081101561253d57600080fd5b6001600160a01b03821660009081526009602052604090205461359e90826117c9565b6001600160a01b0390921660009081526009602052604090209190915550565b5490565b6060610dce8484600085613697565b6000818152600183016020526040812054801561368d578354600019808301919081019060009087908390811061360457fe5b906000526020600020015490508087600001848154811061362157fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061365157fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610e7e565b6000915050610e7e565b6060824710156136d85760405162461bcd60e51b81526004018080602001828103825260268152602001806139366026913960400191505060405180910390fd5b6136e1856137e8565b613732576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106137715780518252601f199092019160209182019101613752565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146137d3576040519150601f19603f3d011682016040523d82523d6000602084013e6137d8565b606091505b50915091506123548282866137ee565b3b151590565b606083156137fd57508161198b565b82511561380d5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612dba578181015183820152602001612da2565b6040518061014001604052806000801916815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152509056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122066c78c74c2931d4cc6a365efe9a14a900620ad99b8acf73e3cf597454a6e8c3d64736f6c634300060c00330000000000000000000000008dc85b6056b40c950e6119899cac90be9eeb4da7000000000000000000000000c80b0efb594df8be90a643c7f7a462541cd7f6ee000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102535760003560e01c80638456cb59116101465780639e966634116100c3578063c167f09911610087578063c167f099146105fb578063ca15c8731461061e578063d547741f1461063b578063dfeba59e14610667578063eb7aece11461068a578063f2fde38b146106ad57610253565b80639e966634146105be578063a217fddf146105c6578063ad5c4648146105ce578063b6b55f25146105d6578063b98d1fe2146105f357610253565b80638ff390991161010a5780638ff39099146105395780639010d07c1461055f5780639052be611461058257806391d148541461058a57806397bd1017146105b657610253565b80638456cb59146104b75780638ab10c73146104bf5780638ac4edb2146104f75780638da5cb5b146105145780638f7b18221461051c57610253565b80634cf088d9116101d457806370a082311161019857806370a0823114610441578063715018a6146104675780637b7c1f4c1461046f5780637f54c66e1461047757806383914540146104af57610253565b80634cf088d9146103d257806357d3c7c3146103da5780635c975abb14610400578063617f05a01461041c57806361ba15081461042457610253565b80632e1a7d4d1161021b5780632e1a7d4d1461034d5780632f2ff15d1461036a57806336568abe146103965780633f4ba83a146103c25780634c4be8a6146103ca57610253565b80631410c18b1461025857806316d8887a1461027c5780631750832b14610296578063248a9ca31461031157806328842d4f1461032e575b600080fd5b6102606106d3565b604080516001600160a01b039092168252519081900360200190f35b6102846106e2565b60408051918252519081900360200190f35b6102b3600480360360208110156102ac57600080fd5b5035610706565b604080519a8b526001600160a01b03998a1660208c015297909816898801526060890195909552608088019390935260a087019190915260c086015260e0850152151561010084015261012083019190915251908190036101400190f35b6102846004803603602081101561032757600080fd5b5035610768565b61034b6004803603602081101561034457600080fd5b503561077d565b005b61034b6004803603602081101561036357600080fd5b5035610899565b61034b6004803603604081101561038057600080fd5b50803590602001356001600160a01b03166108fe565b61034b600480360360408110156103ac57600080fd5b50803590602001356001600160a01b031661096a565b61034b6109cb565b610284610a2f565b610260610a3b565b610284600480360360208110156103f057600080fd5b50356001600160a01b0316610a4a565b610408610a5c565b604080519115158252519081900360200190f35b610284610a65565b6104086004803603602081101561043a57600080fd5b5035610a71565b6102846004803603602081101561045757600080fd5b50356001600160a01b0316610bb0565b61034b610bc2565b610284610c64565b61034b6004803603608081101561048d57600080fd5b506001600160a01b038135169060208101359060408101359060600135610c6a565b610284610c8a565b61034b610c92565b61034b600480360360808110156104d557600080fd5b506001600160a01b038135169060208101359060408101359060600135610cf9565b61034b6004803603602081101561050d57600080fd5b5035610d13565b610260610d70565b6102846004803603602081101561053257600080fd5b5035610d7f565b61034b6004803603602081101561054f57600080fd5b50356001600160a01b0316610dd6565b6102606004803603604081101561057557600080fd5b5080359060200135610e63565b610260610e84565b610408600480360360408110156105a057600080fd5b50803590602001356001600160a01b0316610e93565b610284610eab565b610284610eb1565b610284610eb7565b610260610ebc565b61034b600480360360208110156105ec57600080fd5b5035610ecb565b610260610f10565b61034b6004803603604081101561061157600080fd5b5080359060200135610f1f565b6102846004803603602081101561063457600080fd5b50356112de565b61034b6004803603604081101561065157600080fd5b50803590602001356001600160a01b03166112f5565b61034b6004803603604081101561067d57600080fd5b508035906020013561134e565b61034b600480360360408110156106a057600080fd5b5080359060200135611445565b61034b600480360360208110156106c357600080fd5b50356001600160a01b031661154d565b600c546001600160a01b031681565b7f5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c1681565b6008602081905260009182526040909120805460018201546002830154600384015460048501546005860154600687015460078801549888015460099098015496986001600160a01b03968716989690951696939592949193909260ff16908a565b60009081526001602052604090206002015490565b6107a77f5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c1633610e93565b6107e9576040805162461bcd60e51b815260206004820152600e60248201526d2727aa2fa624a8aaa4a220aa27a960911b604482015290519081900360640190fd5b60008111610837576040805162461bcd60e51b81526020600482015260166024820152755a45524f5f4c49515549444154494f4e5f424f4e555360501b604482015290519081900360640190fd5b6706f05b59d3b20000811115610894576040805162461bcd60e51b815260206004820152601d60248201527f4c49515549444154494f4e5f424f4e55535f455843454544535f4d4158000000604482015290519081900360640190fd5b600455565b336000908152600960205260409020548111156108b557600080fd5b336000908152600960205260409020546108cf908261165a565b336000818152600960205260409020919091556003546108fb916001600160a01b03909116908361169c565b50565b6000828152600160205260409020600201546109219061091c6116f3565b610e93565b61095c5760405162461bcd60e51b815260040180806020018281038252602f8152602001806138e1602f913960400191505060405180910390fd5b61096682826116f7565b5050565b6109726116f3565b6001600160a01b0316816001600160a01b0316146109c15760405162461bcd60e51b815260040180806020018281038252602f8152602001806139f7602f913960400191505060405180910390fd5b6109668282611760565b6109d36116f3565b6000546001600160a01b03908116911614610a23576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6007805460ff19169055565b670de0b6b3a764000081565b600b546001600160a01b031681565b600a6020526000908152604090205481565b60075460ff1681565b670f43fc2c04ee000081565b6000818152600860208190526040822090810154829060ff1615610afa576000610aac836005015484600401546117c990919063ffffffff16565b905060006004548210610acc57600454610ac790839061165a565b610acf565b60005b6002546001860154919250610af1916001600160a01b03918216911683611823565b92505050610b59565b600582015460018301546002546004850154600093610b34939092610b2e926001600160a01b039283169290911690611823565b906117c9565b90506004548110610b5257600454610b4d90829061165a565b610b55565b60005b9150505b6000610b688360000154610d7f565b9050610ba5670de0b6b3a7640000610b9f670f43fc2c04ee0000610b998588600301546117c990919063ffffffff16565b90611992565b906119eb565b909110949350505050565b60096020526000908152604090205481565b610bca6116f3565b6000546001600160a01b03908116911614610c1a576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60045481565b333214610c7657600080fd5b610c84848484846000611a2d565b50505050565b6301e1338081565b610c9a6116f3565b6000546001600160a01b03908116911614610cea576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6007805460ff19166001179055565b333214610d0557600080fd5b610c84848484846001611a2d565b610d1b6116f3565b6000546001600160a01b03908116911614610d6b576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b600555565b6000546001600160a01b031690565b600081815260086020526040812060078101548290610d9f90429061165a565b9050610dce6301e13380610b9f6103e8610b9f8660090154610b9987896003015461199290919063ffffffff16565b949350505050565b610dde6116f3565b6000546001600160a01b03908116911614610e2e576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6001600160a01b038116610e4157600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600160205260408120610e7b9083611feb565b90505b92915050565b600e546001600160a01b031681565b6000828152600160205260408120610e7b9083611ff7565b60065481565b60055481565b600081565b6003546001600160a01b031681565b600354610ee3906001600160a01b031633308461200c565b33600090815260096020526040902054610efd90826117c9565b3360009081526009602052604090205550565b600d546001600160a01b031681565b333214610f2b57600080fd5b600082815260086020526040902060028101546001600160a01b0316610f8b576040805162461bcd60e51b815260206004820152601060248201526f2727afa7a822a72fa827a9a4aa24a7a760811b604482015290519081900360640190fd5b610fb57f5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c1633610e93565b80610fcc575060028101546001600160a01b031633145b61100e576040805162461bcd60e51b815260206004820152600e60248201526d2727aa2fa624a8aaa4a220aa27a960911b604482015290519081900360640190fd5b60008061101e8360000154610d7f565b6008840154909150600090819060ff16156110e3576000611050866005015487600401546117c990919063ffffffff16565b9050600061106082600454612066565b60025460018a0154919650919250611085916001600160a01b03908116911683612093565b9550878610156110d0576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b6110da818761235f565b92505050611195565b6001850154600254600487015460009261110b926001600160a01b0391821692911690612093565b905086811015611156576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b61116481876004015461235f565b9150600061117f8760050154836117c990919063ffffffff16565b905061118d81600454612066565b909650935050505b6111c4670de0b6b3a7640000610b9f670f43fc2c04ee0000610b99878a600301546117c990919063ffffffff16565b841061120a576040805162461bcd60e51b815260206004820152601060248201526f43414e4e4f545f4c495155494441544560801b604482015290519081900360640190fd5b60408051610140810182528654815260018701546001600160a01b039081166020830152600288015416918101919091526003860154606082015260048601546080820152600586015460a0820152600686015460c0820152600786015460e0820152600886015460ff1615156101008201526009860154610120820152611293908585612384565b600285015460058601546112b3916001600160a01b031690600090612544565b6003546112ca906001600160a01b0316338461169c565b6112d58583836125e3565b50505050505050565b6000818152600160205260408120610e7e90612702565b6000828152600160205260409020600201546113139061091c6116f3565b6109c15760405162461bcd60e51b815260040180806020018281038252603081526020018061395c6030913960400191505060405180910390fd5b33321461135a57600080fd5b600082815260086020526040902060028101546001600160a01b03166113ba576040805162461bcd60e51b815260206004820152601060248201526f2727afa7a822a72fa827a9a4aa24a7a760811b604482015290519081900360640190fd5b60028101546001600160a01b0316331461140b576040805162461bcd60e51b815260206004820152600d60248201526c424f52524f5745525f4f4e4c5960981b604482015290519081900360640190fd5b600881015460009060ff161561142c57611425828461270d565b9050611439565b6114368284612aea565b90505b610c84826000836125e3565b600082815260086020526040902060028101546001600160a01b03166114a0576040805162461bcd60e51b815260206004820152600b60248201526a2727afa827a9a4aa24a7a760a91b604482015290519081900360640190fd5b60058101546114af90836117c9565b60058201556003546114cc906001600160a01b031633308561200c565b60028101546001600160a01b03166000908152600a60205260409020546114f390836117c9565b60028201546001600160a01b03166000908152600a6020908152604091829020929092558051848152905185927f682649e7cb633bdde5a1b1577afb7f59883fd6bf5ba83401cc2f4134ba631bad928290030190a2505050565b6115556116f3565b6000546001600160a01b039081169116146115a5576040805162461bcd60e51b815260206004820181905260248201526000805160206139ad833981519152604482015290519081900360640190fd5b6001600160a01b0381166115ea5760405162461bcd60e51b81526004018080602001828103825260268152602001806139106026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610e7b836001600160a01b038416612d1c565b6000610e7b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612d66565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526116ee908490612dfd565b505050565b3390565b600082815260016020526040902061170f9082611645565b156109665761171c6116f3565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526001602052604090206117789082612eae565b15610966576117856116f3565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610e7b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008060006118328686612ec3565b600d546040805163e6a4390560e01b81526001600160a01b0380861660048301528085166024830152915194965092945060009391169163e6a43905916044808301926020929190829003018186803b15801561188e57600080fd5b505afa1580156118a2573d6000803e3d6000fd5b505050506040513d60208110156118b857600080fd5b505160408051630240bc6b60e21b8152905191925060009182916001600160a01b03851691630902f1ac91600480820192606092909190829003018186803b15801561190357600080fd5b505afa158015611917573d6000803e3d6000fd5b505050506040513d606081101561192d57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905060006001600160a01b03858116908b1614156119755761196e888385612fa4565b9050611983565b611980888484612fa4565b90505b955050505050505b9392505050565b6000826119a157506000610e7e565b828202828482816119ae57fe5b0414610e7b5760405162461bcd60e51b815260040180806020018281038252602181526020018061398c6021913960400191505060405180910390fd5b6000610e7b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506130a2565b60075460ff1615611a6e576040805162461bcd60e51b815260206004820152600660248201526514105554d15160d21b604482015290519081900360640190fd5b60008411611ab1576040805162461bcd60e51b815260206004820152600b60248201526a414d4f554e545f5a45524f60a81b604482015290519081900360640190fd5b600c546000906001600160a01b031663bbe4f6db83611adb576003546001600160a01b0316611add565b875b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015611b1c57600080fd5b505af1158015611b30573d6000803e3d6000fd5b505050506040513d6020811015611b4657600080fd5b505190506001600160a01b038116611b9b576040805162461bcd60e51b81526020600482015260136024820152721413d3d317d113d154d7d393d517d1561254d5606a1b604482015290519081900360640190fd5b600c546040805163808d856b60e01b81526001600160a01b0389811660048301529151611c2793670de0b6b3a764000093169163808d856b9160248083019260209291908290030181600087803b158015611bf557600080fd5b505af1158015611c09573d6000803e3d6000fd5b505050506040513d6020811015611c1f57600080fd5b505190611992565b841115611c72576040805162461bcd60e51b81526020600482015260146024820152730988aac8aa4828e8abe8ab0868a8a88a6be9a82b60631b604482015290519081900360640190fd5b600082611c7f5785611c97565b600254611c979088906001600160a01b031688611823565b90506000611ca58287613107565b9050611cbc600454826117c990919063ffffffff16565b336000908152600960205260409020541015611d0c576040805162461bcd60e51b815260206004820152600a6024820152694e4f5f42414c414e434560b01b604482015290519081900360640190fd5b826001600160a01b031663c5ebeaec886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611d5257600080fd5b505af1158015611d66573d6000803e3d6000fd5b50505050600080600086611d86576002546001600160a01b03168b611d95565b6002548b906001600160a01b03165b91509150611da482828c612093565b925087831015611def576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b5060009050611e056103e8610b9f846008611992565b9050611e11828261165a565b915085611e3357600254611e30908b906001600160a01b031683612093565b90505b611e3d818661311f565b611e5c3333611e57600454876117c990919063ffffffff16565b61330a565b6006546001016006819055506000611e79338c8c8c6006546133a9565b9050611e83613854565b6040518061014001604052808381526020018d6001600160a01b03168152602001336001600160a01b031681526020018c8152602001858152602001611ed4600454886117c990919063ffffffff16565b815260208082018d9052426040808401919091528b1515606080850182905260058054608096870152865160009081526008808752908590208851808255898801516001830180546001600160a01b03199081166001600160a01b03938416179091558b890151600285018054909216908316179055948a0151600383015597890151600482015560a08901519281019290925560c0880151600683015560e08801516007830155610100880151908201805460ff19169115159190911790556101208701516009909101558251948552928401528051939450908f169233927fef9d0fe2c313eedf661ab58ae77f6b5e1d4ae0f604597251095e254d8b7f34b992908290030190a3505050505050505050505050565b6000610e7b8383613409565b6000610e7b836001600160a01b03841661346d565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610c84908590612dfd565b6000808284101561207c5750600090508261208c565b612086848461165a565b91508290505b9250929050565b6000816120a25750600061198b565b600e546040805163095ea7b360e01b81526001600160a01b0392831660048201526024810185905290519186169163095ea7b3916044808201926020929091908290030181600087803b1580156120f857600080fd5b505af115801561210c573d6000803e3d6000fd5b505050506040513d602081101561212257600080fd5b50506040805160028082526060808301845292602083019080368337019050509050848160008151811061215257fe5b60200260200101906001600160a01b031690816001600160a01b031681525050838160018151811061218057fe5b6001600160a01b03928316602091820292909201810191909152604080516370a0823160e01b815230600482015290516000938816926370a082319260248082019391829003018186803b1580156121d757600080fd5b505afa1580156121eb573d6000803e3d6000fd5b505050506040513d602081101561220157600080fd5b5051600e54604051635c11d79560e01b8152600481018781526000602483018190523060648401819052426084850181905260a060448601908152895160a487015289519798506001600160a01b0390961696635c11d795968c9694958b95909260c490910190602087810191028083838b5b8381101561228c578181015183820152602001612274565b505050509050019650505050505050600060405180830381600087803b1580156122b557600080fd5b505af11580156122c9573d6000803e3d6000fd5b505050506000856001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561231c57600080fd5b505afa158015612330573d6000803e3d6000fd5b505050506040513d602081101561234657600080fd5b50519050612354818361165a565b979650505050505050565b60008161236e57506000610e7e565b610e7b82610b9f85670de0b6b3a7640000611992565b60008361010001516123a1576002546001600160a01b03166123a7565b83602001515b600c546040805163bbe4f6db60e01b81526001600160a01b0380851660048301529151939450600093919092169163bbe4f6db91602480830192602092919082900301818787803b1580156123fb57600080fd5b505af115801561240f573d6000803e3d6000fd5b505050506040513d602081101561242557600080fd5b505160608601519091508411156125325761244581838760600151613485565b600061245e86606001518661165a90919063ffffffff16565b9050838111156124e857856101000151156124c157602086015160025461248f91906001600160a01b031683612093565b905083156124c15760208601516002546124b391906001600160a01b031686611823565b9350808411156124c1578093505b6124cb848361311f565b60408601516124e3906124de838761165a565b61357b565b61252c565b85610100015115612522576020860151600254606088015161251f92916001600160a01b03169061251a90899061165a565b612093565b90505b61252c818361311f565b5061253d565b61253d818386613485565b5050505050565b6001600160a01b0383166000908152600a602052604090205481111561256957600080fd5b6001600160a01b0383166000908152600a602052604090205461258c908261165a565b6001600160a01b038085166000908152600a60209081526040808320949094559185168152600990915220546125c290826117c9565b6001600160a01b039092166000908152600960205260409020919091555050565b600283015483546001850154600386015460048701546005880154600689015460078a015460088b015460098c0154604080516001600160a01b03998a1681526020810198909852878101969096526060870194909452608086019290925260a085015260ff16151560c084015260e0830152610100820187905261012082018690525191909316927f1e77073a3efcb7a158e414362bfade8a7dba051e357736e6f0e603efec31d09891908190036101400190a3505054600090815260086020819052604082208281556001810180546001600160a01b031990811690915560028201805490911690556003810183905560048101839055600581018390556006810183905560078101839055908101805460ff1916905560090155565b6000610e7e826135be565b60048083015460038401546005850154600c5460018701546040805163bbe4f6db60e01b81526001600160a01b0392831697810197909752516000968793929092169163bbe4f6db91602480830192602092919082900301818787803b15801561277657600080fd5b505af115801561278a573d6000803e3d6000fd5b505050506040513d60208110156127a057600080fd5b505187549091506000906127b390610d7f565b60025460018a01549192506000916127d8916001600160a01b03908116911688612093565b905087811015612823576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b600061282f878361235f565b905061284c61283e88876117c9565b610b9f89610b998a886117c9565b821015612891576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b818610600080856128a35760006128c2565b60018d01546003546128c2916001600160a01b03908116911688611823565b905082156129005760006128d6868b61165a565b60018f01546002549192506128f8916001600160a01b03918216911683612093565b9250506129a0565b60025460018e0154600091612922916001600160a01b0391821691168b612093565b905060006129308b8861165a565b905080821015612978576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b60018f015460025461299b916001600160a01b03908116911661251a858561165a565b935050505b8215612a39578082106129e75760028d01546129c6906001600160a01b0316808a612544565b60028d01546129e2906001600160a01b03166124de848461165a565b612a34565b60006129f3828461165a565b60028f0154909150612a18906001600160a01b031680612a138c8561165a565b612544565b60028e0154612a32906001600160a01b0316600083612544565b505b612ab5565b80821015612a7f576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b60028d0154612a99906001600160a01b031660008a612544565b60028d0154612ab5906001600160a01b03166124de848461165a565b612abf818861311f565b60018d0154612ad99088906001600160a01b03168b613485565b50919b9a5050505050505050505050565b6004808301546003840154600c546002546040805163bbe4f6db60e01b81526001600160a01b0392831696810196909652516000958693929092169163bbe4f6db91602480830192602092919082900301818787803b158015612b4c57600080fd5b505af1158015612b60573d6000803e3d6000fd5b505050506040513d6020811015612b7657600080fd5b50518654909150600090612b8990610d7f565b6001880154600254919250600091612bae916001600160a01b03908116911687612093565b905086811015612bf9576040805162461bcd60e51b81526020600482015260116024820152700494e53554646494349454e545f5357415607c1b604482015290519081900360640190fd5b6000612c05828761235f565b9050612c1185846117c9565b60058a0154612c219084906117c9565b1015612c65576040805162461bcd60e51b815260206004820152600e60248201526d4c49515549444154455f4f4e4c5960901b604482015290519081900360640190fd5b600589015485831015600081612c8e57612c89612c82898761165a565b849061165a565b612c98565b612c98858961165a565b600254909150612cb39088906001600160a01b03168a613485565b612cbd868861311f565b60028c0154612cf0906001600160a01b031683612cdb576000612cea565b60028e01546001600160a01b03165b85612544565b60028c0154612d0c906001600160a01b03166124de838961165a565b50919a9950505050505050505050565b6000612d28838361346d565b612d5e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610e7e565b506000610e7e565b60008184841115612df55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612dba578181015183820152602001612da2565b50505050905090810190601f168015612de75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6060612e52826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166135c29092919063ffffffff16565b8051909150156116ee57808060200190516020811015612e7157600080fd5b50516116ee5760405162461bcd60e51b815260040180806020018281038252602a8152602001806139cd602a913960400191505060405180910390fd5b6000610e7b836001600160a01b0384166135d1565b600080826001600160a01b0316846001600160a01b03161415612f2d576040805162461bcd60e51b815260206004820152601860248201527f5556323a204944454e544943414c5f4144445245535345530000000000000000604482015290519081900360640190fd5b826001600160a01b0316846001600160a01b031610612f4d578284612f50565b83835b90925090506001600160a01b03821661208c576040805162461bcd60e51b81526020600482015260116024820152705556323a205a45524f5f4144445245535360781b604482015290519081900360640190fd5b6000808411612ffa576040805162461bcd60e51b815260206004820152601e60248201527f5556323a20494e53554646494349454e545f494e5055545f414d4f554e540000604482015290519081900360640190fd5b60008311801561300a5750600082115b61305b576040805162461bcd60e51b815260206004820152601b60248201527f5556323a20494e53554646494349454e545f4c49515549444954590000000000604482015290519081900360640190fd5b6000613069856103e5611992565b905060006130778285611992565b9050600061308b83610b2e886103e8611992565b905080828161309657fe5b04979650505050505050565b600081836130f15760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612dba578181015183820152602001612da2565b5060008385816130fd57fe5b0495945050505050565b6000610e7b82610b9f85670de0b6b3a7640000611992565b600061312c8360026119eb565b6003546040805163095ea7b360e01b81526001600160a01b03868116600483015260248201859052915193945091169163095ea7b3916044808201926020929091908290030181600087803b15801561318457600080fd5b505af1158015613198573d6000803e3d6000fd5b505050506040513d60208110156131ae57600080fd5b5050604080516391c05b0b60e01b81526004810183905290516001600160a01b038416916391c05b0b91602480830192600092919082900301818387803b1580156131f857600080fd5b505af115801561320c573d6000803e3d6000fd5b5050600354600b546001600160a01b03918216935063095ea7b3925016613233868561165a565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561327957600080fd5b505af115801561328d573d6000803e3d6000fd5b505050506040513d60208110156132a357600080fd5b5050600b546001600160a01b03166391c05b0b6132c0858461165a565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156132f657600080fd5b505af11580156112d5573d6000803e3d6000fd5b6001600160a01b03831660009081526009602052604090205481111561332f57600080fd5b6001600160a01b038316600090815260096020526040902054613352908261165a565b6001600160a01b038085166000908152600960209081526040808320949094559185168152600a909152205461338890826117c9565b6001600160a01b039092166000908152600a60205260409020919091555050565b604080516bffffffffffffffffffffffff19606097881b81166020808401919091529690971b9096166034870152604886019390935260688501919091526088808501919091528151808503909101815260a89093019052815191012090565b8154600090821061344b5760405162461bcd60e51b81526004018080602001828103825260228152602001806138bf6022913960400191505060405180910390fd5b82600001828154811061345a57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b816001600160a01b031663095ea7b384836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156134dc57600080fd5b505af11580156134f0573d6000803e3d6000fd5b505050506040513d602081101561350657600080fd5b505060408051631b8fec7360e11b81526004810183905290516001600160a01b0385169163371fd8e69160248083019260209291908290030181600087803b15801561355157600080fd5b505af1158015613565573d6000803e3d6000fd5b505050506040513d602081101561253d57600080fd5b6001600160a01b03821660009081526009602052604090205461359e90826117c9565b6001600160a01b0390921660009081526009602052604090209190915550565b5490565b6060610dce8484600085613697565b6000818152600183016020526040812054801561368d578354600019808301919081019060009087908390811061360457fe5b906000526020600020015490508087600001848154811061362157fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061365157fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610e7e565b6000915050610e7e565b6060824710156136d85760405162461bcd60e51b81526004018080602001828103825260268152602001806139366026913960400191505060405180910390fd5b6136e1856137e8565b613732576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106137715780518252601f199092019160209182019101613752565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146137d3576040519150601f19603f3d011682016040523d82523d6000602084013e6137d8565b606091505b50915091506123548282866137ee565b3b151590565b606083156137fd57508161198b565b82511561380d5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612dba578181015183820152602001612da2565b6040518061014001604052806000801916815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152509056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122066c78c74c2931d4cc6a365efe9a14a900620ad99b8acf73e3cf597454a6e8c3d64736f6c634300060c0033

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

0000000000000000000000008dc85b6056b40c950e6119899cac90be9eeb4da7000000000000000000000000c80b0efb594df8be90a643c7f7a462541cd7f6ee000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d

-----Decoded View---------------
Arg [0] : _staking (address): 0x8dC85B6056b40c950e6119899Cac90BE9EEb4da7
Arg [1] : _factory (address): 0xC80B0efB594df8bE90A643C7F7a462541Cd7F6eE
Arg [2] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [3] : _uniswap_factory (address): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Arg [4] : _uniswap_router (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000008dc85b6056b40c950e6119899cac90be9eeb4da7
Arg [1] : 000000000000000000000000c80b0efb594df8be90a643c7f7a462541cd7f6ee
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [3] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [4] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d


Deployed Bytecode Sourcemap

42073:20841:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;43168:36;;;:::i;:::-;;;;-1:-1:-1;;;;;43168:36:0;;;;;;;;;;;;;;42196:70;;;:::i;:::-;;;;;;;;;;;;;;;;42972:48;;;;;;;;;;;;;;;;-1:-1:-1;42972:48:0;;:::i;:::-;;;;;;;-1:-1:-1;;;;;42972:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22063:114;;;;;;;;;;;;;;;;-1:-1:-1;22063:114:0;;:::i;57920:344::-;;;;;;;;;;;;;;;;-1:-1:-1;57920:344:0;;:::i;:::-;;45036:220;;;;;;;;;;;;;;;;-1:-1:-1;45036:220:0;;:::i;22439:227::-;;;;;;;;;;;;;;;;-1:-1:-1;22439:227:0;;;;;;-1:-1:-1;;;;;22439:227:0;;:::i;23648:209::-;;;;;;;;;;;;;;;;-1:-1:-1;23648:209:0;;;;;;-1:-1:-1;;;;;23648:209:0;;:::i;57723:69::-;;;:::i;42335:34::-;;;:::i;43132:29::-;;;:::i;43078:41::-;;;;;;;;;;;;;;;;-1:-1:-1;43078:41:0;-1:-1:-1;;;;;43078:41:0;;:::i;42636:26::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;42376:52;;;:::i;52855:942::-;;;;;;;;;;;;;;;;-1:-1:-1;52855:942:0;;:::i;43027:44::-;;;;;;;;;;;;;;;;-1:-1:-1;43027:44:0;-1:-1:-1;;;;;43027:44:0;;:::i;27037:148::-;;;:::i;42441:42::-;;;:::i;45814:212::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;45814:212:0;;;;;;;;;;;;;;;;;;:::i;42551:39::-;;;:::i;57562:66::-;;;:::i;45594:212::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;45594:212:0;;;;;;;;;;;;;;;;;;:::i;58378:138::-;;;;;;;;;;;;;;;;-1:-1:-1;58378:138:0;;:::i;26395:79::-;;;:::i;45264:322::-;;;;;;;;;;;;;;;;-1:-1:-1;45264:322:0;;:::i;57320:152::-;;;;;;;;;;;;;;;;-1:-1:-1;57320:152:0;-1:-1:-1;;;;;57320:152:0;;:::i;21736:138::-;;;;;;;;;;;;;;;;-1:-1:-1;21736:138:0;;;;;;;:::i;43258:40::-;;;:::i;20697:139::-;;;;;;;;;;;;;;;;-1:-1:-1;20697:139:0;;;;;;-1:-1:-1;;;;;20697:139:0;;:::i;42597:32::-;;;:::i;42490:48::-;;;:::i;19442:49::-;;;:::i;42310:18::-;;;:::i;44842:186::-;;;;;;;;;;;;;;;;-1:-1:-1;44842:186:0;;:::i;43211:40::-;;;:::i;53988:1777::-;;;;;;;;;;;;;;;;-1:-1:-1;53988:1777:0;;;;;;;:::i;21010:127::-;;;;;;;;;;;;;;;;-1:-1:-1;21010:127:0;;:::i;22911:230::-;;;;;;;;;;;;;;;;-1:-1:-1;22911:230:0;;;;;;-1:-1:-1;;;;;22911:230:0;;:::i;48716:564::-;;;;;;;;;;;;;;;;-1:-1:-1;48716:564:0;;;;;;;:::i;48246:462::-;;;;;;;;;;;;;;;;-1:-1:-1;48246:462:0;;;;;;;:::i;27340:244::-;;;;;;;;;;;;;;;;-1:-1:-1;27340:244:0;-1:-1:-1;;;;;27340:244:0;;:::i;43168:36::-;;;-1:-1:-1;;;;;43168:36:0;;:::o;42196:70::-;42238:28;42196:70;:::o;42972:48::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;42972:48:0;;;;;;;;;;;;;;;;;;;;;:::o;22063:114::-;22120:7;22147:12;;;:6;:12;;;;;:22;;;;22063:114::o;57920:344::-;58004:36;42238:28;58029:10;58004:7;:36::i;:::-;57996:63;;;;;-1:-1:-1;;;57996:63:0;;;;;;;;;;;;-1:-1:-1;;;57996:63:0;;;;;;;;;;;;;;;58098:1;58078:17;:21;58070:56;;;;;-1:-1:-1;;;58070:56:0;;;;;;;;;;;;-1:-1:-1;;;58070:56:0;;;;;;;;;;;;;;;58166:9;58145:17;:30;;58137:72;;;;;-1:-1:-1;;;58137:72:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;58220:16;:36;57920:344::o;45036:220::-;45107:10;45097:21;;;;:9;:21;;;;;;:32;-1:-1:-1;45097:32:0;45089:41;;;;;;45175:10;45165:21;;;;:9;:21;;;;;;:34;;45191:7;45165:25;:34::i;:::-;45151:10;45141:21;;;;:9;:21;;;;;:58;;;;45210:4;;:38;;-1:-1:-1;;;;;45210:4:0;;;;45240:7;45210:17;:38::i;:::-;45036:220;:::o;22439:227::-;22531:12;;;;:6;:12;;;;;:22;;;22523:45;;22555:12;:10;:12::i;:::-;22523:7;:45::i;:::-;22515:105;;;;-1:-1:-1;;;22515:105:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22633:25;22644:4;22650:7;22633:10;:25::i;:::-;22439:227;;:::o;23648:209::-;23746:12;:10;:12::i;:::-;-1:-1:-1;;;;;23735:23:0;:7;-1:-1:-1;;;;;23735:23:0;;23727:83;;;;-1:-1:-1;;;23727:83:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23823:26;23835:4;23841:7;23823:11;:26::i;57723:69::-;26617:12;:10;:12::i;:::-;26607:6;;-1:-1:-1;;;;;26607:6:0;;;:22;;;26599:67;;;;;-1:-1:-1;;;26599:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;26599:67:0;;;;;;;;;;;;;;;57770:6:::1;:14:::0;;-1:-1:-1;;57770:14:0::1;::::0;;57723:69::o;42335:34::-;42365:4;42335:34;:::o;43132:29::-;;;-1:-1:-1;;;;;43132:29:0;;:::o;43078:41::-;;;;;;;;;;;;;:::o;42636:26::-;;;;;;:::o;42376:52::-;42421:7;42376:52;:::o;52855:942::-;52917:4;52962:24;;;:12;:24;;;;;;;53028:16;;;;52917:4;;53028:16;;53025:601;;;53061:20;53084:39;53103:8;:19;;;53084:8;:14;;;:18;;:39;;;;:::i;:::-;53061:62;;53138:19;53178:16;;53160:15;:34;:78;;53221:16;;53201:37;;:15;;:19;:37::i;:::-;53160:78;;;53197:1;53160:78;53289:12;;;53303:14;;;53138:100;;-1:-1:-1;53265:69:0;;-1:-1:-1;;;;;53289:12:0;;;;53303:14;53138:100;53265:23;:69::i;:::-;53253:81;;53025:601;;;;;53487:19;;;;53415:14;;;;53431:12;;53445:14;;;;53367:21;;53391:116;;53487:19;;53391:69;;-1:-1:-1;;;;;53415:14:0;;;;53431:12;;;;53391:23;:69::i;:::-;:95;;:116::i;:::-;53367:140;;53553:16;;53534;:35;:80;;53597:16;;53576:38;;:16;;:20;:38::i;:::-;53534:80;;;53572:1;53534:80;53522:92;;53025:601;;53636:20;53659:36;53683:8;:11;;;53659:23;:36::i;:::-;53636:59;;53725:64;42365:4;53725:55;42421:7;53725:31;53743:12;53725:8;:13;;;:17;;:31;;;;:::i;:::-;:35;;:55::i;:::-;:59;;:64::i;:::-;53713:76;;;;52855:942;-1:-1:-1;;;;52855:942:0:o;43027:44::-;;;;;;;;;;;;;:::o;27037:148::-;26617:12;:10;:12::i;:::-;26607:6;;-1:-1:-1;;;;;26607:6:0;;;:22;;;26599:67;;;;;-1:-1:-1;;;26599:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;26599:67:0;;;;;;;;;;;;;;;27144:1:::1;27128:6:::0;;27107:40:::1;::::0;-1:-1:-1;;;;;27128:6:0;;::::1;::::0;27107:40:::1;::::0;27144:1;;27107:40:::1;27175:1;27158:19:::0;;-1:-1:-1;;;;;;27158:19:0::1;::::0;;27037:148::o;42441:42::-;;;;:::o;45814:212::-;44138:10;44152:9;44138:23;44130:32;;;;;;45948:70:::1;45962:5;45969:6;45977:14;45993:17;46012:5;45948:13;:70::i;:::-;45814:212:::0;;;;:::o;42551:39::-;42582:8;42551:39;:::o;57562:66::-;26617:12;:10;:12::i;:::-;26607:6;;-1:-1:-1;;;;;26607:6:0;;;:22;;;26599:67;;;;;-1:-1:-1;;;26599:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;26599:67:0;;;;;;;;;;;;;;;57607:6:::1;:13:::0;;-1:-1:-1;;57607:13:0::1;57616:4;57607:13;::::0;;57562:66::o;45594:212::-;44138:10;44152:9;44138:23;44130:32;;;;;;45729:69:::1;45743:5;45750:6;45758:14;45774:17;45793:4;45729:13;:69::i;58378:138::-:0;26617:12;:10;:12::i;:::-;26607:6;;-1:-1:-1;;;;;26607:6:0;;;:22;;;26599:67;;;;;-1:-1:-1;;;26599:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;26599:67:0;;;;;;;;;;;;;;;58461:27:::1;:47:::0;58378:138::o;26395:79::-;26433:7;26460:6;-1:-1:-1;;;;;26460:6:0;26395:79;:::o;45264:322::-;45338:7;45386:24;;;:12;:24;;;;;45460:23;;;;45338:7;;45440:44;;:15;;:19;:44::i;:::-;45421:63;;45502:76;42582:8;45502:66;45563:4;45502:56;45534:8;:23;;;45502:27;45520:8;45502;:13;;;:17;;:27;;;;:::i;:76::-;45495:83;45264:322;-1:-1:-1;;;;45264:322:0:o;57320:152::-;26617:12;:10;:12::i;:::-;26607:6;;-1:-1:-1;;;;;26607:6:0;;;:22;;;26599:67;;;;;-1:-1:-1;;;26599:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;26599:67:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;57396:22:0;::::1;57388:31;;;::::0;::::1;;57430:7;:34:::0;;-1:-1:-1;;;;;;57430:34:0::1;-1:-1:-1::0;;;;;57430:34:0;;;::::1;::::0;;;::::1;::::0;;57320:152::o;21736:138::-;21809:7;21836:12;;;:6;:12;;;;;:30;;21860:5;21836:23;:30::i;:::-;21829:37;;21736:138;;;;;:::o;43258:40::-;;;-1:-1:-1;;;;;43258:40:0;;:::o;20697:139::-;20766:4;20790:12;;;:6;:12;;;;;:38;;20820:7;20790:29;:38::i;42597:32::-;;;;:::o;42490:48::-;;;;:::o;19442:49::-;19487:4;19442:49;:::o;42310:18::-;;;-1:-1:-1;;;;;42310:18:0;;:::o;44842:186::-;44894:4;;:57;;-1:-1:-1;;;;;44894:4:0;44916:10;44936:4;44943:7;44894:21;:57::i;:::-;44996:10;44986:21;;;;:9;:21;;;;;;:34;;45012:7;44986:25;:34::i;:::-;44972:10;44962:21;;;;:9;:21;;;;;:58;-1:-1:-1;44842:186:0:o;43211:40::-;;;-1:-1:-1;;;;;43211:40:0;;:::o;53988:1777::-;44138:10;44152:9;44138:23;44130:32;;;;;;54090:25:::1;54118:24:::0;;;:12:::1;:24;::::0;;;;54161:14:::1;::::0;::::1;::::0;-1:-1:-1;;;;;54161:14:0::1;54153:57;;;::::0;;-1:-1:-1;;;54153:57:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;54153:57:0;;;;;;;;;;;;;::::1;;54229:36;42238:28;54254:10;54229:7;:36::i;:::-;:68;;;-1:-1:-1::0;54269:14:0::1;::::0;::::1;::::0;-1:-1:-1;;;;;54269:14:0::1;54287:10;54269:28;54229:68;54221:95;;;::::0;;-1:-1:-1;;;54221:95:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;54221:95:0;;;;;;;;;;;;;::::1;;54327:17;54355::::0;54375:36:::1;54399:8;:11;;;54375:23;:36::i;:::-;54490:16;::::0;::::1;::::0;54355:56;;-1:-1:-1;54424:23:0::1;::::0;;;54490:16:::1;;54487:890;;;54523:23;54549:39;54568:8;:19;;;54549:8;:14;;;:18;;:39;;;;:::i;:::-;54523:65;;54603:22;54676:48;54690:15;54707:16;;54676:13;:48::i;:::-;54762:12;::::0;;54776:14;::::1;::::0;54640:84;;-1:-1:-1;54640:84:0;;-1:-1:-1;54751:56:0::1;::::0;-1:-1:-1;;;;;54762:12:0;;::::1;::::0;54776:14:::1;54640:84:::0;54751:10:::1;:56::i;:::-;54739:68;;54843:17;54830:9;:30;;54822:60;;;::::0;;-1:-1:-1;;;54822:60:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;54822:60:0;;;;;;;;;;;;;::::1;;54910:46;54930:14;54946:9;54910:19;:46::i;:::-;54897:59;;54487:890;;;;;55015:14;::::0;::::1;::::0;55031:12:::1;::::0;55045:14:::1;::::0;::::1;::::0;54989:12:::1;::::0;55004:56:::1;::::0;-1:-1:-1;;;;;55015:14:0;;::::1;::::0;55031:12;::::1;::::0;55004:10:::1;:56::i;:::-;54989:71;;55091:17;55083:4;:25;;55075:55;;;::::0;;-1:-1:-1;;;55075:55:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;55075:55:0;;;;;;;;;;;;;::::1;;55158:41;55178:4;55184:8;:14;;;55158:19;:41::i;:::-;55145:54;;55214:24;55241:29;55250:8;:19;;;55241:4;:8;;:29;;;;:::i;:::-;55214:56;;55316:49;55330:16;55348;;55316:13;:49::i;:::-;55285:80:::0;;-1:-1:-1;55285:80:0;-1:-1:-1;;;54487:890:0::1;55407:64;42365:4;55407:55;42421:7;55407:31;55425:12;55407:8;:13;;;:17;;:31;;;;:::i;:64::-;55395:9;:76;55387:105;;;::::0;;-1:-1:-1;;;55387:105:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;55387:105:0;;;;;;;;;;;;;::::1;;55505:45;::::0;;::::1;::::0;::::1;::::0;;;;;;::::1;::::0;::::1;::::0;-1:-1:-1;;;;;55505:45:0;;::::1;;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;::::1;::::0;::::1;;;;;::::0;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;55526:9;55537:12;55505:10:::1;:45::i;:::-;55584:14;::::0;::::1;::::0;55614:19:::1;::::0;::::1;::::0;55563:71:::1;::::0;-1:-1:-1;;;;;55584:14:0::1;::::0;::::1;::::0;55563:20:::1;:71::i;:::-;55645:4;::::0;:46:::1;::::0;-1:-1:-1;;;;;55645:4:0::1;55663:10;55675:15:::0;55645:17:::1;:46::i;:::-;55704:53;55719:8;55729:15;55746:10;55704:14;:53::i;:::-;44173:1;;;;;53988:1777:::0;;:::o;21010:127::-;21073:7;21100:12;;;:6;:12;;;;;:29;;:27;:29::i;22911:230::-;23004:12;;;;:6;:12;;;;;:22;;;22996:45;;23028:12;:10;:12::i;22996:45::-;22988:106;;;;-1:-1:-1;;;22988:106:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;48716:564;44138:10;44152:9;44138:23;44130:32;;;;;;48814:25:::1;48842:24:::0;;;:12:::1;:24;::::0;;;;48885:14:::1;::::0;::::1;::::0;-1:-1:-1;;;;;48885:14:0::1;48877:57;;;::::0;;-1:-1:-1;;;48877:57:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;48877:57:0;;;;;;;;;;;;;::::1;;48967:14;::::0;::::1;::::0;-1:-1:-1;;;;;48967:14:0::1;48953:10;:28;48945:54;;;::::0;;-1:-1:-1;;;48945:54:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;48945:54:0;;;;;;;;;;;;;::::1;;49042:16;::::0;::::1;::::0;49010:18:::1;::::0;49042:16:::1;;49039:184;;;49088:40;49100:8;49110:17;49088:11;:40::i;:::-;49075:53;;49039:184;;;49172:39;49183:8;49193:17;49172:10;:39::i;:::-;49159:52;;49039:184;49233:39;49248:8;49258:1;49261:10;49233:14;:39::i;48246:462::-:0;48333:25;48361:24;;;:12;:24;;;;;48404:14;;;;-1:-1:-1;;;;;48404:14:0;48396:52;;;;;-1:-1:-1;;;48396:52:0;;;;;;;;;;;;-1:-1:-1;;;48396:52:0;;;;;;;;;;;;;;;48481:19;;;;:31;;48505:6;48481:23;:31::i;:::-;48459:19;;;:53;48523:4;;:56;;-1:-1:-1;;;;;48523:4:0;48545:10;48565:4;48572:6;48523:21;:56::i;:::-;48622:14;;;;-1:-1:-1;;;;;48622:14:0;48615:22;;;;:6;:22;;;;;;:34;;48642:6;48615:26;:34::i;:::-;48597:14;;;;-1:-1:-1;;;;;48597:14:0;48590:22;;;;:6;:22;;;;;;;;;:59;;;;48665:35;;;;;;;48681:10;;48665:35;;;;;;;;48246:462;;;:::o;27340:244::-;26617:12;:10;:12::i;:::-;26607:6;;-1:-1:-1;;;;;26607:6:0;;;:22;;;26599:67;;;;;-1:-1:-1;;;26599:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;26599:67:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;27429:22:0;::::1;27421:73;;;;-1:-1:-1::0;;;27421:73:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27531:6;::::0;;27510:38:::1;::::0;-1:-1:-1;;;;;27510:38:0;;::::1;::::0;27531:6;::::1;::::0;27510:38:::1;::::0;::::1;27559:6;:17:::0;;-1:-1:-1;;;;;;27559:17:0::1;-1:-1:-1::0;;;;;27559:17:0;;;::::1;::::0;;;::::1;::::0;;27340:244::o;6696:143::-;6766:4;6790:41;6795:3;-1:-1:-1;;;;;6815:14:0;;6790:4;:41::i;31795:136::-;31853:7;31880:43;31884:1;31887;31880:43;;;;;;;;;;;;;;;;;:3;:43::i;36455:177::-;36565:58;;;-1:-1:-1;;;;;36565:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;36565:58:0;-1:-1:-1;;;36565:58:0;;;36538:86;;36558:5;;36538:19;:86::i;:::-;36455:177;;;:::o;17377:106::-;17465:10;17377:106;:::o;24891:188::-;24965:12;;;;:6;:12;;;;;:33;;24990:7;24965:24;:33::i;:::-;24961:111;;;25047:12;:10;:12::i;:::-;-1:-1:-1;;;;;25020:40:0;25038:7;-1:-1:-1;;;;;25020:40:0;25032:4;25020:40;;;;;;;;;;24891:188;;:::o;25087:192::-;25162:12;;;;:6;:12;;;;;:36;;25190:7;25162:27;:36::i;:::-;25158:114;;;25247:12;:10;:12::i;:::-;-1:-1:-1;;;;;25220:40:0;25238:7;-1:-1:-1;;;;;25220:40:0;25232:4;25220:40;;;;;;;;;;25087:192;;:::o;31331:181::-;31389:7;31421:5;;;31445:6;;;;31437:46;;;;;-1:-1:-1;;;31437:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;59740:687;59850:7;59870:14;59895;59939:50;59967:9;59978:10;59939:27;:50::i;:::-;60037:15;;:39;;;-1:-1:-1;;;60037:39:0;;-1:-1:-1;;;;;60037:39:0;;;;;;;;;;;;;;;;59920:69;;-1:-1:-1;59920:69:0;;-1:-1:-1;60000:19:0;;60037:15;;;:23;;:39;;;;;;;;;;;;;;:15;:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;60037:39:0;60129:18;;;-1:-1:-1;;;60129:18:0;;;;60037:39;;-1:-1:-1;60089:16:0;;;;-1:-1:-1;;;;;60129:16:0;;;;;:18;;;;;;;;;;;;;;;:16;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;60129:18:0;;;;;;;60088:59;;;;;-1:-1:-1;60088:59:0;;-1:-1:-1;60158:13:0;-1:-1:-1;;;;;60186:19:0;;;;;;;60182:215;;;60230:57;60260:6;60268:8;60278;60230:29;:57::i;:::-;60222:65;;60182:215;;;60328:57;60358:6;60366:8;60376;60328:29;:57::i;:::-;60320:65;;60182:215;60414:5;-1:-1:-1;;;;;;59740:687:0;;;;;;:::o;32685:471::-;32743:7;32988:6;32984:47;;-1:-1:-1;33018:1:0;33011:8;;32984:47;33055:5;;;33059:1;33055;:5;:1;33079:5;;;;;:10;33071:56;;;;-1:-1:-1;;;33071:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33632:132;33690:7;33717:39;33721:1;33724;33717:39;;;;;;;;;;;;;;;;;:3;:39::i;46034:2204::-;46181:6;;;;46180:7;46172:26;;;;;-1:-1:-1;;;46172:26:0;;;;;;;;;;;;-1:-1:-1;;;46172:26:0;;;;;;;;;;;;;;;46226:1;46217:6;:10;46209:34;;;;;-1:-1:-1;;;46209:34:0;;;;;;;;;;;;-1:-1:-1;;;46209:34:0;;;;;;;;;;;;;;;46269:14;;46254:12;;-1:-1:-1;;;;;46269:14:0;:22;46300:7;:30;;46326:4;;-1:-1:-1;;;;;46326:4:0;46300:30;;;46317:5;46300:30;46269:63;;;;;;;;;;;;;-1:-1:-1;;;;;46269:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;46269:63:0;;-1:-1:-1;;;;;;46353:18:0;;46345:50;;;;;-1:-1:-1;;;46345:50:0;;;;;;;;;;;;-1:-1:-1;;;46345:50:0;;;;;;;;;;;;;;;46432:14;;:36;;;-1:-1:-1;;;46432:36:0;;-1:-1:-1;;;;;46432:36:0;;;;;;;;;:45;;42365:4;;46432:14;;:29;;:36;;;;;;;;;;;;;;:14;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;46432:36:0;;:40;:45::i;:::-;46414:14;:63;;46406:96;;;;;-1:-1:-1;;;46406:96:0;;;;;;;;;;;;-1:-1:-1;;;46406:96:0;;;;;;;;;;;;;;;46515:17;46535:7;:71;;46600:6;46535:71;;;46576:12;;46545:52;;46569:5;;-1:-1:-1;;;;;46576:12:0;46590:6;46545:23;:52::i;:::-;46515:91;;46617:18;46638:43;46652:12;46666:14;46638:13;:43::i;:::-;46617:64;;46725:32;46740:16;;46725:10;:14;;:32;;;;:::i;:::-;46710:10;46700:21;;;;:9;:21;;;;;;:57;;46692:80;;;;;-1:-1:-1;;;46692:80:0;;;;;;;;;;;;-1:-1:-1;;;46692:80:0;;;;;;;;;;;;;;;46797:4;-1:-1:-1;;;;;46785:24:0;;46810:6;46785:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;46830:12;46871:17;46890:18;46912:7;:55;;46947:12;;-1:-1:-1;;;;;46947:12:0;46961:5;46912:55;;;46930:12;;46923:5;;-1:-1:-1;;;;;46930:12:0;46912:55;46870:97;;;;46989:41;47000:9;47011:10;47023:6;46989:10;:41::i;:::-;46982:48;;47061:17;47053:4;:25;;47045:55;;;;;-1:-1:-1;;;47045:55:0;;;;;;;;;;;;-1:-1:-1;;;47045:55:0;;;;;;;;;;;;;;;-1:-1:-1;47124:12:0;;-1:-1:-1;47139:23:0;47157:4;47140:11;:4;47149:1;47140:8;:11::i;47139:23::-;47124:38;-1:-1:-1;47182:14:0;:4;47124:38;47182:8;:14::i;:::-;47175:21;;47232:7;47228:107;;47281:12;;47263:37;;47274:5;;-1:-1:-1;;;;;47281:12:0;47295:4;47263:10;:37::i;:::-;47256:44;;47228:107;47347:24;47360:4;47366;47347:12;:24::i;:::-;47384:78;47405:10;47417;47429:32;47444:16;;47429:10;:14;;:32;;;;:::i;:::-;47384:20;:78::i;:::-;47491:13;;47507:1;47491:17;47475:13;:33;;;;47545:18;47566:147;47594:10;47619:5;47639:6;47660:14;47689:13;;47566;:147::i;:::-;47545:168;;47726:24;;:::i;:::-;47753:355;;;;;;;;48032:10;47753:355;;;;48012:5;-1:-1:-1;;;;;47753:355:0;;;;;47880:10;-1:-1:-1;;;;;47753:355:0;;;;;47779:6;47753:355;;;;47803:4;47753:355;;;;47830:32;47845:16;;47830:10;:14;;:32;;;;:::i;:::-;47753:355;;;;;;;;;47917:15;47753:355;;;;;;;;;;;;;;;;;;48069:27;;;47753:355;;;;;48134:11;;-1:-1:-1;48121:25:0;;;:12;:25;;;;;;;:36;;;;;;;;;;;;;;-1:-1:-1;;;;;;48121:36:0;;;-1:-1:-1;;;;;48121:36:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;48121:36:0;;;;;;;;;;;;;;;;;;;48175:55;;;;;;;;;;;48134:11;;-1:-1:-1;48175:55:0;;;;48190:10;;48175:55;;;;;;;;;46034:2204;;;;;;;;;;;;:::o;7955:149::-;8029:7;8072:22;8076:3;8088:5;8072:3;:22::i;7250:158::-;7330:4;7354:46;7364:3;-1:-1:-1;;;;;7384:14:0;;7354:9;:46::i;36640:205::-;36768:68;;;-1:-1:-1;;;;;36768:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;36768:68:0;-1:-1:-1;;;36768:68:0;;;36741:96;;36761:5;;36741:19;:96::i;62004:335::-;62079:17;62098:24;62145:6;62138:4;:13;62135:197;;;-1:-1:-1;62180:1:0;;-1:-1:-1;62215:4:0;62135:197;;;62264:16;:4;62273:6;62264:8;:16::i;:::-;62252:28;;62314:6;62295:25;;62135:197;62004:335;;;;;:::o;60435:833::-;60526:12;60554:10;60551:50;;-1:-1:-1;60588:1:0;60581:8;;60551:50;60645:14;;60611:57;;;-1:-1:-1;;;60611:57:0;;-1:-1:-1;;;;;60645:14:0;;;60611:57;;;;;;;;;;;;:25;;;;;;:57;;;;;;;;;;;;;;;60645:14;60611:25;:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;60703:16:0;;;60717:1;60703:16;;;60679:21;60703:16;;;;;60679:21;60703:16;;;;;;;;;;-1:-1:-1;60703:16:0;60679:40;;60740:9;60730:4;60735:1;60730:7;;;;;;;;;;;;;:19;-1:-1:-1;;;;;60730:19:0;;;-1:-1:-1;;;;;60730:19:0;;;;;60770:10;60760:4;60765:1;60760:7;;;;;;;;-1:-1:-1;;;;;60760:20:0;;;:7;;;;;;;;;;:20;;;;60815:43;;;-1:-1:-1;;;60815:43:0;;60852:4;60815:43;;;;;;60791:21;;60815:28;;;;;:43;;;;;;;;;;;:28;:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;60815:43:0;60890:14;;60871:261;;-1:-1:-1;;;60871:261:0;;;;;;;;60890:14;60871:261;;;;;;61086:4;60871:261;;;;;;61106:15;60871:261;;;;;;;;;;;;;;;;;;;;;60815:43;;-1:-1:-1;;;;;;60890:14:0;;;;60871:88;;60974:5;;60890:14;;61059:4;;60871:261;;;;;;;60815:43;60871:261;;;;;;;;60890:14;60871:261;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61145:20;61175:10;-1:-1:-1;;;;;61168:28:0;;61205:4;61168:43;;;;;;;;;;;;;-1:-1:-1;;;;;61168:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;61168:43:0;;-1:-1:-1;61229:31:0;61168:43;61246:13;61229:16;:31::i;:::-;61222:38;60435:833;-1:-1:-1;;;;;;;60435:833:0:o;58524:239::-;58616:18;58649:16;58646:56;;-1:-1:-1;58689:1:0;58682:8;;58646:56;58719:36;58743:11;58719:19;:10;42365:4;58719:14;:19::i;55773:1539::-;55868:17;55888:8;:16;;;:48;;55924:12;;-1:-1:-1;;;;;55924:12:0;55888:48;;;55907:8;:14;;;55888:48;55962:14;;:33;;;-1:-1:-1;;;55962:33:0;;-1:-1:-1;;;;;55962:33:0;;;;;;;;;55868:68;;-1:-1:-1;55947:12:0;;55962:14;;;;;:22;;:33;;;;;;;;;;;;;;55947:12;55962:14;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;55962:33:0;56021:13;;;;55962:33;;-1:-1:-1;56009:25:0;;56006:1299;;;56051:46;56066:4;56072:9;56083:8;:13;;;56051:14;:46::i;:::-;56112:17;56132:28;56146:8;:13;;;56132:9;:13;;:28;;;;:::i;:::-;56112:48;;56190:4;56178:9;:16;56175:998;;;56244:8;:16;;;56241:495;;;56308:14;;;;56324:12;;56297:51;;56308:14;-1:-1:-1;;;;;56324:12:0;56338:9;56297:10;:51::i;:::-;56285:63;-1:-1:-1;56374:8:0;;56371:346;;56521:14;;;;56537:12;;56497:59;;56521:14;-1:-1:-1;;;;;56537:12:0;56551:4;56497:23;:59::i;:::-;56490:66;;56593:9;56586:4;:16;56583:111;;;56657:9;56650:16;;56583:111;56754:24;56767:4;56773;56754:12;:24::i;:::-;56812:14;;;;56797:51;;56828:19;:9;56842:4;56828:13;:19::i;:::-;56797:14;:51::i;:::-;56175:998;;;56918:8;:16;;;56915:195;;;57031:14;;;;57047:12;;57075:13;;;;57020:70;;57031:14;-1:-1:-1;;;;;57047:12:0;;57061:28;;:9;;:13;:28::i;:::-;57020:10;:70::i;:::-;57008:82;;56915:195;57128:29;57141:9;57152:4;57128:12;:29::i;:::-;56006:1299;;;;57251:42;57266:4;57272:9;57283;57251:14;:42::i;:::-;55773:1539;;;;;:::o;59014:232::-;-1:-1:-1;;;;;59113:12:0;;;;;;:6;:12;;;;;;:22;-1:-1:-1;59113:22:0;59105:31;;;;;;-1:-1:-1;;;;;59162:12:0;;;;;;:6;:12;;;;;;:24;;59179:6;59162:16;:24::i;:::-;-1:-1:-1;;;;;59147:12:0;;;;;;;:6;:12;;;;;;;;:39;;;;59213:13;;;;;:9;:13;;;;;:25;;59231:6;59213:17;:25::i;:::-;-1:-1:-1;;;;;59197:13:0;;;;;;;:9;:13;;;;;:41;;;;-1:-1:-1;;59014:232:0:o;62347:562::-;62547:14;;;;62492:11;;62547:14;62518;;;62576:13;;;;62604:14;;;;62633:19;;;;62667:17;;;;62699:23;;;;62737:16;;;;62768:23;;;;62462:396;;;-1:-1:-1;;;;;62518:14:0;;;62462:396;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;62737:16;;62462:396;;;;;;;;;;62547:14;62462:396;;;;;;;;;;;;62547:14;;;;;62462:396;;;;;;;;;;-1:-1:-1;;62889:11:0;62876:25;;;;:12;:25;;;;;;;62869:32;;;;;;;;-1:-1:-1;;;;;;62869:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;62869:32:0;;;;;;62347:562::o;7494:117::-;7557:7;7584:19;7592:3;7584:7;:19::i;49288:2285::-;49415:14;;;;;49455:13;;;;49500:19;;;;49547:14;;;49570;;;49547:38;;;-1:-1:-1;;;49547:38:0;;-1:-1:-1;;;;;49570:14:0;;;49547:38;;;;;;;;49380:7;;;;49547:14;;;;;:22;;:38;;;;;;;;;;;;;;49380:7;49547:14;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;49547:38:0;49653:11;;49547:38;;-1:-1:-1;49598:28:0;;49629:36;;:23;:36::i;:::-;49702:12;;;49716:14;;;49598:67;;-1:-1:-1;49676:12:0;;49691:47;;-1:-1:-1;;;;;49702:12:0;;;;49716:14;49732:5;49691:10;:47::i;:::-;49676:62;;49765:17;49757:4;:25;;49749:55;;;;;-1:-1:-1;;;49749:55:0;;;;;;;;;;;;-1:-1:-1;;;49749:55:0;;;;;;;;;;;;;;;49815:18;49836:32;49856:5;49863:4;49836:19;:32::i;:::-;49815:53;-1:-1:-1;49895:68:0;49941:21;:5;49951:10;49941:9;:21::i;:::-;49895:41;49930:5;49895:30;:4;49904:20;49895:8;:30::i;:68::-;49887:4;:76;;49879:103;;;;;-1:-1:-1;;;49879:103:0;;;;;;;;;;;;-1:-1:-1;;;49879:103:0;;;;;;;;;;;;;;;50011:11;;;49995:13;;50075:24;:107;;50181:1;50075:107;;;50126:14;;;;50150:4;;50102:76;;-1:-1:-1;;;;;50126:14:0;;;;50150:4;50157:20;50102:23;:76::i;:::-;50060:122;;50196:8;50193:537;;;50221:22;50246:14;:4;50255;50246:8;:14::i;:::-;50295;;;;50311:12;;50221:39;;-1:-1:-1;50284:56:0;;-1:-1:-1;;;;;50295:14:0;;;;50311:12;50221:39;50284:10;:56::i;:::-;50275:65;;50193:537;;;;50429:12;;;50443:14;;;50389:26;;50418:52;;-1:-1:-1;;;;;50429:12:0;;;;50443:14;50459:10;50418;:52::i;:::-;50389:81;-1:-1:-1;50485:17:0;50505:14;:4;50514;50505:8;:14::i;:::-;50485:34;;50564:9;50542:18;:31;;50534:58;;;;;-1:-1:-1;;;50534:58:0;;;;;;;;;;;;-1:-1:-1;;;50534:58:0;;;;;;;;;;;;;;;50627:14;;;;50643:12;;50616:75;;-1:-1:-1;;;;;50627:14:0;;;;50643:12;50657:33;:18;50680:9;50657:22;:33::i;50616:75::-;50607:84;;50193:537;;;50743:8;50740:706;;;50781:4;50771:6;:14;50768:438;;50827:14;;;;50806:64;;-1:-1:-1;;;;;50827:14:0;;50859:10;50806:20;:64::i;:::-;50904:14;;;;50889:48;;-1:-1:-1;;;;;50904:14:0;50920:16;:6;50931:4;50920:10;:16::i;50889:48::-;50768:438;;;50978:17;50998:16;:4;51007:6;50998:8;:16::i;:::-;51054:14;;;;50978:36;;-1:-1:-1;51033:79:0;;-1:-1:-1;;;;;51054:14:0;;51086:25;:10;50978:36;51086:14;:25::i;:::-;51033:20;:79::i;:::-;51152:14;;;;51131:59;;-1:-1:-1;;;;;51152:14:0;;51180:9;51131:20;:59::i;:::-;50768:438;;50740:706;;;51256:4;51246:6;:14;;51238:41;;;;;-1:-1:-1;;;51238:41:0;;;;;;;;;;;;-1:-1:-1;;;51238:41:0;;;;;;;;;;;;;;;51330:14;;;;51309:62;;-1:-1:-1;;;;;51330:14:0;;51360:10;51309:20;:62::i;:::-;51401:14;;;;51386:48;;-1:-1:-1;;;;;51401:14:0;51417:16;:6;51428:4;51417:10;:16::i;51386:48::-;51456:24;51469:4;51475;51456:12;:24::i;:::-;51514:14;;;;51493:42;;51508:4;;-1:-1:-1;;;;;51514:14:0;51530:4;51493:14;:42::i;:::-;-1:-1:-1;51555:10:0;;49288:2285;-1:-1:-1;;;;;;;;;;;49288:2285:0:o;51581:1065::-;51707:14;;;;;51747:13;;;;51786:14;;51809:12;;51786:36;;;-1:-1:-1;;;51786:36:0;;-1:-1:-1;;;;;51809:12:0;;;51786:36;;;;;;;;51672:7;;;;51786:14;;;;;:22;;:36;;;;;;;;;;;;;;51672:7;51786:14;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;51786:36:0;51874:11;;51786:36;;-1:-1:-1;51835:12:0;;51850:36;;:23;:36::i;:::-;51923:14;;;;51939:12;;51835:51;;-1:-1:-1;51897:12:0;;51912:47;;-1:-1:-1;;;;;51923:14:0;;;;51939:12;51953:5;51912:10;:47::i;:::-;51897:62;;51986:17;51978:4;:25;;51970:55;;;;;-1:-1:-1;;;51970:55:0;;;;;;;;;;;;-1:-1:-1;;;51970:55:0;;;;;;;;;;;;;;;52036:18;52057:32;52077:4;52083:5;52057:19;:32::i;:::-;52036:53;-1:-1:-1;52141:14:0;:4;52150;52141:8;:14::i;:::-;52117:19;;;;52108:29;;:4;;:8;:29::i;:::-;:47;;52100:74;;;;;-1:-1:-1;;;52100:74:0;;;;;;;;;;;;-1:-1:-1;;;52100:74:0;;;;;;;;;;;;;;;52208:19;;;;52256:12;;;;52187:18;52256:12;52298:58;;52326:30;52341:14;:4;52350;52341:8;:14::i;:::-;52326:10;;:14;:30::i;:::-;52298:58;;;52309:14;:4;52318;52309:8;:14::i;:::-;52390:12;;52281:75;;-1:-1:-1;52369:40:0;;52384:4;;-1:-1:-1;;;;;52390:12:0;52404:4;52369:14;:40::i;:::-;52422:24;52435:4;52441;52422:12;:24::i;:::-;52480:14;;;;52459:90;;-1:-1:-1;;;;;52480:14:0;52496:8;:40;;52532:3;52496:40;;;52507:14;;;;-1:-1:-1;;;;;52507:14:0;52496:40;52538:10;52459:20;:90::i;:::-;52577:14;;;;52562:48;;-1:-1:-1;;;;;52577:14:0;52593:16;:6;52604:4;52593:10;:16::i;52562:48::-;-1:-1:-1;52628:10:0;;51581:1065;-1:-1:-1;;;;;;;;;;51581:1065:0:o;1760:414::-;1823:4;1845:21;1855:3;1860:5;1845:9;:21::i;:::-;1840:327;;-1:-1:-1;1883:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;2066:18;;2044:19;;;:12;;;:19;;;;;;:40;;;;2099:11;;1840:327;-1:-1:-1;2150:5:0;2143:12;;32234:192;32320:7;32356:12;32348:6;;;;32340:29;;;;-1:-1:-1;;;32340:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;32392:5:0;;;32234:192::o;38760:761::-;39184:23;39210:69;39238:4;39210:69;;;;;;;;;;;;;;;;;39218:5;-1:-1:-1;;;;;39210:27:0;;;:69;;;;;:::i;:::-;39294:17;;39184:95;;-1:-1:-1;39294:21:0;39290:224;;39436:10;39425:30;;;;;;;;;;;;;;;-1:-1:-1;39425:30:0;39417:85;;;;-1:-1:-1;;;39417:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7015:149;7088:4;7112:44;7120:3;-1:-1:-1;;;;;7140:14:0;;7112:7;:44::i;40409:323::-;40484:14;40500;40545:6;-1:-1:-1;;;;;40535:16:0;:6;-1:-1:-1;;;;;40535:16:0;;;40527:53;;;;;-1:-1:-1;;;40527:53:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;40619:6;-1:-1:-1;;;;;40610:15:0;:6;-1:-1:-1;;;;;40610:15:0;;:53;;40648:6;40656;40610:53;;;40629:6;40637;40610:53;40591:72;;-1:-1:-1;40591:72:0;-1:-1:-1;;;;;;40682:20:0;;40674:50;;;;;-1:-1:-1;;;40674:50:0;;;;;;;;;;;;-1:-1:-1;;;40674:50:0;;;;;;;;;;;;;;40858:491;40951:14;40997:1;40986:8;:12;40978:55;;;;;-1:-1:-1;;;40978:55:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;41064:1;41052:9;:13;:31;;;;;41082:1;41069:10;:14;41052:31;41044:71;;;;;-1:-1:-1;;;41044:71:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;41126:20;41149:17;:8;41162:3;41149:12;:17::i;:::-;41126:40;-1:-1:-1;41177:14:0;41194:31;41126:40;41214:10;41194:19;:31::i;:::-;41177:48;-1:-1:-1;41236:16:0;41255:40;41279:15;41255:19;:9;41269:4;41255:13;:19::i;:40::-;41236:59;;41330:11;41318:9;:23;;;;;;;40858:491;-1:-1:-1;;;;;;;40858:491:0:o;34260:278::-;34346:7;34381:12;34374:5;34366:28;;;;-1:-1:-1;;;34366:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;34405:9;34421:1;34417;:5;;;;;;;34260:278;-1:-1:-1;;;;;34260:278:0:o;61276:173::-;61359:18;61403:38;61426:14;61404:16;:7;42365:4;61404:11;:16::i;61457:356::-;61526:16;61545:11;:4;61554:1;61545:8;:11::i;:::-;61591:4;;:28;;;-1:-1:-1;;;61591:28:0;;-1:-1:-1;;;;;61591:28:0;;;;;;;;;;;;;;;61526:30;;-1:-1:-1;61591:4:0;;;:12;;:28;;;;;;;;;;;;;;;:4;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;61630:38:0;;;-1:-1:-1;;;61630:38:0;;;;;;;;;;-1:-1:-1;;;;;61630:28:0;;;;;:38;;;;;-1:-1:-1;;61630:38:0;;;;;;;-1:-1:-1;61630:28:0;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;61706:4:0;;61727:7;;-1:-1:-1;;;;;61706:4:0;;;;-1:-1:-1;61706:12:0;;-1:-1:-1;61727:7:0;61737:18;:4;61746:8;61737;:18::i;:::-;61706:50;;;;;;;;;;;;;-1:-1:-1;;;;;61706:50:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;61767:7:0;;-1:-1:-1;;;;;61767:7:0;:18;61786;:4;61795:8;61786;:18::i;:::-;61767:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;58771:235;-1:-1:-1;;;;;58870:15:0;;;;;;:9;:15;;;;;;:25;-1:-1:-1;58870:25:0;58862:34;;;;;;-1:-1:-1;;;;;58925:15:0;;;;;;:9;:15;;;;;;:27;;58945:6;58925:19;:27::i;:::-;-1:-1:-1;;;;;58907:15:0;;;;;;;:9;:15;;;;;;;;:45;;;;58976:10;;;;;:6;:10;;;;;:22;;58991:6;58976:14;:22::i;:::-;-1:-1:-1;;;;;58963:10:0;;;;;;;:6;:10;;;;;:35;;;;-1:-1:-1;;58771:235:0:o;59382:350::-;59658:55;;;-1:-1:-1;;59658:55:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;59634:90;;;;;;59382:350::o;4648:204::-;4743:18;;4715:7;;4743:26;-1:-1:-1;4735:73:0;;;;-1:-1:-1;;;4735:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4826:3;:11;;4838:5;4826:18;;;;;;;;;;;;;;;;4819:25;;4648:204;;;;:::o;3980:129::-;4053:4;4077:19;;;:12;;;;;:19;;;;;;:24;;;3980:129::o;61821:173::-;61916:5;-1:-1:-1;;;;;61909:21:0;;61931:4;61937:6;61909:35;;;;;;;;;;;;;-1:-1:-1;;;;;61909:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;61955:31:0;;;-1:-1:-1;;;61955:31:0;;;;;;;;;;-1:-1:-1;;;;;61955:23:0;;;;;:31;;;;;61909:35;;61955:31;;;;;;;-1:-1:-1;61955:23:0;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;59254:120;-1:-1:-1;;;;;59341:13:0;;;;;;:9;:13;;;;;;:25;;59359:6;59341:17;:25::i;:::-;-1:-1:-1;;;;;59325:13:0;;;;;;;:9;:13;;;;;:41;;;;-1:-1:-1;59254:120:0:o;4195:109::-;4278:18;;4195:109::o;13408:195::-;13511:12;13543:52;13565:6;13573:4;13579:1;13582:12;13543:21;:52::i;2350:1544::-;2416:4;2555:19;;;:12;;;:19;;;;;;2591:15;;2587:1300;;3026:18;;-1:-1:-1;;2977:14:0;;;;3026:22;;;;2953:21;;3026:3;;:22;;3313;;;;;;;;;;;;;;3293:42;;3459:9;3430:3;:11;;3442:13;3430:26;;;;;;;;;;;;;;;;;;;:38;;;;3536:23;;;3578:1;3536:12;;;:23;;;;;;3562:17;;;3536:43;;3688:17;;3536:3;;3688:17;;;;;;;;;;;;;;;;;;;;;;3783:3;:12;;:19;3796:5;3783:19;;;;;;;;;;;3776:26;;;3826:4;3819:11;;;;;;;;2587:1300;3870:5;3863:12;;;;;14460:530;14587:12;14645:5;14620:21;:30;;14612:81;;;;-1:-1:-1;;;14612:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14712:18;14723:6;14712:10;:18::i;:::-;14704:60;;;;;-1:-1:-1;;;14704:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;14838:12;14852:23;14879:6;-1:-1:-1;;;;;14879:11:0;14899:5;14907:4;14879:33;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;14879:33:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14837:75;;;;14930:52;14948:7;14957:10;14969:12;14930:17;:52::i;10490:422::-;10857:20;10896:8;;;10490:422::o;15996:742::-;16111:12;16140:7;16136:595;;;-1:-1:-1;16171:10:0;16164:17;;16136:595;16285:17;;:21;16281:439;;16548:10;16542:17;16609:15;16596:10;16592:2;16588:19;16581:44;16496:148;16684:20;;-1:-1:-1;;;16684:20:0;;;;;;;;;;;;;;;;;16691:12;;16684:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o

Swarm Source

ipfs://66c78c74c2931d4cc6a365efe9a14a900620ad99b8acf73e3cf597454a6e8c3d

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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