ETH Price: $2,484.40 (-2.99%)

Contract

0xB827b15adA62D78F5cb90243bc4755cf4B9d1B0e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Rewards171330062023-04-26 21:15:47555 days ago1682543747IN
0xB827b15a...f4B9d1B0e
0 ETH0.0040303250.41503996
Claim Admin Fee169971572023-04-07 14:19:11575 days ago1680877151IN
0xB827b15a...f4B9d1B0e
0 ETH0.0011793321.73372778
Set Admin Fee Sh...169672162023-04-03 8:06:47579 days ago1680509207IN
0xB827b15a...f4B9d1B0e
0 ETH0.0004943317.23854223
Withdraw169666022023-04-03 6:01:59579 days ago1680501719IN
0xB827b15a...f4B9d1B0e
0 ETH0.0028493822.83029443
Deposit169628892023-04-02 17:29:11579 days ago1680456551IN
0xB827b15a...f4B9d1B0e
0 ETH0.003628122.07008831
Withdraw169617332023-04-02 13:34:23580 days ago1680442463IN
0xB827b15a...f4B9d1B0e
0 ETH0.0025753919.3692294
Withdraw169617022023-04-02 13:28:11580 days ago1680442091IN
0xB827b15a...f4B9d1B0e
0 ETH0.0035011123.2719117
Withdraw169615992023-04-02 13:07:23580 days ago1680440843IN
0xB827b15a...f4B9d1B0e
0 ETH0.0033910722.50546727
Set Fee Share169581242023-04-02 1:22:23580 days ago1680398543IN
0xB827b15a...f4B9d1B0e
0 ETH0.0005367818.70511742
Withdraw169580122023-04-02 0:59:47580 days ago1680397187IN
0xB827b15a...f4B9d1B0e
0 ETH0.0025844819.30778005
Deposit169502802023-03-31 22:54:35581 days ago1680303275IN
0xB827b15a...f4B9d1B0e
0 ETH0.0033389224.30165715
Withdraw169455642023-03-31 7:00:35582 days ago1680246035IN
0xB827b15a...f4B9d1B0e
0 ETH0.0045872230.37736857
Deposit169449872023-03-31 5:04:23582 days ago1680239063IN
0xB827b15a...f4B9d1B0e
0 ETH0.0040233325.9589863
Deposit169316622023-03-29 8:07:59584 days ago1680077279IN
0xB827b15a...f4B9d1B0e
0 ETH0.0042588727.18231733
Deposit169299752023-03-29 2:27:11584 days ago1680056831IN
0xB827b15a...f4B9d1B0e
0 ETH0.0042185826.37491192
Deposit168611962023-03-19 10:32:47594 days ago1679221967IN
0xB827b15a...f4B9d1B0e
0 ETH0.0018395614.9521483
Claim Rewards168611852023-03-19 10:30:35594 days ago1679221835IN
0xB827b15a...f4B9d1B0e
0 ETH0.001006916.02253671
Withdraw168562682023-03-18 17:57:11594 days ago1679162231IN
0xB827b15a...f4B9d1B0e
0 ETH0.0024829318.5975257
Withdraw168485392023-03-17 15:52:59595 days ago1679068379IN
0xB827b15a...f4B9d1B0e
0 ETH0.0037135326.0361382
Deposit168485132023-03-17 15:47:47595 days ago1679068067IN
0xB827b15a...f4B9d1B0e
0 ETH0.0037768424.09381213
Deposit168449392023-03-17 3:44:11596 days ago1679024651IN
0xB827b15a...f4B9d1B0e
0 ETH0.0025635115.87118871
Withdraw168040112023-03-11 9:40:35602 days ago1678527635IN
0xB827b15a...f4B9d1B0e
0 ETH0.01688883105.31297412
Deposit167690272023-03-06 11:31:11607 days ago1678102271IN
0xB827b15a...f4B9d1B0e
0 ETH0.003389421
Deposit167487182023-03-03 14:57:11610 days ago1677855431IN
0xB827b15a...f4B9d1B0e
0 ETH0.0042740227.30831226
Withdraw167450202023-03-03 2:30:11610 days ago1677810611IN
0xB827b15a...f4B9d1B0e
0 ETH0.0060496840.28531969
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
161900332022-12-15 12:16:11688 days ago1671106571
0xB827b15a...f4B9d1B0e
0.00183544 ETH
161899922022-12-15 12:07:59688 days ago1671106079
0xB827b15a...f4B9d1B0e
0.00183544 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Pool

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2023-03-30
*/

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

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

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

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

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

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

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

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

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

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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");

        (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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

/**
 * @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 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'
        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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

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

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

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

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

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

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

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

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

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

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

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

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

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

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

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

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

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

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`.
        // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`.
        // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`.
        // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a
        // good first aproximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1;
        uint256 x = a;
        if (x >> 128 > 0) {
            x >>= 128;
            result <<= 64;
        }
        if (x >> 64 > 0) {
            x >>= 64;
            result <<= 32;
        }
        if (x >> 32 > 0) {
            x >>= 32;
            result <<= 16;
        }
        if (x >> 16 > 0) {
            x >>= 16;
            result <<= 8;
        }
        if (x >> 8 > 0) {
            x >>= 8;
            result <<= 4;
        }
        if (x >> 4 > 0) {
            x >>= 4;
            result <<= 2;
        }
        if (x >> 2 > 0) {
            result <<= 1;
        }

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

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

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.2._
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
        return uint136(value);
    }

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

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.2._
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }

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

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }

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

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     *
     * _Available since v3.0._
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

/**
 * @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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

contract RewardManager is Ownable {
    using SafeERC20 for ERC20;
    uint256 private constant P = 52;
    uint256 private constant BP = 1e4;
    // Info of each user.
    struct UserInfo {
        // How many LP tokens the user has provided.
        uint256 lpAmount;
        // Reward debt.
        uint256 rewardDebt;
    }
    // Total virtual LP token amount
    uint256 public totalLpAmount;
    // Accumulated rewards per share, shifted left by P bits
    uint256 public accRewardPerShareP;

    // Reward token
    ERC20 public token;
    // Info of each user that stakes virtual LP tokens
    mapping(address => UserInfo) public userInfo;

    // Armin fee share (in BP)
    uint256 public adminFeeShareBP;
    // Unclaimed admin fee amount
    uint256 public adminFeeAmount;

    event Deposit(address indexed user, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);
    event RewardsClaimed(address indexed user, uint256 amount);

    constructor(ERC20 token_) {
        token = token_;
        // Default admin fee is 20%
        adminFeeShareBP = BP / 5;
    }

    function setAdminFeeShare(uint256 _adminFeeShareBP) external onlyOwner {
        require(_adminFeeShareBP <= BP, "RewardManager: too high");
        adminFeeShareBP = _adminFeeShareBP;
    }

    // Add revard to the pool, split admin fee share and update accumulated rewards per share
    function _addRewards(uint256 rewardAmount_) internal {
        if (totalLpAmount > 0) {
            uint256 adminFeeRewards = rewardAmount_ * adminFeeShareBP / BP;
            unchecked {
                rewardAmount_ -= adminFeeRewards;
            }
            accRewardPerShareP += (rewardAmount_ << P) / totalLpAmount;
            adminFeeAmount += adminFeeRewards;
        }
    }

    function claimAdminFee() external onlyOwner {
        if (adminFeeAmount > 0) {
            token.safeTransfer(msg.sender, adminFeeAmount);
            adminFeeAmount = 0;
        }
    }

    // Returns pending rewards for the address
    function pendingReward(address user_) external view returns (uint256)
    {
        UserInfo memory user = userInfo[user_];
        return ((user.lpAmount * accRewardPerShareP) >> P) - user.rewardDebt;
    }

    // Deposit LP amount for the user, updates user reward debt and pays pending rewards
    function _depositLp(address to, uint256 lpAmount) internal {
        UserInfo storage user = userInfo[to];
        uint256 pending;
        uint256 userLpAmount_ = user.lpAmount; // Gas optimization
        if (userLpAmount_ > 0) {
            pending = ((userLpAmount_ * accRewardPerShareP) >> P) - user.rewardDebt;
        }
        totalLpAmount += lpAmount;
        userLpAmount_ += lpAmount;
        user.lpAmount = userLpAmount_;
        user.rewardDebt = (userLpAmount_ * accRewardPerShareP) >> P;
        if (pending > 0) {
            token.safeTransfer(to, pending);
            emit RewardsClaimed(to, pending);
        }
        emit Deposit(to, lpAmount);
    }

    // Withdraws LP amount for the user, updates user reward debt and pays pending rewards
    function _withdrawLp(address from, uint256 lpAmount) internal {
        UserInfo storage user = userInfo[from];
        uint256 userLpAmount_ = user.lpAmount; // Gas optimization
        require(userLpAmount_ >= lpAmount, "RewardManager: not enough amount");
        uint256 pending;
        if (userLpAmount_ > 0) {
            pending = ((userLpAmount_ * accRewardPerShareP) >> P) - user.rewardDebt;
        }
        totalLpAmount -= lpAmount;
        userLpAmount_ -= lpAmount;
        user.lpAmount = userLpAmount_;
        user.rewardDebt = (userLpAmount_ * accRewardPerShareP) >> P;
        if (pending > 0) {
            token.safeTransfer(from, pending);
            emit RewardsClaimed(from, pending);    
        }
        emit Withdraw(from, lpAmount);
    }

    // Claims pending rewards without updating stake balance
    function claimRewards() external {
        UserInfo storage user = userInfo[msg.sender];
        if (user.lpAmount > 0) {
            uint256 rewards = (user.lpAmount * accRewardPerShareP) >> P;
            uint256 pending = rewards - user.rewardDebt;
            if (pending > 0) {
                user.rewardDebt = rewards;
                token.safeTransfer(msg.sender, pending);
                emit RewardsClaimed(msg.sender, pending);
            }
        }
    }
}

// 4AD - D = 4A(x + y) - (D³ / 4xy)
// X - is value of real stable token
// Y - is value of virtual usd

contract Pool is RewardManager {
    using SafeERC20 for ERC20;
    uint256 public a;
    int256 constant public PP = 1e4; // Price Precision
    uint256 private constant BP = 10000; // Basis Points
    uint256 private constant MAX_TOKEN_BALANCE = 2 ** 40; // Max possible token balance
    uint256 public feeShareBP;

    address public router;
    uint256 public tokenBalance;
    uint256 public vUsdBalance;
    uint256 public d;

    uint256 private tokenAmountReduce;
    uint256 private tokenAmountIncrease;

    event SwappedToVUsd(address sender, address token, uint256 amount, uint256 vUsdAmount, uint256 fee);
    event SwappedFromVUsd(address recipient, address token, uint256 vUsdAmount, uint256 amount, uint256 fee);

    constructor(address router_,
        uint256 a_,
        ERC20 token_,
        uint256 feeShareBP_) RewardManager(token_) {
        a = a_;
        router = router_;
        feeShareBP = feeShareBP_;

        uint8 decimals = token_.decimals();
        if (decimals > 3) {
            tokenAmountReduce = 10 ** (decimals - 3);
        }
        if (decimals < 3) {
            tokenAmountIncrease = 10 ** (3 - decimals);
        }
    }

    modifier onlyRouter() {
        require(router == msg.sender, "Pool: caller is not router");
        _;
    }

    function toSystemPrecision(uint256 amount) internal view returns (uint256) {
        if (tokenAmountReduce > 0) {
            return amount / tokenAmountReduce;
        } else if (tokenAmountIncrease > 0) {
            return amount * tokenAmountIncrease;
        }
        return amount;
    }

    function fromSystemPrecision(uint256 amount) internal view returns (uint256) {
        if (tokenAmountReduce > 0) {
            return amount * tokenAmountReduce;
        } else if (tokenAmountIncrease > 0) {
            return amount / tokenAmountIncrease;
        }
        return amount;
    }

    // Calculate price and deposit token according to the amount and price, then add the same amount to the X and to the Y
    function deposit(uint256 amount) external {
        uint256 oldD = d;

        uint256 amountSP = toSystemPrecision(amount);
        require(amountSP > 0, "Pool: too little");
        tokenBalance += amountSP;
        vUsdBalance += amountSP;
        require(tokenBalance < MAX_TOKEN_BALANCE, "Pool: too much");

        token.safeTransferFrom(msg.sender, address(this), amount);

        _updateD();

        if (totalLpAmount == 0 || oldD == 0) {
            // Initial deposit
            _depositLp(msg.sender, d >> 1); // Divide by 2 to have initial LP amount close to deposited token amount
        } else {
            // Consequent deposits, mint LP according to the D increase
            _depositLp(msg.sender, totalLpAmount * (d - oldD) / oldD);
        }
    }

    // Subtract X and Y for that amount, calculate current price and withdraw the token to the user according to the price
    function withdraw(uint256 amountLp) external {
        uint256 totalLpAmount_ = totalLpAmount; // Gas optimization

        _withdrawLp(msg.sender, amountLp);

        // Calculate actual and virtual tokens using burned LP amount share
        // Swap the difference, get total amount to transfer/burn
        uint256 amountSP = _preWithdrawSwap(
            tokenBalance * amountLp / totalLpAmount_, 
            vUsdBalance * amountLp / totalLpAmount_
        );

        // Always equal amounts removed from actual and virtual tokens
        tokenBalance -= amountSP;
        vUsdBalance -= amountSP;
        
        // Update D and transfer tokens to the sender
        _updateD();
        token.safeTransfer(msg.sender, fromSystemPrecision(amountSP));
    }

    // Calculate differentce between actual and virtual token, divide by 2 and swap
    // Return min of resulting actual/virtual token amount
    function _preWithdrawSwap(uint256 amountToken, uint256 amountVUsd) internal view returns (uint256) {
        if (amountToken > amountVUsd) {
            uint256 extraToken;
            // We can use unchecked here because amountToken > amountVUsd
            unchecked {
                extraToken = (amountToken - amountVUsd) >> 1;
            }
            uint256 extraVUsd = vUsdBalance - this.getY(tokenBalance + extraToken);
            unchecked {
                return Math.min(amountToken - extraToken, amountVUsd + extraVUsd);
            }
        } else {
            uint256 extraVUsd;
            // We can use unchecked here because amountVUsd >= amountToken
            unchecked {
                extraVUsd = (amountVUsd - amountToken) >> 1;
            }
            uint256 extraToken = tokenBalance - this.getY(vUsdBalance + extraVUsd);
            unchecked {
                return Math.min(amountVUsd - extraVUsd, amountToken + extraToken);
            }
        }
    }

    // Transfer amount from the user to the bridge, calculate new Y according to new X, and return the difference between old and new value
    function swapToVUsd(address user, uint256 amount) external onlyRouter returns (uint256) {
        uint256 result; // 0 by default
        uint256 fee;
        if (amount > 0) {
            fee = amount * feeShareBP / BP;
            uint256 amountIn = toSystemPrecision(amount - fee);
            // Incorporate rounding dust into the fee
            fee = amount - fromSystemPrecision(amountIn);

            tokenBalance += amountIn;
            uint256 vUsdNewAmount = this.getY(tokenBalance);
            if (vUsdBalance > vUsdNewAmount) {
                result = vUsdBalance - vUsdNewAmount;
            }
            vUsdBalance = vUsdNewAmount;
            token.safeTransferFrom(user, address(this), amount);
            _addRewards(fee);
        }

        emit SwappedToVUsd(user, address(token), amount, result, fee);
        return result;
    }

    // Calculate new X according to new Y, Transfer calculated amount from the bridge to the user, and return the amount
    function swapFromVUsd(address user, uint256 amount) external onlyRouter returns (uint256) {
        uint256 result; // 0 by default
        uint256 fee;
        if (amount > 0) {
            vUsdBalance += amount;
            uint256 newAmount = this.getY(vUsdBalance);
            if (tokenBalance > newAmount) {
                result = fromSystemPrecision(tokenBalance - newAmount);
            } // Otherwise result stays 0
            fee = result * feeShareBP / BP;
            // We can use unchecked here because feeShareBP <= BP
            unchecked {
                result -= fee;
            }
            tokenBalance = newAmount;
            token.safeTransfer(user, result);
            _addRewards(fee);
        }
        emit SwappedFromVUsd(user, address(token), amount, result, fee);
        return result;
    }

    // y = (sqrt(x(4AD³ + x (4A(D - x) - D )²)) + x (4A(D - x) - D ))/8Ax
    function getY(uint256 x) external view returns (uint256) {
        uint256 d_ = d; // Gas optimization
        uint256 a4_ = a << 2;
        uint256 a8_ = a4_ << 1;
        // 4A(D - x) - D
        int256 part1 = int256(a4_) * (int256(d_) - int256(x)) - int256(d_);
        // x * (4AD³ + x(part1²))
        uint256 part2 = x * (a4_ * d_ * d_ * d_ + x * uint256(part1 * part1));
        // (sqrt(part2) + x(part1)) / 8Ax)
        return SafeCast.toUint256(int256(sqrt(part2)) + int256(x) * part1) / (a8_ * x) + 1;// +1 to offset rounding errors
    }

    //     price = (1/2) * ((D³ + 8ADx² - 8Ax³ - 2Dx²) / (4x * sqrt(x(4AD³ + x (4A(D - x) - D )²))))
    function getPrice() external view returns (uint256) {
        uint256 x = tokenBalance;
        uint256 a8_ = a << 3;
        uint256 d_cube_ = d * d * d;

        // 4A(D - x) - D
        int256 p1 = int256(a << 2) * (int256(d) - int256(x)) - int256(d);
        // x * 4AD³ + x(p1²)
        uint256 p2 = x * ((a << 2) * d_cube_ + x * uint256(p1 * p1));
        // D³ + 8ADx² - 8Ax³ - 2Dx²
        int256 p3 = int256(d_cube_) + int256((a << 3) * d * x * x)
            - int256(a8_ * x * x * x) - int256((d << 1) * x * x);
        // 1/2 * p3 / (4x * sqrt(p2))
        return SafeCast.toUint256((PP >> 1) + (PP * p3 / int256((x << 2) * sqrt(p2))));
    }

    function _updateD() private {
        uint256 x = tokenBalance;
        uint256 y = vUsdBalance;
        // a = 8 * Axy(x+y)
        // b = 4 * xy(4A - 1) / 3
        // c = sqrt(a² + b³)
        // D = cbrt(a + c) + cbrt(a - c)
        uint256 xy = x * y;
        uint256 a_ = a;
        // Axy(x+y)
        uint256 p1 = a_ * xy * (x + y);
        // xy(4A - 1) / 3
        uint256 p2 = xy * ((a_ << 2) - 1) / 3;
        // p1² + p2³
        uint256 p3 = sqrt((p1 * p1) + (p2 * p2 * p2));
        unchecked {
            uint256 d_ = cbrt(p1 + p3);
            if (p3 > p1) {
                d_ -= cbrt(p3 - p1);
            } else {
                d_ += cbrt(p1 - p3);
            }
            d = (d_ << 1) + 1; // +1 to offset rounding errors
        }
    }

    function sqrt(uint256 n) internal pure returns (uint256) {unchecked {
        if (n > 0) {
            uint256 x = (n >> 1) + 1;
            uint256 y = (x + n / x) >> 1;
            while (x > y) {
                x = y;
                y = (x + n / x) >> 1;
            }
            return x;
        }
        return 0;
    }}

    function cbrt(uint256 n) internal pure returns (uint256) {unchecked {
        uint256 x = 0;
        for (uint256 y = 1 << 255; y > 0; y >>= 3) {
            x <<= 1;
            uint256 z = 3 * x * (x + 1) + 1;
            if (n / y >= z) {
                n -= y * z;
                x += 1;
            }
        }
        return x;
    }}

    function setFeeShare(uint256 _feeShareBP) external onlyOwner {
        require(_feeShareBP <= BP, "Pool: Too large");
        feeShareBP = _feeShareBP;
    }

    fallback() external payable {
        revert("Unsupported");
    }

    receive() external payable {
        revert("Unsupported");
    }

    //temp method
    function setRouter(address _router) external onlyOwner {
        router = _router;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"router_","type":"address"},{"internalType":"uint256","name":"a_","type":"uint256"},{"internalType":"contract ERC20","name":"token_","type":"address"},{"internalType":"uint256","name":"feeShareBP_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","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":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"vUsdAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SwappedFromVUsd","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vUsdAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SwappedToVUsd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"PP","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"a","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accRewardPerShareP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeeShareBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAdminFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"d","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeShareBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"getY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_adminFeeShareBP","type":"uint256"}],"name":"setAdminFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeShareBP","type":"uint256"}],"name":"setFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapFromVUsd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapToVUsd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLpAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"lpAmount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vUsdBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountLp","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162002122380380620021228339810160408190526200003491620001db565b81620000403362000172565b600380546001600160a01b0319166001600160a01b0383161790556200006a60056127106200023f565b600555506007839055600980546001600160a01b0319166001600160a01b038681169190911790915560088290556040805163313ce56760e01b8152905160009285169163313ce567916004808301926020929190829003018186803b158015620000d457600080fd5b505afa158015620000e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010f919062000262565b905060038160ff1611156200013c576200012b6003826200028e565b6200013890600a620003b3565b600d555b60038160ff1610156200016757620001568160036200028e565b6200016390600a620003b3565b600e555b5050505050620003c4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620001d857600080fd5b50565b60008060008060808587031215620001f257600080fd5b8451620001ff81620001c2565b6020860151604087015191955093506200021981620001c2565b6060959095015193969295505050565b634e487b7160e01b600052601160045260246000fd5b6000826200025d57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156200027557600080fd5b815160ff811681146200028757600080fd5b9392505050565b600060ff821660ff841680821015620002ab57620002ab62000229565b90039392505050565b600181815b80851115620002f5578160001904821115620002d957620002d962000229565b80851615620002e757918102915b93841c9390800290620002b9565b509250929050565b6000826200030e57506001620003ad565b816200031d57506000620003ad565b8160018114620003365760028114620003415762000361565b6001915050620003ad565b60ff84111562000355576200035562000229565b50506001821b620003ad565b5060208310610133831016604e8410600b841016171562000386575081810a620003ad565b620003928383620002b4565b8060001904821115620003a957620003a962000229565b0290505b92915050565b60006200028760ff841683620002fd565b611d4e80620003d46000396000f3fe6080604052600436106101bb5760003560e01c80638a054ac2116100ec578063c0d786551161008a578063f2fde38b11610064578063f2fde38b146104f1578063f40f0f5214610511578063f887ea4014610531578063fc0c546a14610551576101fb565b8063c0d78655146104a6578063e99fee3e146104c6578063eeeac01e146104db576101fb565b80639e1a4d19116100c65780639e1a4d1914610430578063b3cba4a214610446578063b6b55f2514610466578063bed428bf14610486576101fb565b80638a054ac2146103d35780638da5cb5b146103e957806398d5fdca1461041b576101fb565b806352fb8b03116101595780637a23032c116101335780637a23032c146103675780637aba92481461037d5780637f6a92ed1461039d578063845a4697146103b3576101fb565b806352fb8b0314610326578063532d73971461033c578063715018a614610352576101fb565b80632d8fe99a116101955780632d8fe99a146102b95780632e1a7d4d146102db578063372500ab146102fb578063488cb84114610310576101fb565b80630dbe671f146102315780630ec330221461025a5780631959a00214610270576101fb565b366101fb5760405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b60448201526064015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b60448201526064016101f2565b34801561023d57600080fd5b5061024760075481565b6040519081526020015b60405180910390f35b34801561026657600080fd5b50610247600b5481565b34801561027c57600080fd5b506102a461028b366004611a43565b6004602052600090815260409020805460019091015482565b60408051928352602083019190915201610251565b3480156102c557600080fd5b506102d96102d4366004611a5e565b610571565b005b3480156102e757600080fd5b506102d96102f6366004611a5e565b6105d0565b34801561030757600080fd5b506102d9610679565b34801561031c57600080fd5b5061024760055481565b34801561033257600080fd5b5061024760025481565b34801561034857600080fd5b5061024760015481565b34801561035e57600080fd5b506102d961071c565b34801561037357600080fd5b5061024760065481565b34801561038957600080fd5b50610247610398366004611a77565b610730565b3480156103a957600080fd5b5061024760085481565b3480156103bf57600080fd5b506102476103ce366004611a5e565b61091d565b3480156103df57600080fd5b50610247600c5481565b3480156103f557600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610251565b34801561042757600080fd5b506102476109ed565b34801561043c57600080fd5b50610247600a5481565b34801561045257600080fd5b506102d9610461366004611a5e565b610b53565b34801561047257600080fd5b506102d9610481366004611a5e565b610ba4565b34801561049257600080fd5b506102476104a1366004611a77565b610ce0565b3480156104b257600080fd5b506102d96104c1366004611a43565b610ea0565b3480156104d257600080fd5b506102d9610eca565b3480156104e757600080fd5b5061024761271081565b3480156104fd57600080fd5b506102d961050c366004611a43565b610efe565b34801561051d57600080fd5b5061024761052c366004611a43565b610f74565b34801561053d57600080fd5b50600954610403906001600160a01b031681565b34801561055d57600080fd5b50600354610403906001600160a01b031681565b610579610fcd565b6127108111156105cb5760405162461bcd60e51b815260206004820152601760248201527f5265776172644d616e616765723a20746f6f206869676800000000000000000060448201526064016101f2565b600555565b6001546105dd3383611027565b60006106198284600a546105f19190611ab7565b6105fb9190611aec565b8385600b5461060a9190611ab7565b6106149190611aec565b6111a6565b905080600a600082825461062d9190611b00565b9250508190555080600b60008282546106469190611b00565b90915550610654905061130f565b61067433610661836113ef565b6003546001600160a01b03169190611420565b505050565b336000908152600460205260409020805415610719576000603460025483600001546106a59190611ab7565b901c905060008260010154826106bb9190611b00565b9050801561067457600183018290556003546106e1906001600160a01b03163383611420565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a250505b50565b610724610fcd565b61072e6000611483565b565b6009546000906001600160a01b0316331461078d5760405162461bcd60e51b815260206004820152601a60248201527f506f6f6c3a2063616c6c6572206973206e6f7420726f7574657200000000000060448201526064016101f2565b60008083156108b657612710600854856107a79190611ab7565b6107b19190611aec565b905060006107c76107c28387611b00565b6114d3565b90506107d2816113ef565b6107dc9086611b00565b915080600a60008282546107f09190611b17565b9091555050600a5460405163845a469760e01b8152600091309163845a4697916108209160040190815260200190565b60206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108709190611b2f565b905080600b54111561088d5780600b5461088a9190611b00565b93505b600b8190556003546108aa906001600160a01b0316883089611500565b6108b38361153e565b50505b600354604080516001600160a01b0380891682529092166020830152810185905260608101839052608081018290527fa930da1d3f27a25892307dd59cec52dd9b881661a0f20364757f83a0da2f68739060a0015b60405180910390a15090505b92915050565b600c5460075460009190600281901b9060031b838361093c8782611b48565b6109469085611b87565b6109509190611b48565b9050600061095e8280611b87565b6109689088611ab7565b85806109748188611ab7565b61097e9190611ab7565b6109889190611ab7565b6109929190611b17565b61099c9088611ab7565b90506109a88784611ab7565b6109cd6109b5848a611b87565b6109be846115af565b6109c89190611c0c565b611610565b6109d79190611aec565b6109e2906001611b17565b979650505050505050565b600a54600754600c546000929160031b908390610a0a8180611ab7565b610a149190611ab7565b600c54909150600090610a278582611b48565b600754610a37919060021b611b87565b610a419190611b48565b90506000610a4f8280611b87565b610a599086611ab7565b600754610a6a90859060021b611ab7565b610a749190611b17565b610a7e9086611ab7565b9050600085866001600c54901b610a959190611ab7565b610a9f9190611ab7565b8680610aab8189611ab7565b610ab59190611ab7565b610abf9190611ab7565b8788600c546003600754901b610ad59190611ab7565b610adf9190611ab7565b610ae99190611ab7565b610af39087611c0c565b610afd9190611b48565b610b079190611b48565b9050610b48610b15836115af565b610b2390600289901b611ab7565b610b2f83612710611b87565b610b399190611c4d565b6109c89061271060011d611c0c565b965050505050505090565b610b5b610fcd565b612710811115610b9f5760405162461bcd60e51b815260206004820152600f60248201526e506f6f6c3a20546f6f206c6172676560881b60448201526064016101f2565b600855565b600c546000610bb2836114d3565b905060008111610bf75760405162461bcd60e51b815260206004820152601060248201526f506f6f6c3a20746f6f206c6974746c6560801b60448201526064016101f2565b80600a6000828254610c099190611b17565b9250508190555080600b6000828254610c229190611b17565b9091555050600a546501000000000011610c6f5760405162461bcd60e51b815260206004820152600e60248201526d0a0deded87440e8dede40daeac6d60931b60448201526064016101f2565b600354610c87906001600160a01b0316333086611500565b610c8f61130f565b6001541580610c9c575081155b15610cb157610674336001600c54901c611662565b610674338384600c54610cc49190611b00565b600154610cd19190611ab7565b610cdb9190611aec565b611662565b6009546000906001600160a01b03163314610d3d5760405162461bcd60e51b815260206004820152601a60248201527f506f6f6c3a2063616c6c6572206973206e6f7420726f7574657200000000000060448201526064016101f2565b6000808315610e475783600b6000828254610d589190611b17565b9091555050600b5460405163845a469760e01b8152600091309163845a469791610d889160040190815260200190565b60206040518083038186803b158015610da057600080fd5b505afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190611b2f565b905080600a541115610dfd57610dfa81600a54610df59190611b00565b6113ef565b92505b61271060085484610e0e9190611ab7565b610e189190611aec565b600a8290556003549381900393909250610e3c906001600160a01b03168785611420565b610e458261153e565b505b600354604080516001600160a01b0380891682529092166020830152810185905260608101839052608081018290527ffc1df7b9ba72a13350b8a4e0f094e232eebded9edd179950e74a852a0f4051129060a00161090b565b610ea8610fcd565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610ed2610fcd565b6006541561072e57600654600354610ef7916001600160a01b03909116903390611420565b6000600655565b610f06610fcd565b6001600160a01b038116610f6b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101f2565b61071981611483565b6001600160a01b038116600090815260046020908152604080832081518083019092528054808352600190910154928201839052600254919291603491610fbb9190611ab7565b610fc692911c611b00565b9392505050565b6000546001600160a01b0316331461072e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101f2565b6001600160a01b03821660009081526004602052604090208054828110156110915760405162461bcd60e51b815260206004820181905260248201527f5265776172644d616e616765723a206e6f7420656e6f75676820616d6f756e7460448201526064016101f2565b600081156110bc5782600101546034600254846110ae9190611ab7565b6110b992911c611b00565b90505b83600160008282546110ce9190611b00565b909155506110de90508483611b00565b8084556002549092506034906110f49084611ab7565b901c6001840155801561115c57600354611118906001600160a01b03168683611420565b846001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe8260405161115391815260200190565b60405180910390a25b846001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648560405161119791815260200190565b60405180910390a25050505050565b60008183111561126457600a5482840360011c90600090309063845a4697906111d0908590611b17565b6040518263ffffffff1660e01b81526004016111ee91815260200190565b60206040518083038186803b15801561120657600080fd5b505afa15801561121a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123e9190611b2f565b600b5461124b9190611b00565b905061125b828603828601611783565b92505050610917565b600b5483830360011c90600090309063845a469790611284908590611b17565b6040518263ffffffff1660e01b81526004016112a291815260200190565b60206040518083038186803b1580156112ba57600080fd5b505afa1580156112ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f29190611b2f565b600a546112ff9190611b00565b905061125b828503828701611783565b600a54600b5460006113218284611ab7565b60075490915060006113338486611b17565b61133d8484611ab7565b6113479190611ab7565b90506000600361135c6001600286901b611b00565b6113669086611ab7565b6113709190611aec565b905060006113a5826113828180611ab7565b61138c9190611ab7565b6113968580611ab7565b6113a09190611b17565b6115af565b905060006113b4828501611799565b9050838211156113d0576113c9848303611799565b90036113dd565b6113db828503611799565b015b600190811b01600c5550505050505050565b600d546000901561140757600d546109179083611ab7565b600e541561141c57600e546109179083611aec565b5090565b6040516001600160a01b03831660248201526044810182905261067490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117e4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d54600090156114eb57600d546109179083611aec565b600e541561141c57600e546109179083611ab7565b6040516001600160a01b03808516602483015283166044820152606481018290526115389085906323b872dd60e01b9060840161144c565b50505050565b60015415610719576000612710600554836115599190611ab7565b6115639190611aec565b90508082039150600154603483901b61157c9190611aec565b6002600082825461158d9190611b17565b9250508190555080600660008282546115a69190611b17565b90915550505050565b6000811561160857600182811c8101906000908285816115d1576115d1611ad6565b048301901c90505b808211156116015780915060018285816115f5576115f5611ad6565b048301901c90506115d9565b5092915050565b506000919050565b60008082121561141c5760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f73697469766560448201526064016101f2565b6001600160a01b0382166000908152600460205260408120805490919080156116a857826001015460346002548361169a9190611ab7565b6116a592911c611b00565b91505b83600160008282546116ba9190611b17565b909155506116ca90508482611b17565b8084556002549091506034906116e09083611ab7565b901c6001840155811561174857600354611704906001600160a01b03168684611420565b846001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe8360405161173f91815260200190565b60405180910390a25b846001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8560405161119791815260200190565b60008183106117925781610fc6565b5090919050565b600080600160ff1b5b801561160157600191821b91828101830260030201808286816117c7576117c7611ad6565b04106117db57808202850394506001830192505b5060031c6117a2565b6000611839826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118b69092919063ffffffff16565b80519091501561067457808060200190518101906118579190611c7b565b6106745760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f2565b60606118c584846000856118cd565b949350505050565b60608247101561192e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f2565b6001600160a01b0385163b6119855760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f2565b600080866001600160a01b031685876040516119a19190611cc9565b60006040518083038185875af1925050503d80600081146119de576040519150601f19603f3d011682016040523d82523d6000602084013e6119e3565b606091505b50915091506109e2828286606083156119fd575081610fc6565b825115611a0d5782518084602001fd5b8160405162461bcd60e51b81526004016101f29190611ce5565b80356001600160a01b0381168114611a3e57600080fd5b919050565b600060208284031215611a5557600080fd5b610fc682611a27565b600060208284031215611a7057600080fd5b5035919050565b60008060408385031215611a8a57600080fd5b611a9383611a27565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611ad157611ad1611aa1565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611afb57611afb611ad6565b500490565b600082821015611b1257611b12611aa1565b500390565b60008219821115611b2a57611b2a611aa1565b500190565b600060208284031215611b4157600080fd5b5051919050565b60008083128015600160ff1b850184121615611b6657611b66611aa1565b6001600160ff1b0384018313811615611b8157611b81611aa1565b50500390565b60006001600160ff1b0381841382841380821686840486111615611bad57611bad611aa1565b600160ff1b6000871282811687830589121615611bcc57611bcc611aa1565b60008712925087820587128484161615611be857611be8611aa1565b87850587128184161615611bfe57611bfe611aa1565b505050929093029392505050565b600080821280156001600160ff1b0384900385131615611c2e57611c2e611aa1565b600160ff1b8390038412811615611c4757611c47611aa1565b50500190565b600082611c5c57611c5c611ad6565b600160ff1b821460001984141615611c7657611c76611aa1565b500590565b600060208284031215611c8d57600080fd5b81518015158114610fc657600080fd5b60005b83811015611cb8578181015183820152602001611ca0565b838111156115385750506000910152565b60008251611cdb818460208701611c9d565b9190910192915050565b6020815260008251806020840152611d04816040850160208701611c9d565b601f01601f1916919091016040019291505056fea264697066735822122056a7a168ae083911fae79595857cf619da8b9ffccf5be80cee4501982ad336d864736f6c63430008090033000000000000000000000000a314330482f325d38a83b492ef6b006224a3bea90000000000000000000000000000000000000000000000000000000000000014000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000005

Deployed Bytecode

0x6080604052600436106101bb5760003560e01c80638a054ac2116100ec578063c0d786551161008a578063f2fde38b11610064578063f2fde38b146104f1578063f40f0f5214610511578063f887ea4014610531578063fc0c546a14610551576101fb565b8063c0d78655146104a6578063e99fee3e146104c6578063eeeac01e146104db576101fb565b80639e1a4d19116100c65780639e1a4d1914610430578063b3cba4a214610446578063b6b55f2514610466578063bed428bf14610486576101fb565b80638a054ac2146103d35780638da5cb5b146103e957806398d5fdca1461041b576101fb565b806352fb8b03116101595780637a23032c116101335780637a23032c146103675780637aba92481461037d5780637f6a92ed1461039d578063845a4697146103b3576101fb565b806352fb8b0314610326578063532d73971461033c578063715018a614610352576101fb565b80632d8fe99a116101955780632d8fe99a146102b95780632e1a7d4d146102db578063372500ab146102fb578063488cb84114610310576101fb565b80630dbe671f146102315780630ec330221461025a5780631959a00214610270576101fb565b366101fb5760405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b60448201526064015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b60448201526064016101f2565b34801561023d57600080fd5b5061024760075481565b6040519081526020015b60405180910390f35b34801561026657600080fd5b50610247600b5481565b34801561027c57600080fd5b506102a461028b366004611a43565b6004602052600090815260409020805460019091015482565b60408051928352602083019190915201610251565b3480156102c557600080fd5b506102d96102d4366004611a5e565b610571565b005b3480156102e757600080fd5b506102d96102f6366004611a5e565b6105d0565b34801561030757600080fd5b506102d9610679565b34801561031c57600080fd5b5061024760055481565b34801561033257600080fd5b5061024760025481565b34801561034857600080fd5b5061024760015481565b34801561035e57600080fd5b506102d961071c565b34801561037357600080fd5b5061024760065481565b34801561038957600080fd5b50610247610398366004611a77565b610730565b3480156103a957600080fd5b5061024760085481565b3480156103bf57600080fd5b506102476103ce366004611a5e565b61091d565b3480156103df57600080fd5b50610247600c5481565b3480156103f557600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610251565b34801561042757600080fd5b506102476109ed565b34801561043c57600080fd5b50610247600a5481565b34801561045257600080fd5b506102d9610461366004611a5e565b610b53565b34801561047257600080fd5b506102d9610481366004611a5e565b610ba4565b34801561049257600080fd5b506102476104a1366004611a77565b610ce0565b3480156104b257600080fd5b506102d96104c1366004611a43565b610ea0565b3480156104d257600080fd5b506102d9610eca565b3480156104e757600080fd5b5061024761271081565b3480156104fd57600080fd5b506102d961050c366004611a43565b610efe565b34801561051d57600080fd5b5061024761052c366004611a43565b610f74565b34801561053d57600080fd5b50600954610403906001600160a01b031681565b34801561055d57600080fd5b50600354610403906001600160a01b031681565b610579610fcd565b6127108111156105cb5760405162461bcd60e51b815260206004820152601760248201527f5265776172644d616e616765723a20746f6f206869676800000000000000000060448201526064016101f2565b600555565b6001546105dd3383611027565b60006106198284600a546105f19190611ab7565b6105fb9190611aec565b8385600b5461060a9190611ab7565b6106149190611aec565b6111a6565b905080600a600082825461062d9190611b00565b9250508190555080600b60008282546106469190611b00565b90915550610654905061130f565b61067433610661836113ef565b6003546001600160a01b03169190611420565b505050565b336000908152600460205260409020805415610719576000603460025483600001546106a59190611ab7565b901c905060008260010154826106bb9190611b00565b9050801561067457600183018290556003546106e1906001600160a01b03163383611420565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a250505b50565b610724610fcd565b61072e6000611483565b565b6009546000906001600160a01b0316331461078d5760405162461bcd60e51b815260206004820152601a60248201527f506f6f6c3a2063616c6c6572206973206e6f7420726f7574657200000000000060448201526064016101f2565b60008083156108b657612710600854856107a79190611ab7565b6107b19190611aec565b905060006107c76107c28387611b00565b6114d3565b90506107d2816113ef565b6107dc9086611b00565b915080600a60008282546107f09190611b17565b9091555050600a5460405163845a469760e01b8152600091309163845a4697916108209160040190815260200190565b60206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108709190611b2f565b905080600b54111561088d5780600b5461088a9190611b00565b93505b600b8190556003546108aa906001600160a01b0316883089611500565b6108b38361153e565b50505b600354604080516001600160a01b0380891682529092166020830152810185905260608101839052608081018290527fa930da1d3f27a25892307dd59cec52dd9b881661a0f20364757f83a0da2f68739060a0015b60405180910390a15090505b92915050565b600c5460075460009190600281901b9060031b838361093c8782611b48565b6109469085611b87565b6109509190611b48565b9050600061095e8280611b87565b6109689088611ab7565b85806109748188611ab7565b61097e9190611ab7565b6109889190611ab7565b6109929190611b17565b61099c9088611ab7565b90506109a88784611ab7565b6109cd6109b5848a611b87565b6109be846115af565b6109c89190611c0c565b611610565b6109d79190611aec565b6109e2906001611b17565b979650505050505050565b600a54600754600c546000929160031b908390610a0a8180611ab7565b610a149190611ab7565b600c54909150600090610a278582611b48565b600754610a37919060021b611b87565b610a419190611b48565b90506000610a4f8280611b87565b610a599086611ab7565b600754610a6a90859060021b611ab7565b610a749190611b17565b610a7e9086611ab7565b9050600085866001600c54901b610a959190611ab7565b610a9f9190611ab7565b8680610aab8189611ab7565b610ab59190611ab7565b610abf9190611ab7565b8788600c546003600754901b610ad59190611ab7565b610adf9190611ab7565b610ae99190611ab7565b610af39087611c0c565b610afd9190611b48565b610b079190611b48565b9050610b48610b15836115af565b610b2390600289901b611ab7565b610b2f83612710611b87565b610b399190611c4d565b6109c89061271060011d611c0c565b965050505050505090565b610b5b610fcd565b612710811115610b9f5760405162461bcd60e51b815260206004820152600f60248201526e506f6f6c3a20546f6f206c6172676560881b60448201526064016101f2565b600855565b600c546000610bb2836114d3565b905060008111610bf75760405162461bcd60e51b815260206004820152601060248201526f506f6f6c3a20746f6f206c6974746c6560801b60448201526064016101f2565b80600a6000828254610c099190611b17565b9250508190555080600b6000828254610c229190611b17565b9091555050600a546501000000000011610c6f5760405162461bcd60e51b815260206004820152600e60248201526d0a0deded87440e8dede40daeac6d60931b60448201526064016101f2565b600354610c87906001600160a01b0316333086611500565b610c8f61130f565b6001541580610c9c575081155b15610cb157610674336001600c54901c611662565b610674338384600c54610cc49190611b00565b600154610cd19190611ab7565b610cdb9190611aec565b611662565b6009546000906001600160a01b03163314610d3d5760405162461bcd60e51b815260206004820152601a60248201527f506f6f6c3a2063616c6c6572206973206e6f7420726f7574657200000000000060448201526064016101f2565b6000808315610e475783600b6000828254610d589190611b17565b9091555050600b5460405163845a469760e01b8152600091309163845a469791610d889160040190815260200190565b60206040518083038186803b158015610da057600080fd5b505afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190611b2f565b905080600a541115610dfd57610dfa81600a54610df59190611b00565b6113ef565b92505b61271060085484610e0e9190611ab7565b610e189190611aec565b600a8290556003549381900393909250610e3c906001600160a01b03168785611420565b610e458261153e565b505b600354604080516001600160a01b0380891682529092166020830152810185905260608101839052608081018290527ffc1df7b9ba72a13350b8a4e0f094e232eebded9edd179950e74a852a0f4051129060a00161090b565b610ea8610fcd565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610ed2610fcd565b6006541561072e57600654600354610ef7916001600160a01b03909116903390611420565b6000600655565b610f06610fcd565b6001600160a01b038116610f6b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101f2565b61071981611483565b6001600160a01b038116600090815260046020908152604080832081518083019092528054808352600190910154928201839052600254919291603491610fbb9190611ab7565b610fc692911c611b00565b9392505050565b6000546001600160a01b0316331461072e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101f2565b6001600160a01b03821660009081526004602052604090208054828110156110915760405162461bcd60e51b815260206004820181905260248201527f5265776172644d616e616765723a206e6f7420656e6f75676820616d6f756e7460448201526064016101f2565b600081156110bc5782600101546034600254846110ae9190611ab7565b6110b992911c611b00565b90505b83600160008282546110ce9190611b00565b909155506110de90508483611b00565b8084556002549092506034906110f49084611ab7565b901c6001840155801561115c57600354611118906001600160a01b03168683611420565b846001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe8260405161115391815260200190565b60405180910390a25b846001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648560405161119791815260200190565b60405180910390a25050505050565b60008183111561126457600a5482840360011c90600090309063845a4697906111d0908590611b17565b6040518263ffffffff1660e01b81526004016111ee91815260200190565b60206040518083038186803b15801561120657600080fd5b505afa15801561121a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123e9190611b2f565b600b5461124b9190611b00565b905061125b828603828601611783565b92505050610917565b600b5483830360011c90600090309063845a469790611284908590611b17565b6040518263ffffffff1660e01b81526004016112a291815260200190565b60206040518083038186803b1580156112ba57600080fd5b505afa1580156112ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f29190611b2f565b600a546112ff9190611b00565b905061125b828503828701611783565b600a54600b5460006113218284611ab7565b60075490915060006113338486611b17565b61133d8484611ab7565b6113479190611ab7565b90506000600361135c6001600286901b611b00565b6113669086611ab7565b6113709190611aec565b905060006113a5826113828180611ab7565b61138c9190611ab7565b6113968580611ab7565b6113a09190611b17565b6115af565b905060006113b4828501611799565b9050838211156113d0576113c9848303611799565b90036113dd565b6113db828503611799565b015b600190811b01600c5550505050505050565b600d546000901561140757600d546109179083611ab7565b600e541561141c57600e546109179083611aec565b5090565b6040516001600160a01b03831660248201526044810182905261067490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117e4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d54600090156114eb57600d546109179083611aec565b600e541561141c57600e546109179083611ab7565b6040516001600160a01b03808516602483015283166044820152606481018290526115389085906323b872dd60e01b9060840161144c565b50505050565b60015415610719576000612710600554836115599190611ab7565b6115639190611aec565b90508082039150600154603483901b61157c9190611aec565b6002600082825461158d9190611b17565b9250508190555080600660008282546115a69190611b17565b90915550505050565b6000811561160857600182811c8101906000908285816115d1576115d1611ad6565b048301901c90505b808211156116015780915060018285816115f5576115f5611ad6565b048301901c90506115d9565b5092915050565b506000919050565b60008082121561141c5760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f73697469766560448201526064016101f2565b6001600160a01b0382166000908152600460205260408120805490919080156116a857826001015460346002548361169a9190611ab7565b6116a592911c611b00565b91505b83600160008282546116ba9190611b17565b909155506116ca90508482611b17565b8084556002549091506034906116e09083611ab7565b901c6001840155811561174857600354611704906001600160a01b03168684611420565b846001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe8360405161173f91815260200190565b60405180910390a25b846001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8560405161119791815260200190565b60008183106117925781610fc6565b5090919050565b600080600160ff1b5b801561160157600191821b91828101830260030201808286816117c7576117c7611ad6565b04106117db57808202850394506001830192505b5060031c6117a2565b6000611839826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118b69092919063ffffffff16565b80519091501561067457808060200190518101906118579190611c7b565b6106745760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f2565b60606118c584846000856118cd565b949350505050565b60608247101561192e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f2565b6001600160a01b0385163b6119855760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f2565b600080866001600160a01b031685876040516119a19190611cc9565b60006040518083038185875af1925050503d80600081146119de576040519150601f19603f3d011682016040523d82523d6000602084013e6119e3565b606091505b50915091506109e2828286606083156119fd575081610fc6565b825115611a0d5782518084602001fd5b8160405162461bcd60e51b81526004016101f29190611ce5565b80356001600160a01b0381168114611a3e57600080fd5b919050565b600060208284031215611a5557600080fd5b610fc682611a27565b600060208284031215611a7057600080fd5b5035919050565b60008060408385031215611a8a57600080fd5b611a9383611a27565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611ad157611ad1611aa1565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611afb57611afb611ad6565b500490565b600082821015611b1257611b12611aa1565b500390565b60008219821115611b2a57611b2a611aa1565b500190565b600060208284031215611b4157600080fd5b5051919050565b60008083128015600160ff1b850184121615611b6657611b66611aa1565b6001600160ff1b0384018313811615611b8157611b81611aa1565b50500390565b60006001600160ff1b0381841382841380821686840486111615611bad57611bad611aa1565b600160ff1b6000871282811687830589121615611bcc57611bcc611aa1565b60008712925087820587128484161615611be857611be8611aa1565b87850587128184161615611bfe57611bfe611aa1565b505050929093029392505050565b600080821280156001600160ff1b0384900385131615611c2e57611c2e611aa1565b600160ff1b8390038412811615611c4757611c47611aa1565b50500190565b600082611c5c57611c5c611ad6565b600160ff1b821460001984141615611c7657611c76611aa1565b500590565b600060208284031215611c8d57600080fd5b81518015158114610fc657600080fd5b60005b83811015611cb8578181015183820152602001611ca0565b838111156115385750506000910152565b60008251611cdb818460208701611c9d565b9190910192915050565b6020815260008251806020840152611d04816040850160208701611c9d565b601f01601f1916919091016040019291505056fea264697066735822122056a7a168ae083911fae79595857cf619da8b9ffccf5be80cee4501982ad336d864736f6c63430008090033

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

000000000000000000000000a314330482f325d38a83b492ef6b006224a3bea90000000000000000000000000000000000000000000000000000000000000014000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000005

-----Decoded View---------------
Arg [0] : router_ (address): 0xA314330482f325D38A83B492EF6B006224a3bea9
Arg [1] : a_ (uint256): 20
Arg [2] : token_ (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [3] : feeShareBP_ (uint256): 5

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a314330482f325d38a83b492ef6b006224a3bea9
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000005


Deployed Bytecode Sourcemap

84357:10348:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;94556:21;;-1:-1:-1;;;94556:21:0;;216:2:1;94556:21:0;;;198::1;255:2;235:18;;;228:30;-1:-1:-1;;;274:18:1;;;267:41;325:18;;94556:21:0;;;;;;;;84357:10348;94481:21;;-1:-1:-1;;;94481:21:0;;216:2:1;94481:21:0;;;198::1;255:2;235:18;;;228:30;-1:-1:-1;;;274:18:1;;;267:41;325:18;;94481:21:0;14:335:1;84427:16:0;;;;;;;;;;;;;;;;;;;500:25:1;;;488:2;473:18;84427:16:0;;;;;;;;84750:26;;;;;;;;;;;;;;;;80338:44;;;;;;;;;;-1:-1:-1;80338:44:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;1079:25:1;;;1135:2;1120:18;;1113:34;;;;1052:18;80338:44:0;905:248:1;80856:193:0;;;;;;;;;;-1:-1:-1;80856:193:0;;;;;:::i;:::-;;:::i;:::-;;87358:782;;;;;;;;;;-1:-1:-1;87358:782:0;;;;;:::i;:::-;;:::i;83759:481::-;;;;;;;;;;;;;:::i;80423:30::-;;;;;;;;;;;;;;;;80194:33;;;;;;;;;;;;;;;;80097:28;;;;;;;;;;;;;;;;78899:103;;;;;;;;;;;;;:::i;80495:29::-;;;;;;;;;;;;;;;;89458:879;;;;;;;;;;-1:-1:-1;89458:879:0;;;;;:::i;:::-;;:::i;84654:25::-;;;;;;;;;;;;;;;;91404:562;;;;;;;;;;-1:-1:-1;91404:562:0;;;;;:::i;:::-;;:::i;84783:16::-;;;;;;;;;;;;;;;;78251:87;;;;;;;;;;-1:-1:-1;78297:7:0;78324:6;-1:-1:-1;;;;;78324:6:0;78251:87;;;-1:-1:-1;;;;;1766:32:1;;;1748:51;;1736:2;1721:18;78251:87:0;1602:203:1;92082:674:0;;;;;;;;;;;;;:::i;84716:27::-;;;;;;;;;;;;;;;;94274:160;;;;;;;;;;-1:-1:-1;94274:160:0;;;;;:::i;:::-;;:::i;86434:792::-;;;;;;;;;;-1:-1:-1;86434:792:0;;;;;:::i;:::-;;:::i;90467:852::-;;;;;;;;;;-1:-1:-1;90467:852:0;;;;;:::i;:::-;;:::i;94612:90::-;;;;;;;;;;-1:-1:-1;94612:90:0;;;;;:::i;:::-;;:::i;81555:192::-;;;;;;;;;;;;;:::i;84450:31::-;;;;;;;;;;;;84478:3;84450:31;;79157:201;;;;;;;;;;-1:-1:-1;79157:201:0;;;;;:::i;:::-;;:::i;81803:211::-;;;;;;;;;;-1:-1:-1;81803:211:0;;;;;:::i;:::-;;:::i;84688:21::-;;;;;;;;;;-1:-1:-1;84688:21:0;;;;-1:-1:-1;;;;;84688:21:0;;;80257:18;;;;;;;;;;-1:-1:-1;80257:18:0;;;;-1:-1:-1;;;;;80257:18:0;;;80856:193;78137:13;:11;:13::i;:::-;79857:3:::1;80946:16;:22;;80938:58;;;::::0;-1:-1:-1;;;80938:58:0;;2413:2:1;80938:58:0::1;::::0;::::1;2395:21:1::0;2452:2;2432:18;;;2425:30;2491:25;2471:18;;;2464:53;2534:18;;80938:58:0::1;2211:347:1::0;80938:58:0::1;81007:15;:34:::0;80856:193::o;87358:782::-;87439:13;;87485:33;87497:10;87509:8;87485:11;:33::i;:::-;87675:16;87694:137;87751:14;87740:8;87725:12;;:23;;;;:::i;:::-;:40;;;;:::i;:::-;87806:14;87795:8;87781:11;;:22;;;;:::i;:::-;:39;;;;:::i;:::-;87694:16;:137::i;:::-;87675:156;;87932:8;87916:12;;:24;;;;;;;:::i;:::-;;;;;;;;87966:8;87951:11;;:23;;;;;;;:::i;:::-;;;;-1:-1:-1;88050:10:0;;-1:-1:-1;88050:8:0;:10::i;:::-;88071:61;88090:10;88102:29;88122:8;88102:19;:29::i;:::-;88071:5;;-1:-1:-1;;;;;88071:5:0;;:61;:18;:61::i;:::-;87403:737;;87358:782;:::o;83759:481::-;83836:10;83803:21;83827:20;;;:8;:20;;;;;83862:13;;:17;83858:375;;83896:15;79818:2;83931:18;;83915:4;:13;;;:34;;;;:::i;:::-;83914:41;;83896:59;;83970:15;83998:4;:15;;;83988:7;:25;;;;:::i;:::-;83970:43;-1:-1:-1;84032:11:0;;84028:194;;84064:15;;;:25;;;84108:5;;:39;;-1:-1:-1;;;;;84108:5:0;84127:10;84139:7;84108:18;:39::i;:::-;84171:35;;500:25:1;;;84186:10:0;;84171:35;;488:2:1;473:18;84171:35:0;;;;;;;83881:352;;83858:375;83792:448;83759:481::o;78899:103::-;78137:13;:11;:13::i;:::-;78964:30:::1;78991:1;78964:18;:30::i;:::-;78899:103::o:0;89458:879::-;85611:6;;89537:7;;-1:-1:-1;;;;;85611:6:0;85621:10;85611:20;85603:59;;;;-1:-1:-1;;;85603:59:0;;3457:2:1;85603:59:0;;;3439:21:1;3496:2;3476:18;;;3469:30;3535:28;3515:18;;;3508:56;3581:18;;85603:59:0;3255:350:1;85603:59:0;89557:14:::1;::::0;89624:10;;89620:612:::1;;84537:5;89666:10;;89657:6;:19;;;;:::i;:::-;:24;;;;:::i;:::-;89651:30:::0;-1:-1:-1;89696:16:0::1;89715:31;89733:12;89651:30:::0;89733:6;:12:::1;:::i;:::-;89715:17;:31::i;:::-;89696:50;;89831:29;89851:8;89831:19;:29::i;:::-;89822:38;::::0;:6;:38:::1;:::i;:::-;89816:44;;89893:8;89877:12;;:24;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;89950:12:0::1;::::0;89940:23:::1;::::0;-1:-1:-1;;;89940:23:0;;89916:21:::1;::::0;89940:4:::1;::::0;:9:::1;::::0;:23:::1;::::0;::::1;;500:25:1::0;;;488:2;473:18;;354:177;89940:23:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;89916:47;;89996:13;89982:11;;:27;89978:104;;;90053:13;90039:11;;:27;;;;:::i;:::-;90030:36;;89978:104;90096:11;:27:::0;;;90138:5:::1;::::0;:51:::1;::::0;-1:-1:-1;;;;;90138:5:0::1;90161:4:::0;90175::::1;90182:6:::0;90138:22:::1;:51::i;:::-;90204:16;90216:3;90204:11;:16::i;:::-;89636:596;;89620:612;90277:5;::::0;90249:56:::1;::::0;;-1:-1:-1;;;;;4247:15:1;;;4229:34;;90277:5:0;;::::1;4294:2:1::0;4279:18;;4272:43;4331:18;;4324:34;;;4389:2;4374:18;;4367:34;;;4432:3;4417:19;;4410:35;;;90249:56:0::1;::::0;4178:3:1;4163:19;90249:56:0::1;;;;;;;;-1:-1:-1::0;90323:6:0;-1:-1:-1;85673:1:0::1;89458:879:::0;;;;:::o;91404:562::-;91485:1;;91531;;91452:7;;91485:1;91536;91531:6;;;;91562:8;;91452:7;91485:1;91637:22;91657:1;91485;91637:22;:::i;:::-;91622:38;;91629:3;91622:38;:::i;:::-;:51;;;;:::i;:::-;91607:66;-1:-1:-1;91721:13:0;91775;91607:66;;91775:13;:::i;:::-;91763:26;;:1;:26;:::i;:::-;91758:2;;91742:8;91758:2;91742:3;:8;:::i;:::-;:13;;;;:::i;:::-;:18;;;;:::i;:::-;:47;;;;:::i;:::-;91737:53;;:1;:53;:::i;:::-;91721:69;-1:-1:-1;91915:7:0;91921:1;91915:3;:7;:::i;:::-;91852:59;91893:17;91905:5;91900:1;91893:17;:::i;:::-;91878:11;91883:5;91878:4;:11::i;:::-;91871:39;;;;:::i;:::-;91852:18;:59::i;:::-;:71;;;;:::i;:::-;:75;;91926:1;91852:75;:::i;:::-;91845:82;91404:562;-1:-1:-1;;;;;;;91404:562:0:o;92082:674::-;92157:12;;92194:1;;92237;;92125:7;;92157:12;92199:1;92194:6;;92125:7;;92229:5;92237:1;;92229:5;:::i;:::-;:9;;;;:::i;:::-;92339:1;;92211:27;;-1:-1:-1;92277:9:0;;92307:21;92326:1;92339;92307:21;:::i;:::-;92296:1;;92289:40;;;92301:1;92296:6;92289:40;:::i;:::-;:52;;;;:::i;:::-;92277:64;-1:-1:-1;92384:10:0;92435:7;92277:64;;92435:7;:::i;:::-;92423:20;;:1;:20;:::i;:::-;92403:1;;92402:18;;92413:7;;92408:1;92403:6;92402:18;:::i;:::-;:41;;;;:::i;:::-;92397:47;;:1;:47;:::i;:::-;92384:60;;92496:9;92618:1;92614;92609;92604;;:6;;92603:12;;;;:::i;:::-;:16;;;;:::i;:::-;92591:1;;92577:7;92591:1;92577:3;:7;:::i;:::-;:11;;;;:::i;:::-;:15;;;;:::i;:::-;92552:1;92548;92544;;92539;92534;;:6;;92533:12;;;;:::i;:::-;:16;;;;:::i;:::-;:20;;;;:::i;:::-;92508:46;;92515:7;92508:46;:::i;:::-;:85;;;;:::i;:::-;:112;;;;:::i;:::-;92496:124;;92677:71;92737:8;92742:2;92737:4;:8::i;:::-;92726:19;;92732:1;92727:6;;;92726:19;:::i;:::-;92709:7;92714:2;84478:3;92709:7;:::i;:::-;:37;;;;:::i;:::-;92696:51;;84478:3;92703:1;92697:7;92696:51;:::i;92677:71::-;92670:78;;;;;;;;92082:674;:::o;94274:160::-;78137:13;:11;:13::i;:::-;84537:5:::1;94354:11;:17;;94346:45;;;::::0;-1:-1:-1;;;94346:45:0;;5956:2:1;94346:45:0::1;::::0;::::1;5938:21:1::0;5995:2;5975:18;;;5968:30;-1:-1:-1;;;6014:18:1;;;6007:45;6069:18;;94346:45:0::1;5754:339:1::0;94346:45:0::1;94402:10;:24:::0;94274:160::o;86434:792::-;86502:1;;86487:12;86535:25;86553:6;86535:17;:25::i;:::-;86516:44;;86590:1;86579:8;:12;86571:41;;;;-1:-1:-1;;;86571:41:0;;6300:2:1;86571:41:0;;;6282:21:1;6339:2;6319:18;;;6312:30;-1:-1:-1;;;6358:18:1;;;6351:46;6414:18;;86571:41:0;6098:340:1;86571:41:0;86639:8;86623:12;;:24;;;;;;;:::i;:::-;;;;;;;;86673:8;86658:11;;:23;;;;;;;:::i;:::-;;;;-1:-1:-1;;86700:12:0;;84610:7;-1:-1:-1;86692:59:0;;;;-1:-1:-1;;;86692:59:0;;6645:2:1;86692:59:0;;;6627:21:1;6684:2;6664:18;;;6657:30;-1:-1:-1;;;6703:18:1;;;6696:44;6757:18;;86692:59:0;6443:338:1;86692:59:0;86764:5;;:57;;-1:-1:-1;;;;;86764:5:0;86787:10;86807:4;86814:6;86764:22;:57::i;:::-;86834:10;:8;:10::i;:::-;86861:13;;:18;;:31;;-1:-1:-1;86883:9:0;;86861:31;86857:362;;;86941:30;86952:10;86969:1;86964;;:6;;86941:10;:30::i;86857:362::-;87150:57;87161:10;87202:4;87194;87190:1;;:8;;;;:::i;:::-;87173:13;;:26;;;;:::i;:::-;:33;;;;:::i;:::-;87150:10;:57::i;90467:852::-;85611:6;;90548:7;;-1:-1:-1;;;;;85611:6:0;85621:10;85611:20;85603:59;;;;-1:-1:-1;;;85603:59:0;;3457:2:1;85603:59:0;;;3439:21:1;3496:2;3476:18;;;3469:30;3535:28;3515:18;;;3508:56;3581:18;;85603:59:0;3255:350:1;85603:59:0;90568:14:::1;::::0;90635:10;;90631:583:::1;;90677:6;90662:11;;:21;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;90728:11:0::1;::::0;90718:22:::1;::::0;-1:-1:-1;;;90718:22:0;;90698:17:::1;::::0;90718:4:::1;::::0;:9:::1;::::0;:22:::1;::::0;::::1;;500:25:1::0;;;488:2;473:18;;354:177;90718:22:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;90698:42;;90774:9;90759:12;;:24;90755:119;;;90813:45;90848:9;90833:12;;:24;;;;:::i;:::-;90813:19;:45::i;:::-;90804:54;;90755:119;84537:5;90931:10;;90922:6;:19;;;;:::i;:::-;:24;;;;:::i;:::-;91100:12;:24:::0;;;91139:5:::1;::::0;91057:13;;;::::1;::::0;90916:30;;-1:-1:-1;91139:32:0::1;::::0;-1:-1:-1;;;;;91139:5:0::1;91158:4:::0;91057:13;91139:18:::1;:32::i;:::-;91186:16;91198:3;91186:11;:16::i;:::-;90647:567;90631:583;91259:5;::::0;91229:58:::1;::::0;;-1:-1:-1;;;;;4247:15:1;;;4229:34;;91259:5:0;;::::1;4294:2:1::0;4279:18;;4272:43;4331:18;;4324:34;;;4389:2;4374:18;;4367:34;;;4432:3;4417:19;;4410:35;;;91229:58:0::1;::::0;4178:3:1;4163:19;91229:58:0::1;3932:519:1::0;94612:90:0;78137:13;:11;:13::i;:::-;94678:6:::1;:16:::0;;-1:-1:-1;;;;;;94678:16:0::1;-1:-1:-1::0;;;;;94678:16:0;;;::::1;::::0;;;::::1;::::0;;94612:90::o;81555:192::-;78137:13;:11;:13::i;:::-;81614:14:::1;::::0;:18;81610:130:::1;;81680:14;::::0;81649:5:::1;::::0;:46:::1;::::0;-1:-1:-1;;;;;81649:5:0;;::::1;::::0;81668:10:::1;::::0;81649:18:::1;:46::i;:::-;81727:1;81710:14;:18:::0;81555:192::o;79157:201::-;78137:13;:11;:13::i;:::-;-1:-1:-1;;;;;79246:22:0;::::1;79238:73;;;::::0;-1:-1:-1;;;79238:73:0;;6988:2:1;79238:73:0::1;::::0;::::1;6970:21:1::0;7027:2;7007:18;;;7000:30;7066:34;7046:18;;;7039:62;-1:-1:-1;;;7117:18:1;;;7110:36;7163:19;;79238:73:0::1;6786:402:1::0;79238:73:0::1;79322:28;79341:8;79322:18;:28::i;81803:211::-:0;-1:-1:-1;;;;;81912:15:0;;81864:7;81912:15;;;:8;:15;;;;;;;;81889:38;;;;;;;;;;;;;;;;;;;;;;;;81963:18;;81889:38;;;79818:2;;81947:34;;81963:18;81947:34;:::i;:::-;81945:61;;;81946:41;81945:61;:::i;:::-;81938:68;81803:211;-1:-1:-1;;;81803:211:0:o;78416:132::-;78297:7;78324:6;-1:-1:-1;;;;;78324:6:0;3941:10;78480:23;78472:68;;;;-1:-1:-1;;;78472:68:0;;7395:2:1;78472:68:0;;;7377:21:1;;;7414:18;;;7407:30;7473:34;7453:18;;;7446:62;7525:18;;78472:68:0;7193:356:1;82902:787:0;-1:-1:-1;;;;;82999:14:0;;82975:21;82999:14;;;:8;:14;;;;;83048:13;;83100:25;;;;83092:70;;;;-1:-1:-1;;;83092:70:0;;7756:2:1;83092:70:0;;;7738:21:1;;;7775:18;;;7768:30;7834:34;7814:18;;;7807:62;7886:18;;83092:70:0;7554:356:1;83092:70:0;83173:15;83203:17;;83199:121;;83293:4;:15;;;79818:2;83265:18;;83249:13;:34;;;;:::i;:::-;83247:61;;;83248:41;83247:61;:::i;:::-;83237:71;;83199:121;83347:8;83330:13;;:25;;;;;;;:::i;:::-;;;;-1:-1:-1;83366:25:0;;-1:-1:-1;83383:8:0;83366:25;;:::i;:::-;83402:29;;;83477:18;;83366:25;;-1:-1:-1;79818:2:0;;83461:34;;83366:25;83461:34;:::i;:::-;83460:41;;83442:15;;;:59;83516:11;;83512:130;;83544:5;;:33;;-1:-1:-1;;;;;83544:5:0;83563:4;83569:7;83544:18;:33::i;:::-;83612:4;-1:-1:-1;;;;;83597:29:0;;83618:7;83597:29;;;;500:25:1;;488:2;473:18;;354:177;83597:29:0;;;;;;;;83512:130;83666:4;-1:-1:-1;;;;;83657:24:0;;83672:8;83657:24;;;;500:25:1;;488:2;473:18;;354:177;83657:24:0;;;;;;;;82964:725;;;82902:787;;:::o;88293:1016::-;88383:7;88421:10;88407:11;:24;88403:899;;;88703:12;;88599:24;;;88628:1;88598:31;;88448:18;;88693:4;;:9;;88703:25;;88598:31;;88703:25;:::i;:::-;88693:36;;;;;;;;;;;;;500:25:1;;488:2;473:18;;354:177;88693:36:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;88679:11;;:50;;;;:::i;:::-;88659:70;;88780:58;88803:10;88789:11;:24;88828:9;88815:10;:22;88780:8;:58::i;:::-;88773:65;;;;;;88403:899;89142:11;;89036:24;;;89065:1;89035:31;;88886:17;;89132:4;;:9;;89142:23;;89035:31;;89142:23;:::i;:::-;89132:34;;;;;;;;;;;;;500:25:1;;488:2;473:18;;354:177;89132:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;89117:12;;:49;;;;:::i;:::-;89096:70;;89217:58;89239:9;89226:10;:22;89264:10;89250:11;:24;89217:8;:58::i;92764:792::-;92815:12;;92850:11;;92803:9;93023:5;92850:11;92815:12;93023:5;:::i;:::-;93052:1;;93010:18;;-1:-1:-1;93039:10:0;93109:5;93113:1;93109;:5;:::i;:::-;93098:7;93103:2;93098;:7;:::i;:::-;:17;;;;:::i;:::-;93085:30;-1:-1:-1;93153:10:0;93189:1;93172:13;93184:1;93179;93173:7;;;93172:13;:::i;:::-;93166:20;;:2;:20;:::i;:::-;:24;;;;:::i;:::-;93153:37;-1:-1:-1;93225:10:0;93238:32;93153:37;93256:7;93153:37;;93256:7;:::i;:::-;:12;;;;:::i;:::-;93244:7;93249:2;;93244:7;:::i;:::-;93243:26;;;;:::i;:::-;93238:4;:32::i;:::-;93225:45;;93306:10;93319:13;93329:2;93324;:7;93319:4;:13::i;:::-;93306:26;;93356:2;93351;:7;93347:127;;;93385:13;93395:2;93390;:7;93385:4;:13::i;:::-;93379:19;;93347:127;;;93445:13;93455:2;93450;:7;93445:4;:13::i;:::-;93439:19;93347:127;93499:1;93493:7;;;93492:13;93488:1;:17;-1:-1:-1;;;;;;;92764:792:0:o;85999:303::-;86091:17;;86067:7;;86091:21;86087:184;;86145:17;;86136:26;;:6;:26;:::i;86087:184::-;86184:19;;:23;86180:91;;86240:19;;86231:28;;:6;:28;:::i;86180:91::-;-1:-1:-1;86288:6:0;85999:303::o;27934:211::-;28078:58;;-1:-1:-1;;;;;8107:32:1;;28078:58:0;;;8089:51:1;8156:18;;;8149:34;;;28051:86:0;;28071:5;;-1:-1:-1;;;28101:23:0;8062:18:1;;28078:58:0;;;;-1:-1:-1;;28078:58:0;;;;;;;;;;;;;;-1:-1:-1;;;;;28078:58:0;-1:-1:-1;;;;;;28078:58:0;;;;;;;;;;28051:19;:86::i;79518:191::-;79592:16;79611:6;;-1:-1:-1;;;;;79628:17:0;;;-1:-1:-1;;;;;;79628:17:0;;;;;;79661:40;;79611:6;;;;;;;79661:40;;79592:16;79661:40;79581:128;79518:191;:::o;85690:301::-;85780:17;;85756:7;;85780:21;85776:184;;85834:17;;85825:26;;:6;:26;:::i;85776:184::-;85873:19;;:23;85869:91;;85929:19;;85920:28;;:6;:28;:::i;28153:248::-;28324:68;;-1:-1:-1;;;;;8452:15:1;;;28324:68:0;;;8434:34:1;8504:15;;8484:18;;;8477:43;8536:18;;;8529:34;;;28297:96:0;;28317:5;;-1:-1:-1;;;28347:27:0;8369:18:1;;28324:68:0;8194:375:1;28297:96:0;28153:248;;;;:::o;81152:395::-;81220:13;;:17;81216:324;;81254:23;79857:3;81296:15;;81280:13;:31;;;;:::i;:::-;:36;;;;:::i;:::-;81254:62;;81377:15;81360:32;;;;81467:13;;79818:2;81445:13;:18;;81444:36;;;;:::i;:::-;81422:18;;:58;;;;;;;:::i;:::-;;;;;;;;81513:15;81495:14;;:33;;;;;;;:::i;:::-;;;;-1:-1:-1;;;81152:395:0;:::o;93564:341::-;93612:7;93647:5;;93643:235;;93687:1;93682:6;;;93681:12;;;93669:9;;93681:12;93682:1;93681:12;93725:5;;;;:::i;:::-;;93721:1;:9;93720:16;;93708:28;;93751:93;93762:1;93758;:5;93751:93;;;93788:1;93784:5;;93827:1;93821;93817;:5;;;;;:::i;:::-;;93813:1;:9;93812:16;;93808:20;;93751:93;;;-1:-1:-1;93865:1:0;93564:341;-1:-1:-1;;93564:341:0:o;93643:235::-;-1:-1:-1;93895:1:0;;93564:341;-1:-1:-1;93564:341:0:o;58168:171::-;58224:7;58261:1;58252:5;:10;;58244:55;;;;-1:-1:-1;;;58244:55:0;;8776:2:1;58244:55:0;;;8758:21:1;;;8795:18;;;8788:30;8854:34;8834:18;;;8827:62;8906:18;;58244:55:0;8574:356:1;82112:690:0;-1:-1:-1;;;;;82206:12:0;;82182:21;82206:12;;;:8;:12;;;;;82279:13;;82206:12;;82182:21;82327:17;;82323:121;;82417:4;:15;;;79818:2;82389:18;;82373:13;:34;;;;:::i;:::-;82371:61;;;82372:41;82371:61;:::i;:::-;82361:71;;82323:121;82471:8;82454:13;;:25;;;;;;;:::i;:::-;;;;-1:-1:-1;82490:25:0;;-1:-1:-1;82507:8:0;82490:25;;:::i;:::-;82526:29;;;82601:18;;82490:25;;-1:-1:-1;79818:2:0;;82585:34;;82490:25;82585:34;:::i;:::-;82584:41;;82566:15;;;:59;82640:11;;82636:122;;82668:5;;:31;;-1:-1:-1;;;;;82668:5:0;82687:2;82691:7;82668:18;:31::i;:::-;82734:2;-1:-1:-1;;;;;82719:27:0;;82738:7;82719:27;;;;500:25:1;;488:2;473:18;;354:177;82719:27:0;;;;;;;;82636:122;82781:2;-1:-1:-1;;;;;82773:21:0;;82785:8;82773:21;;;;500:25:1;;488:2;473:18;;354:177;32205:106:0;32263:7;32294:1;32290;:5;:13;;32302:1;32290:13;;;-1:-1:-1;32298:1:0;;32283:20;-1:-1:-1;32205:106:0:o;93913:353::-;93961:7;;-1:-1:-1;;;94016:223:0;94043:5;;94016:223;;94080:1;94074:7;;;;94117:5;;;94108:15;;:1;:15;:19;;94150:1;94146;94150;94146:5;;;;:::i;:::-;;:10;94142:86;;94186:1;94182;:5;94177:10;;;;94211:1;94206:6;;;;94142:86;-1:-1:-1;94056:1:0;94050:7;94016:223;;31001:716;31425:23;31451:69;31479:4;31451:69;;;;;;;;;;;;;;;;;31459:5;-1:-1:-1;;;;;31451:27:0;;;:69;;;;;:::i;:::-;31535:17;;31425:95;;-1:-1:-1;31535:21:0;31531:179;;31632:10;31621:30;;;;;;;;;;;;:::i;:::-;31613:85;;;;-1:-1:-1;;;31613:85:0;;9419:2:1;31613:85:0;;;9401:21:1;9458:2;9438:18;;;9431:30;9497:34;9477:18;;;9470:62;-1:-1:-1;;;9548:18:1;;;9541:40;9598:19;;31613:85:0;9217:406:1;22833:229:0;22970:12;23002:52;23024:6;23032:4;23038:1;23041:12;23002:21;:52::i;:::-;22995:59;22833:229;-1:-1:-1;;;;22833:229:0:o;23953:510::-;24123:12;24181:5;24156:21;:30;;24148:81;;;;-1:-1:-1;;;24148:81:0;;9830:2:1;24148:81:0;;;9812:21:1;9869:2;9849:18;;;9842:30;9908:34;9888:18;;;9881:62;-1:-1:-1;;;9959:18:1;;;9952:36;10005:19;;24148:81:0;9628:402:1;24148:81:0;-1:-1:-1;;;;;20383:19:0;;;24240:60;;;;-1:-1:-1;;;24240:60:0;;10237:2:1;24240:60:0;;;10219:21:1;10276:2;10256:18;;;10249:30;10315:31;10295:18;;;10288:59;10364:18;;24240:60:0;10035:353:1;24240:60:0;24314:12;24328:23;24355:6;-1:-1:-1;;;;;24355:11:0;24374:5;24381:4;24355:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24313:73;;;;24404:51;24421:7;24430:10;24442:12;26789;26818:7;26814:580;;;-1:-1:-1;26849:10:0;26842:17;;26814:580;26963:17;;:21;26959:424;;27211:10;27205:17;27272:15;27259:10;27255:2;27251:19;27244:44;26959:424;27354:12;27347:20;;-1:-1:-1;;;27347:20:0;;;;;;;;:::i;536:173:1:-;604:20;;-1:-1:-1;;;;;653:31:1;;643:42;;633:70;;699:1;696;689:12;633:70;536:173;;;:::o;714:186::-;773:6;826:2;814:9;805:7;801:23;797:32;794:52;;;842:1;839;832:12;794:52;865:29;884:9;865:29;:::i;1158:180::-;1217:6;1270:2;1258:9;1249:7;1245:23;1241:32;1238:52;;;1286:1;1283;1276:12;1238:52;-1:-1:-1;1309:23:1;;1158:180;-1:-1:-1;1158:180:1:o;1343:254::-;1411:6;1419;1472:2;1460:9;1451:7;1447:23;1443:32;1440:52;;;1488:1;1485;1478:12;1440:52;1511:29;1530:9;1511:29;:::i;:::-;1501:39;1587:2;1572:18;;;;1559:32;;-1:-1:-1;;;1343:254:1:o;2563:127::-;2624:10;2619:3;2615:20;2612:1;2605:31;2655:4;2652:1;2645:15;2679:4;2676:1;2669:15;2695:168;2735:7;2801:1;2797;2793:6;2789:14;2786:1;2783:21;2778:1;2771:9;2764:17;2760:45;2757:71;;;2808:18;;:::i;:::-;-1:-1:-1;2848:9:1;;2695:168::o;2868:127::-;2929:10;2924:3;2920:20;2917:1;2910:31;2960:4;2957:1;2950:15;2984:4;2981:1;2974:15;3000:120;3040:1;3066;3056:35;;3071:18;;:::i;:::-;-1:-1:-1;3105:9:1;;3000:120::o;3125:125::-;3165:4;3193:1;3190;3187:8;3184:34;;;3198:18;;:::i;:::-;-1:-1:-1;3235:9:1;;3125:125::o;3610:128::-;3650:3;3681:1;3677:6;3674:1;3671:13;3668:39;;;3687:18;;:::i;:::-;-1:-1:-1;3723:9:1;;3610:128::o;3743:184::-;3813:6;3866:2;3854:9;3845:7;3841:23;3837:32;3834:52;;;3882:1;3879;3872:12;3834:52;-1:-1:-1;3905:16:1;;3743:184;-1:-1:-1;3743:184:1:o;4456:267::-;4495:4;4524:9;;;4549:10;;-1:-1:-1;;;4568:19:1;;4561:27;;4545:44;4542:70;;;4592:18;;:::i;:::-;-1:-1:-1;;;;;4639:27:1;;4632:35;;4624:44;;4621:70;;;4671:18;;:::i;:::-;-1:-1:-1;;4708:9:1;;4456:267::o;4728:553::-;4767:7;-1:-1:-1;;;;;4837:9:1;;;4865;;;4890:11;;;4909:10;;;4903:17;;4886:35;4883:61;;;4924:18;;:::i;:::-;-1:-1:-1;;;5000:1:1;4993:9;;5018:11;;;5038;;;5031:19;;5014:37;5011:63;;;5054:18;;:::i;:::-;5100:1;5097;5093:9;5083:19;;5147:1;5143:2;5138:11;5135:1;5131:19;5126:2;5122;5118:11;5114:37;5111:63;;;5154:18;;:::i;:::-;5219:1;5215:2;5210:11;5207:1;5203:19;5198:2;5194;5190:11;5186:37;5183:63;;;5226:18;;:::i;:::-;-1:-1:-1;;;5266:9:1;;;;;4728:553;-1:-1:-1;;;4728:553:1:o;5286:265::-;5325:3;5353:9;;;5378:10;;-1:-1:-1;;;;;5397:27:1;;;5390:35;;5374:52;5371:78;;;5429:18;;:::i;:::-;-1:-1:-1;;;5476:19:1;;;5469:27;;5461:36;;5458:62;;;5500:18;;:::i;:::-;-1:-1:-1;;5536:9:1;;5286:265::o;5556:193::-;5595:1;5621;5611:35;;5626:18;;:::i;:::-;-1:-1:-1;;;5662:18:1;;-1:-1:-1;;5682:13:1;;5658:38;5655:64;;;5699:18;;:::i;:::-;-1:-1:-1;5733:10:1;;5556:193::o;8935:277::-;9002:6;9055:2;9043:9;9034:7;9030:23;9026:32;9023:52;;;9071:1;9068;9061:12;9023:52;9103:9;9097:16;9156:5;9149:13;9142:21;9135:5;9132:32;9122:60;;9178:1;9175;9168:12;10393:258;10465:1;10475:113;10489:6;10486:1;10483:13;10475:113;;;10565:11;;;10559:18;10546:11;;;10539:39;10511:2;10504:10;10475:113;;;10606:6;10603:1;10600:13;10597:48;;;-1:-1:-1;;10641:1:1;10623:16;;10616:27;10393:258::o;10656:274::-;10785:3;10823:6;10817:13;10839:53;10885:6;10880:3;10873:4;10865:6;10861:17;10839:53;:::i;:::-;10908:16;;;;;10656:274;-1:-1:-1;;10656:274:1:o;10935:383::-;11084:2;11073:9;11066:21;11047:4;11116:6;11110:13;11159:6;11154:2;11143:9;11139:18;11132:34;11175:66;11234:6;11229:2;11218:9;11214:18;11209:2;11201:6;11197:15;11175:66;:::i;:::-;11302:2;11281:15;-1:-1:-1;;11277:29:1;11262:45;;;;11309:2;11258:54;;10935:383;-1:-1:-1;;10935:383:1:o

Swarm Source

ipfs://56a7a168ae083911fae79595857cf619da8b9ffccf5be80cee4501982ad336d8

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  ]
[ 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.