Contract 0x79197Ed8f7e10f244cc2D1E10e364ce1Bc2A369F

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x80b7b4cab8cd9d8902ffc8e9b5cf82e7757591255c853f812c17dd3945a76fef0x61014060127414502022-03-29 19:49:2052 days 6 hrs ago0x209484169c126f69db7c83df8d7cd0cb3db22519 IN  Create: RewardSwap0 AVAX0.394269075225
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardSwap

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at snowtrace.io on 2022-04-13
*/

// RewardSwap.sol Flattened
// SPDX-License-Identifier: MIT AND BSD-4-Clause
/*
Avacash.Finance: Privacy-focused Investments in Avalanche
Visit https://avacash.finance
Check Audits in https://docs.avacash.finance/

V.1.1


█████╗ ██╗   ██╗ █████╗  ██████╗ █████╗ ███████╗██╗  ██╗
██╔══██╗██║   ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║  ██║
███████║██║   ██║███████║██║     ███████║███████╗███████║
██╔══██║╚██╗ ██╔╝██╔══██║██║     ██╔══██║╚════██║██╔══██║
██║  ██║ ╚████╔╝ ██║  ██║╚██████╗██║  ██║███████║██║  ██║
╚═╝  ╚═╝  ╚═══╝  ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝

███████╗██╗███╗   ██╗ █████╗ ███╗   ██╗ ██████╗███████╗
██╔════╝██║████╗  ██║██╔══██╗████╗  ██║██╔════╝██╔════╝
█████╗  ██║██╔██╗ ██║███████║██╔██╗ ██║██║     █████╗
██╔══╝  ██║██║╚██╗██║██╔══██║██║╚██╗██║██║     ██╔══╝
██║     ██║██║ ╚████║██║  ██║██║ ╚████║╚██████╗███████╗
╚═╝     ╚═╝╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝╚══════╝

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

// License: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

// License: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// License: MIT

pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// License: MIT

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/utils/FloatMath.sol

// License: BSD-4-Clause
/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <[email protected]>
 */
pragma solidity ^0.6.0;

/**
 * Smart contract library of mathematical functions operating with signed
 * 64.64-bit fixed point numbers.  Signed 64.64-bit fixed point number is
 * basically a simple fraction whose numerator is signed 128-bit integer and
 * denominator is 2^64.  As long as denominator is always the same, there is no
 * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are
 * represented by int128 type holding only the numerator.
 */
library FloatMath {
  /*
   * Minimum value signed 64.64-bit fixed point number may have.
   */
  int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;

  /*
   * Maximum value signed 64.64-bit fixed point number may have.
   */
  int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Convert signed 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromInt (int256 x) internal pure returns (int128) {
    require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF);
    return int128 (x << 64);
  }

  /**
   * Convert signed 64.64 fixed point number into signed 64-bit integer number
   * rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64-bit integer number
   */
  function toInt (int128 x) internal pure returns (int64) {
    return int64 (x >> 64);
  }

  /**
   * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromUInt (uint256 x) internal pure returns (int128) {
    require (x <= 0x7FFFFFFFFFFFFFFF);
    return int128 (x << 64);
  }

  /**
   * Convert signed 64.64 fixed point number into unsigned 64-bit integer
   * number rounding down.  Revert on underflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return unsigned 64-bit integer number
   */
  function toUInt (int128 x) internal pure returns (uint64) {
    require (x >= 0);
    return uint64 (x >> 64);
  }

  /**
   * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point
   * number rounding down.  Revert on overflow.
   *
   * @param x signed 128.128-bin fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function from128x128 (int256 x) internal pure returns (int128) {
    int256 result = x >> 64;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Convert signed 64.64 fixed point number into signed 128.128 fixed point
   * number.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 128.128 fixed point number
   */
  function to128x128 (int128 x) internal pure returns (int256) {
    return int256 (x) << 64;
  }

  /**
   * Calculate x + y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function add (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) + y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x - y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sub (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) - y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding down.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function mul (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) * y >> 64;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point
   * number and y is signed 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y signed 256-bit integer number
   * @return signed 256-bit integer number
   */
  function muli (int128 x, int256 y) internal pure returns (int256) {
    if (x == MIN_64x64) {
      require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF &&
      y <= 0x1000000000000000000000000000000000000000000000000);
      return -y << 63;
    } else {
      bool negativeResult = false;
      if (x < 0) {
        x = -x;
        negativeResult = true;
      }
      if (y < 0) {
        y = -y; // We rely on overflow behavior here
        negativeResult = !negativeResult;
      }
      uint256 absoluteResult = mulu (x, uint256 (y));
      if (negativeResult) {
        require (absoluteResult <=
          0x8000000000000000000000000000000000000000000000000000000000000000);
        return -int256 (absoluteResult); // We rely on overflow behavior here
      } else {
        require (absoluteResult <=
          0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
        return int256 (absoluteResult);
      }
    }
  }

  /**
   * Calculate x * y rounding down, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y unsigned 256-bit integer number
   * @return unsigned 256-bit integer number
   */
  function mulu (int128 x, uint256 y) internal pure returns (uint256) {
    if (y == 0) return 0;

    require (x >= 0);

    uint256 lo = (uint256 (x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
    uint256 hi = uint256 (x) * (y >> 128);

    require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    hi <<= 64;

    require (hi <=
      0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo);
    return hi + lo;
  }

  /**
   * Calculate x / y rounding towards zero.  Revert on overflow or when y is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function div (int128 x, int128 y) internal pure returns (int128) {
    require (y != 0);
    int256 result = (int256 (x) << 64) / y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are signed 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x signed 256-bit integer number
   * @param y signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divi (int256 x, int256 y) internal pure returns (int128) {
    require (y != 0);

    bool negativeResult = false;
    if (x < 0) {
      x = -x; // We rely on overflow behavior here
      negativeResult = true;
    }
    if (y < 0) {
      y = -y; // We rely on overflow behavior here
      negativeResult = !negativeResult;
    }
    uint128 absoluteResult = divuu (uint256 (x), uint256 (y));
    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divu (uint256 x, uint256 y) internal pure returns (int128) {
    require (y != 0);
    uint128 result = divuu (x, y);
    require (result <= uint128 (MAX_64x64));
    return int128 (result);
  }

  /**
   * Calculate -x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function neg (int128 x) internal pure returns (int128) {
    require (x != MIN_64x64);
    return -x;
  }

  /**
   * Calculate |x|.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function abs (int128 x) internal pure returns (int128) {
    require (x != MIN_64x64);
    return x < 0 ? -x : x;
  }

  /**
   * Calculate 1 / x rounding towards zero.  Revert on overflow or when x is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function inv (int128 x) internal pure returns (int128) {
    require (x != 0);
    int256 result = int256 (0x100000000000000000000000000000000) / x;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function avg (int128 x, int128 y) internal pure returns (int128) {
    return int128 ((int256 (x) + int256 (y)) >> 1);
  }

  /**
   * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down.
   * Revert on overflow or in case x * y is negative.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function gavg (int128 x, int128 y) internal pure returns (int128) {
    int256 m = int256 (x) * int256 (y);
    require (m >= 0);
    require (m <
      0x4000000000000000000000000000000000000000000000000000000000000000);
    return int128 (sqrtu (uint256 (m)));
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y uint256 value
   * @return signed 64.64-bit fixed point number
   */
  function pow (int128 x, uint256 y) internal pure returns (int128) {
    uint256 absoluteResult;
    bool negativeResult = false;
    if (x >= 0) {
      absoluteResult = powu (uint256 (x) << 63, y);
    } else {
      // We rely on overflow behavior here
      absoluteResult = powu (uint256 (uint128 (-x)) << 63, y);
      negativeResult = y & 1 > 0;
    }

    absoluteResult >>= 63;

    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate sqrt (x) rounding down.  Revert if x < 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sqrt (int128 x) internal pure returns (int128) {
    require (x >= 0);
    return int128 (sqrtu (uint256 (x) << 64));
  }

  /**
   * Calculate binary logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function log_2 (int128 x) internal pure returns (int128) {
    require (x > 0);

    int256 msb = 0;
    int256 xc = x;
    if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
    if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
    if (xc >= 0x10000) { xc >>= 16; msb += 16; }
    if (xc >= 0x100) { xc >>= 8; msb += 8; }
    if (xc >= 0x10) { xc >>= 4; msb += 4; }
    if (xc >= 0x4) { xc >>= 2; msb += 2; }
    if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

    int256 result = msb - 64 << 64;
    uint256 ux = uint256 (x) << uint256 (127 - msb);
    for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) {
      ux *= ux;
      uint256 b = ux >> 255;
      ux >>= 127 + b;
      result += bit * int256 (b);
    }

    return int128 (result);
  }

  /**
   * Calculate natural logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function ln (int128 x) internal pure returns (int128) {
    require (x > 0);

    return int128 (
      uint256 (log_2 (x)) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128);
  }

  /**
   * Calculate binary exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp_2 (int128 x) internal pure returns (int128) {
    require (x < 0x400000000000000000); // Overflow

    if (x < -0x400000000000000000) return 0; // Underflow

    uint256 result = 0x80000000000000000000000000000000;

    if (x & 0x8000000000000000 > 0)
      result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128;
    if (x & 0x4000000000000000 > 0)
      result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128;
    if (x & 0x2000000000000000 > 0)
      result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128;
    if (x & 0x1000000000000000 > 0)
      result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128;
    if (x & 0x800000000000000 > 0)
      result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128;
    if (x & 0x400000000000000 > 0)
      result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128;
    if (x & 0x200000000000000 > 0)
      result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128;
    if (x & 0x100000000000000 > 0)
      result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128;
    if (x & 0x80000000000000 > 0)
      result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128;
    if (x & 0x40000000000000 > 0)
      result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128;
    if (x & 0x20000000000000 > 0)
      result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128;
    if (x & 0x10000000000000 > 0)
      result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128;
    if (x & 0x8000000000000 > 0)
      result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128;
    if (x & 0x4000000000000 > 0)
      result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128;
    if (x & 0x2000000000000 > 0)
      result = result * 0x1000162E525EE054754457D5995292026 >> 128;
    if (x & 0x1000000000000 > 0)
      result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128;
    if (x & 0x800000000000 > 0)
      result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128;
    if (x & 0x400000000000 > 0)
      result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128;
    if (x & 0x200000000000 > 0)
      result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128;
    if (x & 0x100000000000 > 0)
      result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128;
    if (x & 0x80000000000 > 0)
      result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128;
    if (x & 0x40000000000 > 0)
      result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128;
    if (x & 0x20000000000 > 0)
      result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128;
    if (x & 0x10000000000 > 0)
      result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128;
    if (x & 0x8000000000 > 0)
      result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128;
    if (x & 0x4000000000 > 0)
      result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128;
    if (x & 0x2000000000 > 0)
      result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128;
    if (x & 0x1000000000 > 0)
      result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128;
    if (x & 0x800000000 > 0)
      result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128;
    if (x & 0x400000000 > 0)
      result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128;
    if (x & 0x200000000 > 0)
      result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128;
    if (x & 0x100000000 > 0)
      result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128;
    if (x & 0x80000000 > 0)
      result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128;
    if (x & 0x40000000 > 0)
      result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128;
    if (x & 0x20000000 > 0)
      result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128;
    if (x & 0x10000000 > 0)
      result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128;
    if (x & 0x8000000 > 0)
      result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128;
    if (x & 0x4000000 > 0)
      result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128;
    if (x & 0x2000000 > 0)
      result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128;
    if (x & 0x1000000 > 0)
      result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128;
    if (x & 0x800000 > 0)
      result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128;
    if (x & 0x400000 > 0)
      result = result * 0x100000000002C5C85FDF477B662B26945 >> 128;
    if (x & 0x200000 > 0)
      result = result * 0x10000000000162E42FEFA3AE53369388C >> 128;
    if (x & 0x100000 > 0)
      result = result * 0x100000000000B17217F7D1D351A389D40 >> 128;
    if (x & 0x80000 > 0)
      result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128;
    if (x & 0x40000 > 0)
      result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128;
    if (x & 0x20000 > 0)
      result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128;
    if (x & 0x10000 > 0)
      result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128;
    if (x & 0x8000 > 0)
      result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128;
    if (x & 0x4000 > 0)
      result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128;
    if (x & 0x2000 > 0)
      result = result * 0x1000000000000162E42FEFA39F02B772C >> 128;
    if (x & 0x1000 > 0)
      result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128;
    if (x & 0x800 > 0)
      result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128;
    if (x & 0x400 > 0)
      result = result * 0x100000000000002C5C85FDF473DEA871F >> 128;
    if (x & 0x200 > 0)
      result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128;
    if (x & 0x100 > 0)
      result = result * 0x100000000000000B17217F7D1CF79E949 >> 128;
    if (x & 0x80 > 0)
      result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128;
    if (x & 0x40 > 0)
      result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128;
    if (x & 0x20 > 0)
      result = result * 0x100000000000000162E42FEFA39EF366F >> 128;
    if (x & 0x10 > 0)
      result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128;
    if (x & 0x8 > 0)
      result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128;
    if (x & 0x4 > 0)
      result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128;
    if (x & 0x2 > 0)
      result = result * 0x1000000000000000162E42FEFA39EF358 >> 128;
    if (x & 0x1 > 0)
      result = result * 0x10000000000000000B17217F7D1CF79AB >> 128;

    result >>= uint256 (63 - (x >> 64));
    require (result <= uint256 (MAX_64x64));

    return int128 (result);
  }

  /**
   * Calculate natural exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp (int128 x) internal pure returns (int128) {
    require (x < 0x400000000000000000); // Overflow

    if (x < -0x400000000000000000) return 0; // Underflow

    return exp_2 (
      int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128));
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return unsigned 64.64-bit fixed point number
   */
  function divuu (uint256 x, uint256 y) private pure returns (uint128) {
    require (y != 0);

    uint256 result;

    if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
      result = (x << 64) / y;
    else {
      uint256 msb = 192;
      uint256 xc = x >> 192;
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1);
      require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

      uint256 hi = result * (y >> 128);
      uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

      uint256 xh = x >> 192;
      uint256 xl = x << 64;

      if (xl < lo) xh -= 1;
      xl -= lo; // We rely on overflow behavior here
      lo = hi << 128;
      if (xl < lo) xh -= 1;
      xl -= lo; // We rely on overflow behavior here

      assert (xh == hi >> 128);

      result += xl / y;
    }

    require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    return uint128 (result);
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is unsigned 129.127 fixed point
   * number and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x unsigned 129.127-bit fixed point number
   * @param y uint256 value
   * @return unsigned 129.127-bit fixed point number
   */
  function powu (uint256 x, uint256 y) internal pure returns (uint256) {
    if (y == 0) return 0x80000000000000000000000000000000;
    else if (x == 0) return 0;
    else {
      int256 msb = 0;
      uint256 xc = x;
      if (xc >= 0x100000000000000000000000000000000) { xc >>= 128; msb += 128; }
      if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      int256 xe = msb - 127;
      if (xe > 0) x >>= uint256 (xe);
      else x <<= uint256 (-xe);

      uint256 result = 0x80000000000000000000000000000000;
      int256 re = 0;

      while (y > 0) {
        if (y & 1 > 0) {
          result = result * x;
          y -= 1;
          re += xe;
          if (result >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            result >>= 128;
            re += 1;
          } else result >>= 127;
          if (re < -127) return 0; // Underflow
          require (re < 128); // Overflow
        } else {
          x = x * x;
          y >>= 1;
          xe <<= 1;
          if (x >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            x >>= 128;
            xe += 1;
          } else x >>= 127;
          if (xe < -127) return 0; // Underflow
          require (xe < 128); // Overflow
        }
      }

      if (re > 0) result <<= uint256 (re);
      else if (re < 0) result >>= uint256 (-re);

      return result;
    }
  }

  /**
   * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer
   * number.
   *
   * @param x unsigned 256-bit integer number
   * @return unsigned 128-bit integer number
   */
  function sqrtu (uint256 x) private pure returns (uint128) {
    if (x == 0) return 0;
    else {
      uint256 xx = x;
      uint256 r = 1;
      if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
      if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
      if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
      if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
      if (xx >= 0x100) { xx >>= 8; r <<= 4; }
      if (xx >= 0x10) { xx >>= 4; r <<= 2; }
      if (xx >= 0x8) { r <<= 1; }
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1; // Seven iterations should be enough
      uint256 r1 = x / r;
      return uint128 (r < r1 ? r : r1);
    }
  }
}

// File: contracts/RewardSwap.sol

// License: MIT

pragma solidity ^0.6.0;


//import "torn-token/contracts/ENS.sol";


/**
  Let's imagine we have 1M CASH tokens for anonymity mining to distribute during 1 year (~31536000 seconds).
  The contract should constantly add liquidity to a pool of claimed rewards to CASH (REWD/CASH). At any time user can exchange REWD->CASH using
  this pool. The rate depends on current available CASH liquidity - the more CASH are withdrawn the worse the swap rate is.

  The contract starts with some virtual balance liquidity and adds some CASH tokens every second to the balance. Users will decrease
  this balance by swaps.

  Exchange rate can be calculated as following:
  BalanceAfter = BalanceBefore * e^(-rewardAmount/poolWeight)
  tokens = BalanceBefore - BalanceAfter
*/

contract RewardSwap { //is EnsResolve {
  using SafeMath for uint256;

  uint256 public constant DURATION = 365 days;
  uint256 public constant SECONDS_IN_A_YEAR = 365 days;

  IERC20 public immutable cash;
  address public immutable miner;
  uint256 public immutable startTimestamp;
  uint256 public immutable initialLiquidity;
  uint256 public immutable liquidity;
  uint256 public immutable miningCap;
  uint256 public tokensSold;
  uint256 public poolWeight;

  event Swap(address indexed recipient, uint256 pCASH, uint256 CASH);
  event PoolWeightUpdated(uint256 newWeight);
  event Exp2(int128 result);

  modifier onlyMiner() {
    require(msg.sender == miner, "Only Miner contract can call");
    _;
  }

  constructor(
    address _cash,
    address _miner,
    uint256 _miningCap, // in TORN uses 1,000,000; CASH uses 500,000
    uint256 _initialLiquidity, // in TORN is 25,000; CASH uses 12,500
    uint256 _poolWeight //
  ) public {
    require(_initialLiquidity <= _miningCap, "Initial liquidity should be lower than mining cap");
    cash = IERC20(_cash);
    miner = _miner;
    miningCap = _miningCap;
    initialLiquidity = _initialLiquidity;
    liquidity = _miningCap.sub(_initialLiquidity);
    poolWeight = _poolWeight;
    startTimestamp = getTimestamp();
  }

  function swap(address _recipient, uint256 _amount) external onlyMiner returns (uint256) {
    uint256 tokens = getExpectedReturn(_amount);
    tokensSold += tokens;
    require(cash.transfer(_recipient, tokens), "transfer failed");
    emit Swap(_recipient, _amount, tokens);
    return tokens;
  }

  /*
    _amount Amount of AP
   */
  function getExpectedReturn(uint256 _amount) public view returns (uint256) {
    uint256 oldBalance = cashVirtualBalance();
    int128 pow = FloatMath.neg(FloatMath.divu(_amount, poolWeight));
    int128 exp = FloatMath.exp(pow);
    uint256 newBalance = FloatMath.mulu(exp, oldBalance);
    return oldBalance.sub(newBalance);
    //oldBalance = Tvirt.
    //newBalance = Tvirt*e^(-ap/W)
    //TORN = Tvirt - Tvirt*e^(-ap/W) = Tvirt*(1-e^(-ap/W))
  }

  function cashVirtualBalance() public view returns (uint256) {
    //uint256 passedTime = getPassedTime();
    uint256 yearNumber = getYearNumber();
    uint256 passedTimeThisYear = getPassedTimeThisYear();
    uint256 accumulated;

    // Caculates accumulated available CASH tokens from previous years
    for(uint i=1; i<yearNumber; i++){
      accumulated = accumulated.add(maxLiquidityOnYear(i));
    }

    // Calculates CASH tokens available for this year.
    uint256 fromThisYearAvailable = maxLiquidityOnYear(yearNumber).mul(passedTimeThisYear).div(SECONDS_IN_A_YEAR);

    return accumulated.add(fromThisYearAvailable).sub(tokensSold);
  }

  function setPoolWeight(uint256 _newWeight) external onlyMiner {
    poolWeight = _newWeight;
    emit PoolWeightUpdated(_newWeight);
  }

  function getTimestamp() public view virtual returns (uint256) {
    return block.timestamp;
  }

  function getPassedTime() public view virtual returns (uint256) {
    return getTimestamp().sub(startTimestamp);
  }

  function getYearNumber() public view virtual returns (uint256) {
    return getPassedTime().div(SECONDS_IN_A_YEAR).add(1);
  }

  function getPassedTimeThisYear() public view virtual returns (uint256) {
    // First year, getYearNumber()=1;
    return getPassedTime().sub(SECONDS_IN_A_YEAR.mul(getYearNumber().sub(1)));
  }

  function maxLiquidityOnYear(uint256 _year) public view virtual returns (uint256) {
    return miningCap.div(exp_2_uint256(_year));
  }

  function exp_2_uint256(uint256 _year) public view virtual returns (uint256) {
    require (_year <= 0x7FFFFFFFFFFFFFFF, "year must be less than 2**63-1");
    return uint256(FloatMath.toInt(FloatMath.exp_2(FloatMath.fromUInt(_year)))); //)
  }

  function showfromUInt(uint256 _year) public view virtual returns (int128) {
    return FloatMath.fromUInt(_year); //)
  }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_cash","type":"address"},{"internalType":"address","name":"_miner","type":"address"},{"internalType":"uint256","name":"_miningCap","type":"uint256"},{"internalType":"uint256","name":"_initialLiquidity","type":"uint256"},{"internalType":"uint256","name":"_poolWeight","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int128","name":"result","type":"int128"}],"name":"Exp2","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newWeight","type":"uint256"}],"name":"PoolWeightUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"pCASH","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"CASH","type":"uint256"}],"name":"Swap","type":"event"},{"inputs":[],"name":"DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_IN_A_YEAR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cash","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cashVirtualBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_year","type":"uint256"}],"name":"exp_2_uint256","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getExpectedReturn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPassedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPassedTimeThisYear","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getYearNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_year","type":"uint256"}],"name":"maxLiquidityOnYear","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"miner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"miningCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newWeight","type":"uint256"}],"name":"setPoolWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_year","type":"uint256"}],"name":"showfromUInt","outputs":[{"internalType":"int128","name":"","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"swap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokensSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101406040523480156200001257600080fd5b506040516200211838038062002118833981810160405260a08110156200003857600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505082821115620000cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180620020e76031913960400191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508373ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250508261012081815250508160e081815250506200016582846200019660201b62000c1a1790919060201c565b610100818152505080600181905550620001846200021a60201b60201c565b60c08181525050505050505062000222565b6000828211156200020f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600042905090565b60805160601c60a05160601c60c05160e0516101005161012051611e5c6200028b600039806105c25280610ad252508061058852508061061c5250806107005280610bf85250806105f852806108575280610af652508061073c52806109345250611e5c6000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806391bce30d116100b8578063c065f01e1161007c578063c065f01e146103bd578063c4fa17a4146103db578063d004f0f7146103f9578063e2bfa4f61461045b578063e53c4cab14610479578063e6fd48bc146104a757610137565b806391bce30d146102ed578063961be3911461030b578063965c0f281461033f578063971fe56b14610381578063aa5a26aa1461039f57610137565b8063349dc329116100ff578063349dc329146101f657806340702adc1461022a578063518ab2a8146102485780636290b869146102665780636d7c11b2146102ab57610137565b80631542fdc01461013c578063188ec3561461015a5780631a686502146101785780631be05289146101965780631c4b61b5146101b4575b600080fd5b6101446104c5565b6040518082815260200191505060405180910390f35b61016261057e565b6040518082815260200191505060405180910390f35b610180610586565b6040518082815260200191505060405180910390f35b61019e6105aa565b6040518082815260200191505060405180910390f35b6101e0600480360360208110156101ca57600080fd5b81019080803590602001909291905050506105b2565b6040518082815260200191505060405180910390f35b6101fe6105f6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61023261061a565b6040518082815260200191505060405180910390f35b61025061063e565b6040518082815260200191505060405180910390f35b6102926004803603602081101561027c57600080fd5b8101908080359060200190929190505050610644565b6040518082600f0b815260200191505060405180910390f35b6102d7600480360360208110156102c157600080fd5b8101908080359060200190929190505050610656565b6040518082815260200191505060405180910390f35b6102f56106f9565b6040518082815260200191505060405180910390f35b61031361073a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61036b6004803603602081101561035557600080fd5b810190808035906020019092919050505061075e565b6040518082815260200191505060405180910390f35b6103896107bc565b6040518082815260200191505060405180910390f35b6103a76107c2565b6040518082815260200191505060405180910390f35b6103c56107fa565b6040518082815260200191505060405180910390f35b6103e361084b565b6040518082815260200191505060405180910390f35b6104456004803603604081101561040f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610853565b6040518082815260200191505060405180910390f35b610463610ad0565b6040518082815260200191505060405180910390f35b6104a56004803603602081101561048f57600080fd5b8101908080359060200190929190505050610af4565b005b6104af610bf6565b6040518082815260200191505060405180910390f35b6000806104d06107c2565b905060006104dc6107fa565b9050600080600190505b83811015610518576105096104fa826105b2565b83610c9d90919063ffffffff16565b915080806001019150506104e6565b50600061054c6301e1338061053e85610530886105b2565b610d2590919063ffffffff16565b610dab90919063ffffffff16565b90506105756000546105678385610c9d90919063ffffffff16565b610c1a90919063ffffffff16565b94505050505090565b600042905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6301e1338081565b60006105ef6105c083610656565b7f0000000000000000000000000000000000000000000000000000000000000000610dab90919063ffffffff16565b9050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60005481565b600061064f82610e34565b9050919050565b6000677fffffffffffffff8211156106d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f79656172206d757374206265206c657373207468616e20322a2a36332d31000081525060200191505060405180910390fd5b6106ef6106ea6106e584610e34565b610e57565b611a57565b60070b9050919050565b60006107357f000000000000000000000000000000000000000000000000000000000000000061072761057e565b610c1a90919063ffffffff16565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806107696104c5565b9050600061078161077c85600154611a68565b611ad0565b9050600061078e82611b10565b9050600061079c8285611b89565b90506107b18185610c1a90919063ffffffff16565b945050505050919050565b60015481565b60006107f560016107e76301e133806107d96106f9565b610dab90919063ffffffff16565b610c9d90919063ffffffff16565b905090565b600061084661083061081d600161080f6107c2565b610c1a90919063ffffffff16565b6301e13380610d2590919063ffffffff16565b6108386106f9565b610c1a90919063ffffffff16565b905090565b6301e1338081565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610916576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4f6e6c79204d696e657220636f6e74726163742063616e2063616c6c0000000081525060200191505060405180910390fd5b60006109218361075e565b90508060008082825401925050819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156109c357600080fd5b505af11580156109d7573d6000803e3d6000fd5b505050506040513d60208110156109ed57600080fd5b8101908080519060200190929190505050610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f7472616e73666572206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff167f77f92a1b6a1a11de8ca49515ad4c1fad45632dd3442167d74b90b304a3c7a7588483604051808381526020018281526020019250505060405180910390a28091505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4f6e6c79204d696e657220636f6e74726163742063616e2063616c6c0000000081525060200191505060405180910390fd5b806001819055507f5223da7c92e02ab8e6abfa2e1c7e6a47924c5a48c9a7745e50c80dfcd95438b1816040518082815260200191505060405180910390a150565b7f000000000000000000000000000000000000000000000000000000000000000081565b600082821115610c92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015610d1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080831415610d385760009050610da5565b6000828402905082848281610d4957fe5b0414610da0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611e066021913960400191505060405180910390fd5b809150505b92915050565b6000808211610e22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381610e2b57fe5b04905092915050565b6000677fffffffffffffff821115610e4b57600080fd5b604082901b9050919050565b60006840000000000000000082600f0b12610e7157600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffc0000000000000000082600f0b1215610ea55760009050611a52565b60006f80000000000000000000000000000000905060006780000000000000008416600f0b1315610eeb57608070016a09e667f3bcc908b2fb1366ea957d3e8202901c90505b60006740000000000000008416600f0b1315610f1c5760807001306fe0a31b7152de8d5a46305c85edec8202901c90505b60006720000000000000008416600f0b1315610f4d5760807001172b83c7d517adcdf7c8c50eb14a791f8202901c90505b60006710000000000000008416600f0b1315610f7e57608070010b5586cf9890f6298b92b71842a983638202901c90505b60006708000000000000008416600f0b1315610faf5760807001059b0d31585743ae7c548eb68ca417fd8202901c90505b60006704000000000000008416600f0b1315610fe0576080700102c9a3e778060ee6f7caca4f7a29bde88202901c90505b60006702000000000000008416600f0b131561101157608070010163da9fb33356d84a66ae336dcdfa3f8202901c90505b60006701000000000000008416600f0b1315611042576080700100b1afa5abcbed6129ab13ec11dc95438202901c90505b600066800000000000008416600f0b131561107257608070010058c86da1c09ea1ff19d294cf2f679b8202901c90505b600066400000000000008416600f0b13156110a25760807001002c605e2e8cec506d21bfc89a23a00f8202901c90505b600066200000000000008416600f0b13156110d2576080700100162f3904051fa128bca9c55c31e5df8202901c90505b600066100000000000008416600f0b13156111025760807001000b175effdc76ba38e31671ca9397258202901c90505b600066080000000000008416600f0b1315611132576080700100058ba01fb9f96d6cacd4b180917c3d8202901c90505b600066040000000000008416600f0b131561116257608070010002c5cc37da9491d0985c348c68e7b38202901c90505b600066020000000000008416600f0b13156111925760807001000162e525ee054754457d59952920268202901c90505b600066010000000000008416600f0b13156111c257608070010000b17255775c040618bf4a4ade83fc8202901c90505b6000658000000000008416600f0b13156111f15760807001000058b91b5bc9ae2eed81e9b7d4cfab8202901c90505b6000654000000000008416600f0b1315611220576080700100002c5c89d5ec6ca4d7c8acc017b7c98202901c90505b6000652000000000008416600f0b131561124f57608070010000162e43f4f831060e02d839a9d16d8202901c90505b6000651000000000008416600f0b131561127e576080700100000b1721bcfc99d9f890ea069117638202901c90505b6000650800000000008416600f0b13156112ad57608070010000058b90cf1e6d97f9ca14dbcc16288202901c90505b6000650400000000008416600f0b13156112dc5760807001000002c5c863b73f016468f6bac5ca2b8202901c90505b6000650200000000008416600f0b131561130b576080700100000162e430e5a18f6119e3c02282a58202901c90505b6000650100000000008416600f0b131561133a5760807001000000b1721835514b86e6d96efd1bfe8202901c90505b60006480000000008416600f0b1315611368576080700100000058b90c0b48c6be5df846c5b2ef8202901c90505b60006440000000008416600f0b131561139657608070010000002c5c8601cc6b9e94213c72737a8202901c90505b60006420000000008416600f0b13156113c45760807001000000162e42fff037df38aa2b219f068202901c90505b60006410000000008416600f0b13156113f257608070010000000b17217fba9c739aa5819f44f98202901c90505b60006408000000008416600f0b13156114205760807001000000058b90bfcdee5acd3c1cedc8238202901c90505b60006404000000008416600f0b131561144e576080700100000002c5c85fe31f35a6a30da1be508202901c90505b60006402000000008416600f0b131561147c57608070010000000162e42ff0999ce3541b9fffcf8202901c90505b60006401000000008416600f0b13156114aa576080700100000000b17217f80f4ef5aadda455548202901c90505b600063800000008416600f0b13156114d757608070010000000058b90bfbf8479bd5a81b51ad8202901c90505b600063400000008416600f0b13156115045760807001000000002c5c85fdf84bd62ae30a74cc8202901c90505b600063200000008416600f0b1315611531576080700100000000162e42fefb2fed257559bdaa8202901c90505b600063100000008416600f0b131561155e5760807001000000000b17217f7d5a7716bba4a9ae8202901c90505b600063080000008416600f0b131561158b576080700100000000058b90bfbe9ddbac5e109cce8202901c90505b600063040000008416600f0b13156115b857608070010000000002c5c85fdf4b15de6f17eb0d8202901c90505b600063020000008416600f0b13156115e55760807001000000000162e42fefa494f1478fde058202901c90505b600063010000008416600f0b131561161257608070010000000000b17217f7d20cf927c8e94c8202901c90505b6000628000008416600f0b131561163e5760807001000000000058b90bfbe8f71cb4e4b33d8202901c90505b6000624000008416600f0b131561166a576080700100000000002c5c85fdf477b662b269458202901c90505b6000622000008416600f0b131561169657608070010000000000162e42fefa3ae53369388c8202901c90505b6000621000008416600f0b13156116c2576080700100000000000b17217f7d1d351a389d408202901c90505b6000620800008416600f0b13156116ee57608070010000000000058b90bfbe8e8b2d3d4ede8202901c90505b6000620400008416600f0b131561171a5760807001000000000002c5c85fdf4741bea6e77e8202901c90505b6000620200008416600f0b1315611746576080700100000000000162e42fefa39fe95583c28202901c90505b6000620100008416600f0b13156117725760807001000000000000b17217f7d1cfb72b45e18202901c90505b60006180008416600f0b131561179d576080700100000000000058b90bfbe8e7cc35c3f08202901c90505b60006140008416600f0b13156117c857608070010000000000002c5c85fdf473e242ea388202901c90505b60006120008416600f0b13156117f35760807001000000000000162e42fefa39f02b772c8202901c90505b60006110008416600f0b131561181e57608070010000000000000b17217f7d1cf7d83c1a8202901c90505b60006108008416600f0b13156118495760807001000000000000058b90bfbe8e7bdcbe2e8202901c90505b60006104008416600f0b1315611874576080700100000000000002c5c85fdf473dea871f8202901c90505b60006102008416600f0b131561189f57608070010000000000000162e42fefa39ef44d918202901c90505b60006101008416600f0b13156118ca576080700100000000000000b17217f7d1cf79e9498202901c90505b600060808416600f0b13156118f457608070010000000000000058b90bfbe8e7bce5448202901c90505b600060408416600f0b131561191e5760807001000000000000002c5c85fdf473de6eca8202901c90505b600060208416600f0b1315611948576080700100000000000000162e42fefa39ef366f8202901c90505b600060108416600f0b13156119725760807001000000000000000b17217f7d1cf79afa8202901c90505b600060088416600f0b131561199c576080700100000000000000058b90bfbe8e7bcd6d8202901c90505b600060048416600f0b13156119c657608070010000000000000002c5c85fdf473de6b28202901c90505b600060028416600f0b13156119f05760807001000000000000000162e42fefa39ef3588202901c90505b600060018416600f0b1315611a1a57608070010000000000000000b17217f7d1cf79ab8202901c90505b604083600f0b901d603f03600f0b81901c90506f7fffffffffffffffffffffffffffffff600f0b811115611a4d57600080fd5b809150505b919050565b6000604082600f0b901d9050919050565b600080821415611a7757600080fd5b6000611a838484611c44565b90506f7fffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff161115611ac657600080fd5b8091505092915050565b60007fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b82600f0b1415611b0557600080fd5b816000039050919050565b60006840000000000000000082600f0b12611b2a57600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffc0000000000000000082600f0b1215611b5e5760009050611b84565b611b816080700171547652b82fe1777d0ffda0d23a7d1284600f0b02901d610e57565b90505b919050565b600080821415611b9c5760009050611c3e565b600083600f0b1215611bad57600080fd5b600060406fffffffffffffffffffffffffffffffff841685600f0b02901c90506000608084901c85600f0b02905077ffffffffffffffffffffffffffffffffffffffffffffffff811115611c0057600080fd5b604081901b9050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03811115611c3657600080fd5b818101925050505b92915050565b600080821415611c5357600080fd5b600077ffffffffffffffffffffffffffffffffffffffffffffffff8411611c895782604085901b81611c8157fe5b049050611dde565b600060c09050600060c086901c90506401000000008110611cb257602081901c90506020820191505b620100008110611cca57601081901c90506010820191505b6101008110611ce157600881901c90506008820191505b60108110611cf757600481901c90506004820191505b60048110611d0d57600281901c90506002820191505b60028110611d1c576001820191505b600160bf830360018703901c018260ff0387901b81611d3757fe5b0492506fffffffffffffffffffffffffffffffff831115611d5757600080fd5b6000608086901c8402905060006fffffffffffffffffffffffffffffffff871685029050600060c089901c9050600060408a901b905082811015611d9c576001820391505b8281039050608084901b925082811015611db7576001820391505b8281039050608084901c8214611dc957fe5b888181611dd257fe5b04870196505050505050505b6fffffffffffffffffffffffffffffffff811115611dfb57600080fd5b809150509291505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122022b49d89660af31dd2fcce6f379fdbbed851c314201f1e2bd9a4dfbccbc1fcaa64736f6c634300060c0033496e697469616c206c69717569646974792073686f756c64206265206c6f776572207468616e206d696e696e6720636170000000000000000000000000cd426834d733e5b4bffc89d3f21fa7e16d0bf583000000000000000000000000230a4129f0a93fef2aefd9dfa406df53a3099a0a0000000000000000000000000000000000000000000069e10de76676d08000000000000000000000000000000000000000000000000002a5a058fc295ed00000000000000000000000000000000000000000000000000000000000174876e800

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

000000000000000000000000cd426834d733e5b4bffc89d3f21fa7e16d0bf583000000000000000000000000230a4129f0a93fef2aefd9dfa406df53a3099a0a0000000000000000000000000000000000000000000069e10de76676d08000000000000000000000000000000000000000000000000002a5a058fc295ed00000000000000000000000000000000000000000000000000000000000174876e800

-----Decoded View---------------
Arg [0] : _cash (address): 0xcd426834d733e5b4bffc89d3f21fa7e16d0bf583
Arg [1] : _miner (address): 0x230a4129f0a93fef2aefd9dfa406df53a3099a0a
Arg [2] : _miningCap (uint256): 500000000000000000000000
Arg [3] : _initialLiquidity (uint256): 12500000000000000000000
Arg [4] : _poolWeight (uint256): 100000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000cd426834d733e5b4bffc89d3f21fa7e16d0bf583
Arg [1] : 000000000000000000000000230a4129f0a93fef2aefd9dfa406df53a3099a0a
Arg [2] : 0000000000000000000000000000000000000000000069e10de76676d0800000
Arg [3] : 0000000000000000000000000000000000000000000002a5a058fc295ed00000
Arg [4] : 000000000000000000000000000000000000000000000000000000174876e800


Deployed ByteCode Sourcemap

50429:4037:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;52569:664;;;:::i;:::-;;;;;;;;;;;;;;;;;;;53384:97;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50770:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50505:43;;;:::i;:::-;;;;;;;;;;;;;;;;;;;53946:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50645:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;50724:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50848:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;54340:123;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;54088:246;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;53487:117;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50612:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;52105:458;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50878:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;53610:128;;;:::i;:::-;;;;;;;;;;;;;;;;;;;53744:196;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50553:52;;;:::i;:::-;;;;;;;;;;;;;;;;;;;51756:304;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;50809:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;;53239:139;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;50680:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;52569:664;52620:7;52681:18;52702:15;:13;:15::i;:::-;52681:36;;52724:26;52753:23;:21;:23::i;:::-;52724:52;;52783:19;52887:6;52894:1;52887:8;;52883:101;52899:10;52897:1;:12;52883:101;;;52938:38;52954:21;52973:1;52954:18;:21::i;:::-;52938:11;:15;;:38;;;;:::i;:::-;52924:52;;52911:3;;;;;;;52883:101;;;;53048:29;53080:77;50597:8;53080:54;53115:18;53080:30;53099:10;53080:18;:30::i;:::-;:34;;:54;;;;:::i;:::-;:58;;:77;;;;:::i;:::-;53048:109;;53173:54;53216:10;;53173:38;53189:21;53173:11;:15;;:38;;;;:::i;:::-;:42;;:54;;;;:::i;:::-;53166:61;;;;;;52569:664;:::o;53384:97::-;53437:7;53460:15;53453:22;;53384:97;:::o;50770:34::-;;;:::o;50505:43::-;50540:8;50505:43;:::o;53946:136::-;54018:7;54041:35;54055:20;54069:5;54055:13;:20::i;:::-;54041:9;:13;;:35;;;;:::i;:::-;54034:42;;53946:136;;;:::o;50645:30::-;;;:::o;50724:41::-;;;:::o;50848:25::-;;;;:::o;54340:123::-;54406:6;54428:25;54447:5;54428:18;:25::i;:::-;54421:32;;54340:123;;;:::o;54088:246::-;54155:7;54189:18;54180:5;:27;;54171:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54264:59;54280:42;54296:25;54315:5;54296:18;:25::i;:::-;54280:15;:42::i;:::-;54264:15;:59::i;:::-;54256:68;;54249:75;;54088:246;;;:::o;53487:117::-;53541:7;53564:34;53583:14;53564;:12;:14::i;:::-;:18;;:34;;;;:::i;:::-;53557:41;;53487:117;:::o;50612:28::-;;;:::o;52105:458::-;52170:7;52186:18;52207:20;:18;:20::i;:::-;52186:41;;52234:10;52247:50;52261:35;52276:7;52285:10;;52261:14;:35::i;:::-;52247:13;:50::i;:::-;52234:63;;52304:10;52317:18;52331:3;52317:13;:18::i;:::-;52304:31;;52342:18;52363:31;52378:3;52383:10;52363:14;:31::i;:::-;52342:52;;52408:26;52423:10;52408;:14;;:26;;;;:::i;:::-;52401:33;;;;;;52105:458;;;:::o;50878:25::-;;;;:::o;53610:128::-;53664:7;53687:45;53730:1;53687:38;50597:8;53687:15;:13;:15::i;:::-;:19;;:38;;;;:::i;:::-;:42;;:45;;;;:::i;:::-;53680:52;;53610:128;:::o;53744:196::-;53806:7;53868:66;53888:45;53910:22;53930:1;53910:15;:13;:15::i;:::-;:19;;:22;;;;:::i;:::-;50597:8;53888:21;;:45;;;;:::i;:::-;53868:15;:13;:15::i;:::-;:19;;:66;;;;:::i;:::-;53861:73;;53744:196;:::o;50553:52::-;50597:8;50553:52;:::o;51756:304::-;51835:7;51110:5;51096:19;;:10;:19;;;51088:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;51851:14:::1;51868:26;51886:7;51868:17;:26::i;:::-;51851:43;;51915:6;51901:10;::::0;:20:::1;;;;;;;;;;;51936:4;:13;;;51950:10;51962:6;51936:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;51928:61;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;52006:10;52001:33;;;52018:7;52027:6;52001:33;;;;;;;;;;;;;;;;;;;;;;;;52048:6;52041:13;;;51756:304:::0;;;;:::o;50809:34::-;;;:::o;53239:139::-;51110:5;51096:19;;:10;:19;;;51088:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53321:10:::1;53308;:23;;;;53343:29;53361:10;53343:29;;;;;;;;;;;;;;;;;;53239:139:::0;:::o;50680:39::-;;;:::o;8160:158::-;8218:7;8251:1;8246;:6;;8238:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8309:1;8305;:5;8298:12;;8160:158;;;;:::o;7698:179::-;7756:7;7776:9;7792:1;7788;:5;7776:17;;7817:1;7812;:6;;7804:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7868:1;7861:8;;;7698:179;;;;:::o;8577:220::-;8635:7;8664:1;8659;:6;8655:20;;;8674:1;8667:8;;;;8655:20;8686:9;8702:1;8698;:5;8686:17;;8731:1;8726;8722;:5;;;;;;:10;8714:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8788:1;8781:8;;;8577:220;;;;;:::o;9275:153::-;9333:7;9365:1;9361;:5;9353:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9419:1;9415;:5;;;;;;9408:12;;9275:153;;;;:::o;26151:137::-;26204:6;26233:18;26228:1;:23;;26219:33;;;;;;26279:2;26274:1;:7;;26259:23;;26151:137;;;:::o;37745:6664::-;37794:6;37822:20;37818:1;:24;;;37809:34;;;;;;37872:21;37868:1;:25;;;37864:39;;;37902:1;37895:8;;;;37864:39;37925:14;37942:34;37925:51;;38014:1;37993:18;37989:1;:22;:26;;;37985:99;;;38081:3;38042:35;38033:6;:44;:51;;38024:60;;37985:99;38120:1;38099:18;38095:1;:22;:26;;;38091:99;;;38187:3;38148:35;38139:6;:44;:51;;38130:60;;38091:99;38226:1;38205:18;38201:1;:22;:26;;;38197:99;;;38293:3;38254:35;38245:6;:44;:51;;38236:60;;38197:99;38332:1;38311:18;38307:1;:22;:26;;;38303:99;;;38399:3;38360:35;38351:6;:44;:51;;38342:60;;38303:99;38437:1;38417:17;38413:1;:21;:25;;;38409:98;;;38504:3;38465:35;38456:6;:44;:51;;38447:60;;38409:98;38542:1;38522:17;38518:1;:21;:25;;;38514:98;;;38609:3;38570:35;38561:6;:44;:51;;38552:60;;38514:98;38647:1;38627:17;38623:1;:21;:25;;;38619:98;;;38714:3;38675:35;38666:6;:44;:51;;38657:60;;38619:98;38752:1;38732:17;38728:1;:21;:25;;;38724:98;;;38819:3;38780:35;38771:6;:44;:51;;38762:60;;38724:98;38856:1;38837:16;38833:1;:20;:24;;;38829:97;;;38923:3;38884:35;38875:6;:44;:51;;38866:60;;38829:97;38960:1;38941:16;38937:1;:20;:24;;;38933:97;;;39027:3;38988:35;38979:6;:44;:51;;38970:60;;38933:97;39064:1;39045:16;39041:1;:20;:24;;;39037:97;;;39131:3;39092:35;39083:6;:44;:51;;39074:60;;39037:97;39168:1;39149:16;39145:1;:20;:24;;;39141:97;;;39235:3;39196:35;39187:6;:44;:51;;39178:60;;39141:97;39271:1;39253:15;39249:1;:19;:23;;;39245:96;;;39338:3;39299:35;39290:6;:44;:51;;39281:60;;39245:96;39374:1;39356:15;39352:1;:19;:23;;;39348:96;;;39441:3;39402:35;39393:6;:44;:51;;39384:60;;39348:96;39477:1;39459:15;39455:1;:19;:23;;;39451:96;;;39544:3;39505:35;39496:6;:44;:51;;39487:60;;39451:96;39580:1;39562:15;39558:1;:19;:23;;;39554:96;;;39647:3;39608:35;39599:6;:44;:51;;39590:60;;39554:96;39682:1;39665:14;39661:1;:18;:22;;;39657:95;;;39749:3;39710:35;39701:6;:44;:51;;39692:60;;39657:95;39784:1;39767:14;39763:1;:18;:22;;;39759:95;;;39851:3;39812:35;39803:6;:44;:51;;39794:60;;39759:95;39886:1;39869:14;39865:1;:18;:22;;;39861:95;;;39953:3;39914:35;39905:6;:44;:51;;39896:60;;39861:95;39988:1;39971:14;39967:1;:18;:22;;;39963:95;;;40055:3;40016:35;40007:6;:44;:51;;39998:60;;39963:95;40089:1;40073:13;40069:1;:17;:21;;;40065:94;;;40156:3;40117:35;40108:6;:44;:51;;40099:60;;40065:94;40190:1;40174:13;40170:1;:17;:21;;;40166:94;;;40257:3;40218:35;40209:6;:44;:51;;40200:60;;40166:94;40291:1;40275:13;40271:1;:17;:21;;;40267:94;;;40358:3;40319:35;40310:6;:44;:51;;40301:60;;40267:94;40392:1;40376:13;40372:1;:17;:21;;;40368:94;;;40459:3;40420:35;40411:6;:44;:51;;40402:60;;40368:94;40492:1;40477:12;40473:1;:16;:20;;;40469:93;;;40559:3;40520:35;40511:6;:44;:51;;40502:60;;40469:93;40592:1;40577:12;40573:1;:16;:20;;;40569:93;;;40659:3;40620:35;40611:6;:44;:51;;40602:60;;40569:93;40692:1;40677:12;40673:1;:16;:20;;;40669:93;;;40759:3;40720:35;40711:6;:44;:51;;40702:60;;40669:93;40792:1;40777:12;40773:1;:16;:20;;;40769:93;;;40859:3;40820:35;40811:6;:44;:51;;40802:60;;40769:93;40891:1;40877:11;40873:1;:15;:19;;;40869:92;;;40958:3;40919:35;40910:6;:44;:51;;40901:60;;40869:92;40990:1;40976:11;40972:1;:15;:19;;;40968:92;;;41057:3;41018:35;41009:6;:44;:51;;41000:60;;40968:92;41089:1;41075:11;41071:1;:15;:19;;;41067:92;;;41156:3;41117:35;41108:6;:44;:51;;41099:60;;41067:92;41188:1;41174:11;41170:1;:15;:19;;;41166:92;;;41255:3;41216:35;41207:6;:44;:51;;41198:60;;41166:92;41286:1;41273:10;41269:1;:14;:18;;;41265:91;;;41353:3;41314:35;41305:6;:44;:51;;41296:60;;41265:91;41384:1;41371:10;41367:1;:14;:18;;;41363:91;;;41451:3;41412:35;41403:6;:44;:51;;41394:60;;41363:91;41482:1;41469:10;41465:1;:14;:18;;;41461:91;;;41549:3;41510:35;41501:6;:44;:51;;41492:60;;41461:91;41580:1;41567:10;41563:1;:14;:18;;;41559:91;;;41647:3;41608:35;41599:6;:44;:51;;41590:60;;41559:91;41677:1;41665:9;41661:1;:13;:17;;;41657:90;;;41744:3;41705:35;41696:6;:44;:51;;41687:60;;41657:90;41774:1;41762:9;41758:1;:13;:17;;;41754:90;;;41841:3;41802:35;41793:6;:44;:51;;41784:60;;41754:90;41871:1;41859:9;41855:1;:13;:17;;;41851:90;;;41938:3;41899:35;41890:6;:44;:51;;41881:60;;41851:90;41968:1;41956:9;41952:1;:13;:17;;;41948:90;;;42035:3;41996:35;41987:6;:44;:51;;41978:60;;41948:90;42064:1;42053:8;42049:1;:12;:16;;;42045:89;;;42131:3;42092:35;42083:6;:44;:51;;42074:60;;42045:89;42160:1;42149:8;42145:1;:12;:16;;;42141:89;;;42227:3;42188:35;42179:6;:44;:51;;42170:60;;42141:89;42256:1;42245:8;42241:1;:12;:16;;;42237:89;;;42323:3;42284:35;42275:6;:44;:51;;42266:60;;42237:89;42352:1;42341:8;42337:1;:12;:16;;;42333:89;;;42419:3;42380:35;42371:6;:44;:51;;42362:60;;42333:89;42447:1;42437:7;42433:1;:11;:15;;;42429:88;;;42514:3;42475:35;42466:6;:44;:51;;42457:60;;42429:88;42542:1;42532:7;42528:1;:11;:15;;;42524:88;;;42609:3;42570:35;42561:6;:44;:51;;42552:60;;42524:88;42637:1;42627:7;42623:1;:11;:15;;;42619:88;;;42704:3;42665:35;42656:6;:44;:51;;42647:60;;42619:88;42732:1;42722:7;42718:1;:11;:15;;;42714:88;;;42799:3;42760:35;42751:6;:44;:51;;42742:60;;42714:88;42826:1;42817:6;42813:1;:10;:14;;;42809:87;;;42893:3;42854:35;42845:6;:44;:51;;42836:60;;42809:87;42920:1;42911:6;42907:1;:10;:14;;;42903:87;;;42987:3;42948:35;42939:6;:44;:51;;42930:60;;42903:87;43014:1;43005:6;43001:1;:10;:14;;;42997:87;;;43081:3;43042:35;43033:6;:44;:51;;43024:60;;42997:87;43108:1;43099:6;43095:1;:10;:14;;;43091:87;;;43175:3;43136:35;43127:6;:44;:51;;43118:60;;43091:87;43201:1;43193:5;43189:1;:9;:13;;;43185:86;;;43268:3;43229:35;43220:6;:44;:51;;43211:60;;43185:86;43294:1;43286:5;43282:1;:9;:13;;;43278:86;;;43361:3;43322:35;43313:6;:44;:51;;43304:60;;43278:86;43387:1;43379:5;43375:1;:9;:13;;;43371:86;;;43454:3;43415:35;43406:6;:44;:51;;43397:60;;43371:86;43480:1;43472:5;43468:1;:9;:13;;;43464:86;;;43547:3;43508:35;43499:6;:44;:51;;43490:60;;43464:86;43572:1;43565:4;43561:1;:8;:12;;;43557:85;;;43639:3;43600:35;43591:6;:44;:51;;43582:60;;43557:85;43664:1;43657:4;43653:1;:8;:12;;;43649:85;;;43731:3;43692:35;43683:6;:44;:51;;43674:60;;43649:85;43756:1;43749:4;43745:1;:8;:12;;;43741:85;;;43823:3;43784:35;43775:6;:44;:51;;43766:60;;43741:85;43848:1;43841:4;43837:1;:8;:12;;;43833:85;;;43915:3;43876:35;43867:6;:44;:51;;43858:60;;43833:85;43939:1;43933:3;43929:1;:7;:11;;;43925:84;;;44006:3;43967:35;43958:6;:44;:51;;43949:60;;43925:84;44030:1;44024:3;44020:1;:7;:11;;;44016:84;;;44097:3;44058:35;44049:6;:44;:51;;44040:60;;44016:84;44121:1;44115:3;44111:1;:7;:11;;;44107:84;;;44188:3;44149:35;44140:6;:44;:51;;44131:60;;44107:84;44212:1;44206:3;44202:1;:7;:11;;;44198:84;;;44279:3;44240:35;44231:6;:44;:51;;44222:60;;44198:84;44322:2;44317:1;:7;;;;44311:2;:14;44302:24;;44291:35;;;;;25169:34;44352:19;;44342:6;:29;;44333:39;;;;;;44396:6;44381:22;;;37745:6664;;;;:::o;25822:91::-;25871:5;25904:2;25899:1;:7;;;;25885:22;;25822:91;;;:::o;32648:208::-;32708:6;32737:1;32732;:6;;32723:16;;;;;;32746:14;32763:12;32770:1;32773;32763:5;:12::i;:::-;32746:29;;25169:34;32791:29;;:6;:29;;;;32782:39;;;;;;32843:6;32828:22;;;32648:208;;;;:::o;33024:108::-;33071:6;25012:35;33095:14;;:1;:14;;;;33086:24;;;;;;33125:1;33124:2;;33117:9;;33024:108;;;:::o;44596:271::-;44643:6;44671:20;44667:1;:24;;;44658:34;;;;;;44721:21;44717:1;:25;;;44713:39;;;44751:1;44744:8;;;;44713:39;44781:80;44856:3;44817:35;44812:1;44804:10;;:48;:55;;44781:5;:80::i;:::-;44774:87;;44596:271;;;;:::o;30303:469::-;30362:7;30387:1;30382;:6;30378:20;;;30397:1;30390:8;;;;30378:20;30421:1;30416;:6;;;;30407:16;;;;;;30432:10;30505:2;30465:34;30461:1;:38;30455:1;30446:11;;:54;30445:62;;30432:75;;30514:10;30547:3;30542:1;:8;;30536:1;30527:11;;:24;30514:37;;30575:50;30569:2;:56;;30560:66;;;;;;30640:2;30633:9;;;;;30742:2;30673:66;:71;30660:2;:84;;30651:94;;;;;;30764:2;30759;:7;30752:14;;;;30303:469;;;;;:::o;45181:1257::-;45241:7;45271:1;45266;:6;;45257:16;;;;;;45282:14;45314:50;45309:1;:55;45305:1035;;45394:1;45388:2;45383:1;:7;;45382:13;;;;;;45373:22;;45305:1035;;;45416:11;45430:3;45416:17;;45442:10;45460:3;45455:1;:8;;45442:21;;45482:11;45476:2;:17;45472:48;;45504:2;45497:9;;;;;45515:2;45508:9;;;;45472:48;45538:7;45532:2;:13;45528:44;;45556:2;45549:9;;;;;45567:2;45560:9;;;;45528:44;45590:5;45584:2;:11;45580:40;;45606:1;45599:8;;;;;45616:1;45609:8;;;;45580:40;45638:4;45632:2;:10;45628:39;;45653:1;45646:8;;;;;45663:1;45656:8;;;;45628:39;45685:3;45679:2;:9;45675:38;;45699:1;45692:8;;;;;45709:1;45702:8;;;;45675:38;45731:3;45725:2;:9;45721:23;;45743:1;45736:8;;;;45721:23;45839:1;45832:3;45826;:9;45821:1;45817;:5;:18;;45816:24;45808:3;45802;:9;45797:1;:14;;45796:45;;;;;;45787:54;;45869:34;45859:6;:44;;45850:54;;;;;;45915:10;45943:3;45938:1;:8;;45928:6;:19;45915:32;;45956:10;45983:34;45979:1;:38;45969:6;:49;45956:62;;46029:10;46047:3;46042:1;:8;;46029:21;;46059:10;46077:2;46072:1;:7;;46059:20;;46099:2;46094;:7;46090:20;;;46109:1;46103:7;;;;46090:20;46125:2;46119:8;;;;46184:3;46178:2;:9;;46173:14;;46205:2;46200;:7;46196:20;;;46215:1;46209:7;;;;46196:20;46231:2;46225:8;;;;46301:3;46295:2;:9;;46289:2;:15;46281:24;;;;46331:1;46326:2;:6;;;;;;46316:16;;;;45305:1035;;;;;;;46367:34;46357:6;:44;;46348:54;;;;;;46425:6;46409:23;;;45181:1257;;;;:::o

Swarm Source

ipfs://22b49d89660af31dd2fcce6f379fdbbed851c314201f1e2bd9a4dfbccbc1fcaa
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.