ETH Price: $3,991.30 (-0.74%)

Contract

0x5A74Cb32D36f2f517DB6f7b0A0591e09b22cDE69
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Fee Recipien...193930962024-03-08 21:24:23275 days ago1709933063IN
Yearn: Accountant
0 ETH0.0019796564.69657503
Set Future Fee M...193929242024-03-08 20:46:35275 days ago1709930795IN
Yearn: Accountant
0 ETH0.0032735269.23559081

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
193817892024-03-07 7:25:59276 days ago1709796359  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Accountant

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2024-03-07
*/

// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.18;

// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4626.sol)

// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

/**
 * @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);
}

// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

/**
 * @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 Interface of the ERC4626 "Tokenized Vault Standard", as defined in
 * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
 *
 * _Available since v4.7._
 */
interface IERC4626 is IERC20, IERC20Metadata {
    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);

    event Withdraw(
        address indexed sender,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /**
     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
     *
     * - MUST be an ERC-20 token contract.
     * - MUST NOT revert.
     */
    function asset() external view returns (address assetTokenAddress);

    /**
     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.
     *
     * - SHOULD include any compounding that occurs from yield.
     * - MUST be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT revert.
     */
    function totalAssets() external view returns (uint256 totalManagedAssets);

    /**
     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToShares(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToAssets(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
     * through a deposit call.
     *
     * - MUST return a limited value if receiver is subject to some deposit limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
     * - MUST NOT revert.
     */
    function maxDeposit(address receiver) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
     *   in the same transaction.
     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewDeposit(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   deposit execution, and are accounted for during deposit.
     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
     * - MUST return a limited value if receiver is subject to some mint limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
     * - MUST NOT revert.
     */
    function maxMint(address receiver) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
     *   same transaction.
     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
     *   would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by minting.
     */
    function previewMint(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
     *   execution, and are accounted for during mint.
     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function mint(uint256 shares, address receiver) external returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
     * Vault, through a withdraw call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxWithdraw(address owner) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
     *   called
     *   in the same transaction.
     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewWithdraw(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   withdraw execution, and are accounted for during withdraw.
     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
     * through a redeem call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxRedeem(address owner) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
     *   same transaction.
     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
     *   redemption would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.
     */
    function previewRedeem(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   redeem execution, and are accounted for during redeem.
     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
}

interface IVault is IERC4626 {
    // STRATEGY EVENTS
    event StrategyChanged(address indexed strategy, uint256 change_type);
    event StrategyReported(
        address indexed strategy,
        uint256 gain,
        uint256 loss,
        uint256 current_debt,
        uint256 protocol_fees,
        uint256 total_fees,
        uint256 total_refunds
    );
    // DEBT MANAGEMENT EVENTS
    event DebtUpdated(
        address indexed strategy,
        uint256 current_debt,
        uint256 new_debt
    );
    // ROLE UPDATES
    event RoleSet(address indexed account, uint256 role);
    event UpdateRoleManager(address indexed role_manager);

    event UpdateAccountant(address indexed accountant);
    event UpdateDefaultQueue(address[] new_default_queue);
    event UpdateUseDefaultQueue(bool use_default_queue);
    event UpdatedMaxDebtForStrategy(
        address indexed sender,
        address indexed strategy,
        uint256 new_debt
    );
    event UpdateDepositLimit(uint256 deposit_limit);
    event UpdateMinimumTotalIdle(uint256 minimum_total_idle);
    event UpdateProfitMaxUnlockTime(uint256 profit_max_unlock_time);
    event DebtPurchased(address indexed strategy, uint256 amount);
    event Shutdown();

    struct StrategyParams {
        uint256 activation;
        uint256 last_report;
        uint256 current_debt;
        uint256 max_debt;
    }

    function FACTORY() external view returns (uint256);

    function strategies(address) external view returns (StrategyParams memory);

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

    function use_default_queue() external view returns (bool);

    function minimum_total_idle() external view returns (uint256);

    function deposit_limit() external view returns (uint256);

    function deposit_limit_module() external view returns (address);

    function withdraw_limit_module() external view returns (address);

    function accountant() external view returns (address);

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

    function role_manager() external view returns (address);

    function future_role_manager() external view returns (address);

    function isShutdown() external view returns (bool);

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

    function initialize(
        address,
        string memory,
        string memory,
        address,
        uint256
    ) external;

    function set_accountant(address new_accountant) external;

    function set_default_queue(address[] memory new_default_queue) external;

    function set_use_default_queue(bool) external;

    function set_deposit_limit(uint256 deposit_limit) external;

    function set_deposit_limit(
        uint256 deposit_limit,
        bool should_override
    ) external;

    function set_deposit_limit_module(
        address new_deposit_limit_module
    ) external;

    function set_deposit_limit_module(
        address new_deposit_limit_module,
        bool should_override
    ) external;

    function set_withdraw_limit_module(
        address new_withdraw_limit_module
    ) external;

    function set_minimum_total_idle(uint256 minimum_total_idle) external;

    function setProfitMaxUnlockTime(
        uint256 new_profit_max_unlock_time
    ) external;

    function set_role(address account, uint256 role) external;

    function add_role(address account, uint256 role) external;

    function remove_role(address account, uint256 role) external;

    function transfer_role_manager(address role_manager) external;

    function accept_role_manager() external;

    function unlockedShares() external view returns (uint256);

    function pricePerShare() external view returns (uint256);

    function get_default_queue() external view returns (address[] memory);

    function process_report(
        address strategy
    ) external returns (uint256, uint256);

    function buy_debt(address strategy, uint256 amount) external;

    function add_strategy(address new_strategy) external;

    function revoke_strategy(address strategy) external;

    function force_revoke_strategy(address strategy) external;

    function update_max_debt_for_strategy(
        address strategy,
        uint256 new_max_debt
    ) external;

    function update_debt(
        address strategy,
        uint256 target_debt
    ) external returns (uint256);

    function update_debt(
        address strategy,
        uint256 target_debt,
        uint256 max_loss
    ) external returns (uint256);

    function shutdown_vault() external;

    function totalIdle() external view returns (uint256);

    function totalDebt() external view returns (uint256);

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

    function assess_share_of_unrealised_losses(
        address strategy,
        uint256 assets_needed
    ) external view returns (uint256);

    function profitMaxUnlockTime() external view returns (uint256);

    function fullProfitUnlockDate() external view returns (uint256);

    function profitUnlockingRate() external view returns (uint256);

    function lastProfitUpdate() external view returns (uint256);

    //// NON-STANDARD ERC-4626 FUNCTIONS \\\\

    function withdraw(
        uint256 assets,
        address receiver,
        address owner,
        uint256 max_loss
    ) external returns (uint256);

    function withdraw(
        uint256 assets,
        address receiver,
        address owner,
        uint256 max_loss,
        address[] memory strategies
    ) external returns (uint256);

    function redeem(
        uint256 shares,
        address receiver,
        address owner,
        uint256 max_loss
    ) external returns (uint256);

    function redeem(
        uint256 shares,
        address receiver,
        address owner,
        uint256 max_loss,
        address[] memory strategies
    ) external returns (uint256);

    function maxWithdraw(
        address owner,
        uint256 max_loss
    ) external view returns (uint256);

    function maxWithdraw(
        address owner,
        uint256 max_loss,
        address[] memory strategies
    ) external view returns (uint256);

    function maxRedeem(
        address owner,
        uint256 max_loss
    ) external view returns (uint256);

    function maxRedeem(
        address owner,
        uint256 max_loss,
        address[] memory strategies
    ) external view returns (uint256);

    //// NON-STANDARD ERC-20 FUNCTIONS \\\\

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (bool);
}

// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

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

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

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

/**
 * @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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * 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}.
     *
     * 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 default value returned by this function, unless
     * it's 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;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 {}
}

// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

/**
 * @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.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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);
}

// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

/// @title Accountant.
/// @dev Will charge fees, issue refunds, and run health check on any reported
///     gains or losses during a strategy's report.
contract Accountant {
    using SafeERC20 for ERC20;

    /// @notice An event emitted when a vault is added or removed.
    event VaultChanged(address indexed vault, ChangeType change);

    /// @notice An event emitted when the default fee configuration is updated.
    event UpdateDefaultFeeConfig(Fee defaultFeeConfig);

    /// @notice An event emitted when the future fee manager is set.
    event SetFutureFeeManager(address indexed futureFeeManager);

    /// @notice An event emitted when a new fee manager is accepted.
    event NewFeeManager(address indexed feeManager);

    /// @notice An event emitted when a new vault manager is set.
    event UpdateVaultManager(address indexed newVaultManager);

    /// @notice An event emitted when the fee recipient is updated.
    event UpdateFeeRecipient(
        address indexed oldFeeRecipient,
        address indexed newFeeRecipient
    );

    /// @notice An event emitted when a custom fee configuration is updated.
    event UpdateCustomFeeConfig(address indexed vault, Fee custom_config);

    /// @notice An event emitted when a custom fee configuration is removed.
    event RemovedCustomFeeConfig(address indexed vault);

    /// @notice An event emitted when the `maxLoss` parameter is updated.
    event UpdateMaxLoss(uint256 maxLoss);

    /// @notice An event emitted when rewards are distributed.
    event DistributeRewards(address indexed token, uint256 rewards);

    /// @notice Enum defining change types (added or removed).
    enum ChangeType {
        NULL,
        ADDED,
        REMOVED
    }

    /// @notice Struct representing fee details.
    struct Fee {
        uint16 managementFee; // Annual management fee to charge.
        uint16 performanceFee; // Performance fee to charge.
        uint16 refundRatio; // Refund ratio to give back on losses.
        uint16 maxFee; // Max fee allowed as a percent of gain.
        uint16 maxGain; // Max percent gain a strategy can report.
        uint16 maxLoss; // Max percent loss a strategy can report.
        bool custom; // Flag to set for custom configs.
    }

    modifier onlyFeeManager() {
        _checkFeeManager();
        _;
    }

    modifier onlyVaultOrFeeManager() {
        _checkVaultOrFeeManager();
        _;
    }

    modifier onlyFeeManagerOrRecipient() {
        _checkFeeManagerOrRecipient();
        _;
    }

    modifier onlyAddedVaults() {
        _checkVaultIsAdded();
        _;
    }

    function _checkFeeManager() internal view virtual {
        require(msg.sender == feeManager, "!fee manager");
    }

    function _checkVaultOrFeeManager() internal view virtual {
        require(
            msg.sender == feeManager || msg.sender == vaultManager,
            "!vault manager"
        );
    }

    function _checkFeeManagerOrRecipient() internal view virtual {
        require(
            msg.sender == feeRecipient || msg.sender == feeManager,
            "!recipient"
        );
    }

    function _checkVaultIsAdded() internal view virtual {
        require(vaults[msg.sender], "vault not added");
    }

    /// @notice Constant defining the maximum basis points.
    uint256 internal constant MAX_BPS = 10_000;

    /// @notice Constant defining the number of seconds in a year.
    uint256 internal constant SECS_PER_YEAR = 31_556_952;

    /// @notice Constant defining the management fee threshold.
    uint16 public constant MANAGEMENT_FEE_THRESHOLD = 200;

    /// @notice Constant defining the performance fee threshold.
    uint16 public constant PERFORMANCE_FEE_THRESHOLD = 5_000;

    /// @notice The amount of max loss to use when redeeming from vaults.
    uint256 public maxLoss;

    /// @notice The address of the fee manager.
    address public feeManager;

    /// @notice The address of the fee recipient.
    address public feeRecipient;

    /// @notice An address that can add or remove vaults.
    address public vaultManager;

    /// @notice The address of the future fee manager.
    address public futureFeeManager;

    /// @notice The default fee configuration.
    Fee public defaultConfig;

    /// @notice Mapping to track added vaults.
    mapping(address => bool) public vaults;

    /// @notice Mapping vault => custom Fee config if any.
    mapping(address => Fee) public customConfig;

    /// @notice Mapping vault => strategy => flag for one time healthcheck skips.
    mapping(address => mapping(address => bool)) skipHealthCheck;

    constructor(
        address _feeManager,
        address _feeRecipient,
        uint16 defaultManagement,
        uint16 defaultPerformance,
        uint16 defaultRefund,
        uint16 defaultMaxFee,
        uint16 defaultMaxGain,
        uint16 defaultMaxLoss
    ) {
        require(_feeManager != address(0), "ZERO ADDRESS");
        require(_feeRecipient != address(0), "ZERO ADDRESS");

        feeManager = _feeManager;
        feeRecipient = _feeRecipient;

        _updateDefaultConfig(
            defaultManagement,
            defaultPerformance,
            defaultRefund,
            defaultMaxFee,
            defaultMaxGain,
            defaultMaxLoss
        );
    }

    /**
     * @notice Called by a vault when a `strategy` is reporting.
     * @dev The msg.sender must have been added to the `vaults` mapping.
     * @param strategy Address of the strategy reporting.
     * @param gain Amount of the gain if any.
     * @param loss Amount of the loss if any.
     * @return totalFees if any to charge.
     * @return totalRefunds if any for the vault to pull.
     */
    function report(
        address strategy,
        uint256 gain,
        uint256 loss
    )
        public
        virtual
        onlyAddedVaults
        returns (uint256 totalFees, uint256 totalRefunds)
    {
        // Declare the config to use as the custom.
        Fee memory fee = customConfig[msg.sender];

        // Check if there is a custom config to use.
        if (!fee.custom) {
            // Otherwise use the default.
            fee = defaultConfig;
        }

        // Retrieve the strategy's params from the vault.
        IVault.StrategyParams memory strategyParams = IVault(msg.sender)
            .strategies(strategy);

        // Charge management fees no matter gain or loss.
        if (fee.managementFee > 0) {
            // Time since the last harvest.
            uint256 duration = block.timestamp - strategyParams.last_report;
            // managementFee is an annual amount, so charge based on the time passed.
            totalFees = ((strategyParams.current_debt *
                duration *
                (fee.managementFee)) /
                MAX_BPS /
                SECS_PER_YEAR);
        }

        // Only charge performance fees if there is a gain.
        if (gain > 0) {
            // If we are skipping the healthcheck this report
            if (skipHealthCheck[msg.sender][strategy]) {
                // Make sure it is reset for the next one.
                skipHealthCheck[msg.sender][strategy] = false;

                // Setting `maxGain` to 0 will disable the healthcheck on profits.
            } else if (fee.maxGain > 0) {
                require(
                    gain <=
                        (strategyParams.current_debt * (fee.maxGain)) / MAX_BPS,
                    "too much gain"
                );
            }

            totalFees += (gain * (fee.performanceFee)) / MAX_BPS;
        } else {
            // If we are skipping the healthcheck this report
            if (skipHealthCheck[msg.sender][strategy]) {
                // Make sure it is reset for the next one.
                skipHealthCheck[msg.sender][strategy] = false;

                // Setting `maxLoss` to 10_000 will disable the healthcheck on losses.
            } else if (fee.maxLoss < MAX_BPS) {
                require(
                    loss <=
                        (strategyParams.current_debt * (fee.maxLoss)) / MAX_BPS,
                    "too much loss"
                );
            }

            // Means we should have a loss.
            if (fee.refundRatio > 0) {
                // Cache the underlying asset the vault uses.
                address asset = IVault(msg.sender).asset();
                // Give back either all we have or based on the refund ratio.
                totalRefunds = Math.min(
                    (loss * (fee.refundRatio)) / MAX_BPS,
                    ERC20(asset).balanceOf(address(this))
                );

                if (totalRefunds > 0) {
                    // Approve the vault to pull the underlying asset.
                    _checkAllowance(msg.sender, asset, totalRefunds);
                }
            }
        }

        // 0 Max fee means it is not enforced.
        if (fee.maxFee > 0) {
            // Ensure fee does not exceed the maxFee %.
            totalFees = Math.min((gain * (fee.maxFee)) / MAX_BPS, totalFees);
        }

        return (totalFees, totalRefunds);
    }

    /**
     * @notice Function to add a new vault for this accountant to charge fees for.
     * @dev This is not used to set any of the fees for the specific vault or strategy. Each fee will be set separately.
     * @param vault The address of a vault to allow to use this accountant.
     */
    function addVault(address vault) external virtual onlyVaultOrFeeManager {
        // Ensure the vault has not already been added.
        require(!vaults[vault], "already added");

        vaults[vault] = true;

        emit VaultChanged(vault, ChangeType.ADDED);
    }

    /**
     * @notice Function to remove a vault from this accountant's fee charging list.
     * @param vault The address of the vault to be removed from this accountant.
     */
    function removeVault(address vault) external virtual onlyVaultOrFeeManager {
        // Ensure the vault has been previously added.
        require(vaults[vault], "not added");

        address asset = IVault(vault).asset();
        // Remove any allowances left.
        if (ERC20(asset).allowance(address(this), vault) != 0) {
            ERC20(asset).safeApprove(vault, 0);
        }

        vaults[vault] = false;

        emit VaultChanged(vault, ChangeType.REMOVED);
    }

    /**
     * @notice Function to update the default fee configuration used for 
        all strategies that don't have a custom config set.
     * @param defaultManagement Default annual management fee to charge.
     * @param defaultPerformance Default performance fee to charge.
     * @param defaultRefund Default refund ratio to give back on losses.
     * @param defaultMaxFee Default max fee to allow as a percent of gain.
     * @param defaultMaxGain Default max percent gain a strategy can report.
     * @param defaultMaxLoss Default max percent loss a strategy can report.
     */
    function updateDefaultConfig(
        uint16 defaultManagement,
        uint16 defaultPerformance,
        uint16 defaultRefund,
        uint16 defaultMaxFee,
        uint16 defaultMaxGain,
        uint16 defaultMaxLoss
    ) external virtual onlyFeeManager {
        _updateDefaultConfig(
            defaultManagement,
            defaultPerformance,
            defaultRefund,
            defaultMaxFee,
            defaultMaxGain,
            defaultMaxLoss
        );
    }

    /**
     * @dev Updates the Accountant's default fee config.
     *   Is used during deployment and during any future updates.
     */
    function _updateDefaultConfig(
        uint16 defaultManagement,
        uint16 defaultPerformance,
        uint16 defaultRefund,
        uint16 defaultMaxFee,
        uint16 defaultMaxGain,
        uint16 defaultMaxLoss
    ) internal virtual {
        // Check for threshold and limit conditions.
        require(
            defaultManagement <= MANAGEMENT_FEE_THRESHOLD,
            "management fee threshold"
        );
        require(
            defaultPerformance <= PERFORMANCE_FEE_THRESHOLD,
            "performance fee threshold"
        );
        require(defaultMaxLoss <= MAX_BPS, "too high");

        // Update the default fee configuration.
        defaultConfig = Fee({
            managementFee: defaultManagement,
            performanceFee: defaultPerformance,
            refundRatio: defaultRefund,
            maxFee: defaultMaxFee,
            maxGain: defaultMaxGain,
            maxLoss: defaultMaxLoss,
            custom: false
        });

        emit UpdateDefaultFeeConfig(defaultConfig);
    }

    /**
     * @notice Function to set a custom fee configuration for a specific vault.
     * @param vault The vault the strategy is hooked up to.
     * @param customManagement Custom annual management fee to charge.
     * @param customPerformance Custom performance fee to charge.
     * @param customRefund Custom refund ratio to give back on losses.
     * @param customMaxFee Custom max fee to allow as a percent of gain.
     * @param customMaxGain Custom max percent gain a strategy can report.
     * @param customMaxLoss Custom max percent loss a strategy can report.
     */
    function setCustomConfig(
        address vault,
        uint16 customManagement,
        uint16 customPerformance,
        uint16 customRefund,
        uint16 customMaxFee,
        uint16 customMaxGain,
        uint16 customMaxLoss
    ) external virtual onlyFeeManager {
        // Ensure the vault has been added.
        require(vaults[vault], "vault not added");
        // Check for threshold and limit conditions.
        require(
            customManagement <= MANAGEMENT_FEE_THRESHOLD,
            "management fee threshold"
        );
        require(
            customPerformance <= PERFORMANCE_FEE_THRESHOLD,
            "performance fee threshold"
        );
        require(customMaxLoss <= MAX_BPS, "too high");

        // Create the vault's custom config.
        Fee memory _config = Fee({
            managementFee: customManagement,
            performanceFee: customPerformance,
            refundRatio: customRefund,
            maxFee: customMaxFee,
            maxGain: customMaxGain,
            maxLoss: customMaxLoss,
            custom: true
        });

        // Store the config.
        customConfig[vault] = _config;

        emit UpdateCustomFeeConfig(vault, _config);
    }

    /**
     * @notice Function to remove a previously set custom fee configuration for a vault.
     * @param vault The vault to remove custom setting for.
     */
    function removeCustomConfig(address vault) external virtual onlyFeeManager {
        // Ensure custom fees are set for the specified vault.
        require(customConfig[vault].custom, "No custom fees set");

        // Set all the vaults's custom fees to 0.
        delete customConfig[vault];

        // Emit relevant event.
        emit RemovedCustomFeeConfig(vault);
    }

    /**
     * @notice Turn off the health check for a specific `vault` `strategy` combo.
     * @dev This will only last for one report and get automatically turned back on.
     * @param vault Address of the vault.
     * @param strategy Address of the strategy.
     */
    function turnOffHealthCheck(
        address vault,
        address strategy
    ) external virtual onlyFeeManager {
        // Ensure the vault has been added.
        require(vaults[vault], "vault not added");

        skipHealthCheck[vault][strategy] = true;
    }

    /**
     * @notice Public getter to check for custom setting.
     * @dev We use uint256 for the flag since its cheaper so this
     *   will convert it to a bool for easy view functions.
     *
     * @param vault Address of the vault.
     * @return If a custom fee config is set.
     */
    function useCustomConfig(
        address vault
    ) external view virtual returns (bool) {
        return customConfig[vault].custom;
    }

    /**
     * @notice Get the full config used for a specific `vault`.
     * @param vault Address of the vault.
     * @return fee The config that would be used during the report.
     */
    function getVaultConfig(
        address vault
    ) external view returns (Fee memory fee) {
        fee = customConfig[vault];

        // Check if there is a custom config to use.
        if (!fee.custom) {
            // Otherwise use the default.
            fee = defaultConfig;
        }
    }

    /**
     * @notice Function to redeem the underlying asset from a vault.
     * @dev Will default to using the full balance of the vault.
     * @param vault The vault to redeem from.
     */
    function redeemUnderlying(address vault) external virtual {
        redeemUnderlying(vault, IVault(vault).balanceOf(address(this)));
    }

    /**
     * @notice Function to redeem the underlying asset from a vault.
     * @param vault The vault to redeem from.
     * @param amount The amount in vault shares to redeem.
     */
    function redeemUnderlying(
        address vault,
        uint256 amount
    ) public virtual onlyFeeManager {
        IVault(vault).redeem(amount, address(this), address(this), maxLoss);
    }

    /**
     * @notice Sets the `maxLoss` parameter to be used on redeems.
     * @param _maxLoss The amount in basis points to set as the maximum loss.
     */
    function setMaxLoss(uint256 _maxLoss) external virtual onlyFeeManager {
        // Ensure that the provided `maxLoss` does not exceed 100% (in basis points).
        require(_maxLoss <= MAX_BPS, "higher than 100%");

        maxLoss = _maxLoss;

        // Emit an event to signal the update of the `maxLoss` parameter.
        emit UpdateMaxLoss(_maxLoss);
    }

    /**
     * @notice Function to distribute all accumulated fees to the designated recipient.
     * @param token The token to distribute.
     */
    function distribute(address token) external virtual {
        distribute(token, ERC20(token).balanceOf(address(this)));
    }

    /**
     * @notice Function to distribute accumulated fees to the designated recipient.
     * @param token The token to distribute.
     * @param amount amount of token to distribute.
     */
    function distribute(
        address token,
        uint256 amount
    ) public virtual onlyFeeManagerOrRecipient {
        ERC20(token).safeTransfer(feeRecipient, amount);

        emit DistributeRewards(token, amount);
    }

    /**
     * @notice Function to set a future fee manager address.
     * @param _futureFeeManager The address to set as the future fee manager.
     */
    function setFutureFeeManager(
        address _futureFeeManager
    ) external virtual onlyFeeManager {
        // Ensure the futureFeeManager is not a zero address.
        require(_futureFeeManager != address(0), "ZERO ADDRESS");
        futureFeeManager = _futureFeeManager;

        emit SetFutureFeeManager(_futureFeeManager);
    }

    /**
     * @notice Function to accept the role change and become the new fee manager.
     * @dev This function allows the future fee manager to accept the role change and become the new fee manager.
     */
    function acceptFeeManager() external virtual {
        // Make sure the sender is the future fee manager.
        require(msg.sender == futureFeeManager, "not future fee manager");
        feeManager = futureFeeManager;
        futureFeeManager = address(0);

        emit NewFeeManager(msg.sender);
    }

    /**
     * @notice Function to set a new vault manager.
     * @param newVaultManager Address to add or remove vaults.
     */
    function setVaultManager(
        address newVaultManager
    ) external virtual onlyFeeManager {
        vaultManager = newVaultManager;

        emit UpdateVaultManager(newVaultManager);
    }

    /**
     * @notice Function to set a new address to receive distributed rewards.
     * @param newFeeRecipient Address to receive distributed fees.
     */
    function setFeeRecipient(
        address newFeeRecipient
    ) external virtual onlyFeeManager {
        // Ensure the newFeeRecipient is not a zero address.
        require(newFeeRecipient != address(0), "ZERO ADDRESS");
        address oldRecipient = feeRecipient;
        feeRecipient = newFeeRecipient;

        emit UpdateFeeRecipient(oldRecipient, newFeeRecipient);
    }

    /**
     * @dev Internal safe function to make sure the contract you want to
     * interact with has enough allowance to pull the desired tokens.
     *
     * @param _contract The address of the contract that will move the token.
     * @param _token The ERC-20 token that will be getting spent.
     * @param _amount The amount of `_token` to be spent.
     */
    function _checkAllowance(
        address _contract,
        address _token,
        uint256 _amount
    ) internal {
        if (ERC20(_token).allowance(address(this), _contract) < _amount) {
            ERC20(_token).safeApprove(_contract, 0);
            ERC20(_token).safeApprove(_contract, _amount);
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_feeManager","type":"address"},{"internalType":"address","name":"_feeRecipient","type":"address"},{"internalType":"uint16","name":"defaultManagement","type":"uint16"},{"internalType":"uint16","name":"defaultPerformance","type":"uint16"},{"internalType":"uint16","name":"defaultRefund","type":"uint16"},{"internalType":"uint16","name":"defaultMaxFee","type":"uint16"},{"internalType":"uint16","name":"defaultMaxGain","type":"uint16"},{"internalType":"uint16","name":"defaultMaxLoss","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"DistributeRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"feeManager","type":"address"}],"name":"NewFeeManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"}],"name":"RemovedCustomFeeConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"futureFeeManager","type":"address"}],"name":"SetFutureFeeManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"components":[{"internalType":"uint16","name":"managementFee","type":"uint16"},{"internalType":"uint16","name":"performanceFee","type":"uint16"},{"internalType":"uint16","name":"refundRatio","type":"uint16"},{"internalType":"uint16","name":"maxFee","type":"uint16"},{"internalType":"uint16","name":"maxGain","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"bool","name":"custom","type":"bool"}],"indexed":false,"internalType":"struct Accountant.Fee","name":"custom_config","type":"tuple"}],"name":"UpdateCustomFeeConfig","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint16","name":"managementFee","type":"uint16"},{"internalType":"uint16","name":"performanceFee","type":"uint16"},{"internalType":"uint16","name":"refundRatio","type":"uint16"},{"internalType":"uint16","name":"maxFee","type":"uint16"},{"internalType":"uint16","name":"maxGain","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"bool","name":"custom","type":"bool"}],"indexed":false,"internalType":"struct Accountant.Fee","name":"defaultFeeConfig","type":"tuple"}],"name":"UpdateDefaultFeeConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldFeeRecipient","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeRecipient","type":"address"}],"name":"UpdateFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxLoss","type":"uint256"}],"name":"UpdateMaxLoss","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newVaultManager","type":"address"}],"name":"UpdateVaultManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"enum Accountant.ChangeType","name":"change","type":"uint8"}],"name":"VaultChanged","type":"event"},{"inputs":[],"name":"MANAGEMENT_FEE_THRESHOLD","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERFORMANCE_FEE_THRESHOLD","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"addVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"customConfig","outputs":[{"internalType":"uint16","name":"managementFee","type":"uint16"},{"internalType":"uint16","name":"performanceFee","type":"uint16"},{"internalType":"uint16","name":"refundRatio","type":"uint16"},{"internalType":"uint16","name":"maxFee","type":"uint16"},{"internalType":"uint16","name":"maxGain","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"bool","name":"custom","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultConfig","outputs":[{"internalType":"uint16","name":"managementFee","type":"uint16"},{"internalType":"uint16","name":"performanceFee","type":"uint16"},{"internalType":"uint16","name":"refundRatio","type":"uint16"},{"internalType":"uint16","name":"maxFee","type":"uint16"},{"internalType":"uint16","name":"maxGain","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"bool","name":"custom","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"futureFeeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getVaultConfig","outputs":[{"components":[{"internalType":"uint16","name":"managementFee","type":"uint16"},{"internalType":"uint16","name":"performanceFee","type":"uint16"},{"internalType":"uint16","name":"refundRatio","type":"uint16"},{"internalType":"uint16","name":"maxFee","type":"uint16"},{"internalType":"uint16","name":"maxGain","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"bool","name":"custom","type":"bool"}],"internalType":"struct Accountant.Fee","name":"fee","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLoss","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"redeemUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeemUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"removeCustomConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"removeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"},{"internalType":"uint256","name":"gain","type":"uint256"},{"internalType":"uint256","name":"loss","type":"uint256"}],"name":"report","outputs":[{"internalType":"uint256","name":"totalFees","type":"uint256"},{"internalType":"uint256","name":"totalRefunds","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"customManagement","type":"uint16"},{"internalType":"uint16","name":"customPerformance","type":"uint16"},{"internalType":"uint16","name":"customRefund","type":"uint16"},{"internalType":"uint16","name":"customMaxFee","type":"uint16"},{"internalType":"uint16","name":"customMaxGain","type":"uint16"},{"internalType":"uint16","name":"customMaxLoss","type":"uint16"}],"name":"setCustomConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeRecipient","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_futureFeeManager","type":"address"}],"name":"setFutureFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxLoss","type":"uint256"}],"name":"setMaxLoss","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newVaultManager","type":"address"}],"name":"setVaultManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"address","name":"strategy","type":"address"}],"name":"turnOffHealthCheck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"defaultManagement","type":"uint16"},{"internalType":"uint16","name":"defaultPerformance","type":"uint16"},{"internalType":"uint16","name":"defaultRefund","type":"uint16"},{"internalType":"uint16","name":"defaultMaxFee","type":"uint16"},{"internalType":"uint16","name":"defaultMaxGain","type":"uint16"},{"internalType":"uint16","name":"defaultMaxLoss","type":"uint16"}],"name":"updateDefaultConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"useCustomConfig","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaults","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040516200279038038062002790833981016040819052620000349162000344565b6001600160a01b0388166200007f5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b60448201526064015b60405180910390fd5b6001600160a01b038716620000c65760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b604482015260640162000076565b600180546001600160a01b03808b166001600160a01b03199283161790925560028054928a16929091169190911790556200010686868686868662000114565b50505050505050506200045d565b60c861ffff871611156200016b5760405162461bcd60e51b815260206004820152601860248201527f6d616e6167656d656e7420666565207468726573686f6c640000000000000000604482015260640162000076565b61138861ffff86161115620001c35760405162461bcd60e51b815260206004820152601960248201527f706572666f726d616e636520666565207468726573686f6c6400000000000000604482015260640162000076565b6127108161ffff161115620002065760405162461bcd60e51b81526020600482015260086024820152670e8dede40d0d2ced60c31b604482015260640162000076565b6040805160e08101825261ffff88811680835288821660208401819052888316848601819052888416606086018190528885166080870181905294881660a08701819052600060c0909701969096526005805463ffffffff1916909417620100009093029290921763ffffffff60201b191664010000000090910261ffff60301b19161766010000000000009091021763ffffffff60401b19166801000000000000000090920261ffff60501b1916919091176a01000000000000000000009092029190911760ff60601b1916815590517fbbcfba7e6e61ab9dbbe4ee1512e1e0c0ff1b236ba707ef51c8f45e7af433b89d916200030491620003ec565b60405180910390a1505050505050565b80516001600160a01b03811681146200032c57600080fd5b919050565b805161ffff811681146200032c57600080fd5b600080600080600080600080610100898b0312156200036257600080fd5b6200036d8962000314565b97506200037d60208a0162000314565b96506200038d60408a0162000331565b95506200039d60608a0162000331565b9450620003ad60808a0162000331565b9350620003bd60a08a0162000331565b9250620003cd60c08a0162000331565b9150620003dd60e08a0162000331565b90509295985092959890939650565b600060e082019050825461ffff8082168452808260101c166020850152808260201c166040850152808260301c166060850152808260401c1660808501526200044060a08501828460501c1661ffff169052565b506200045660c0840160ff8360601c1615159052565b5092915050565b612323806200046d6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80639b3b6955116100f9578063d0fb020311610097578063e2a85ce411610071578063e2a85ce4146104e3578063e74b981b146104f6578063f94c53c714610509578063fb9321081461051157600080fd5b8063d0fb02031461049d578063d8609c5b146104b0578063de1eb9a3146104c357600080fd5b8063b53d68e5116100d3578063b53d68e51461043b578063b543503e14610444578063c7c504b914610457578063ceb68c231461048a57600080fd5b80639b3b6955146103a85780639e09ed5f146103bb578063a622ee7c1461040857600080fd5b806363453ae11161016657806382e4dd6f1161014057806382e4dd6f1461033f5780638a4adf241461035a578063921f8a8f1461036d578063962941781461039557600080fd5b806363453ae11461027157806367bee7e9146102845780637b5d7b651461029757600080fd5b8063256b5a02116101a2578063256b5a021461022157806346904840146102345780635783fe39146102475780635cece03a1461025e57600080fd5b8063015cf150146101c957806303579dca146101f957806324be66281461020e575b600080fd5b6004546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61020c610207366004611ea3565b610524565b005b61020c61021c366004611ec7565b610595565b61020c61022f366004611ea3565b610622565b6002546101dc906001600160a01b031681565b61025060005481565b6040519081526020016101f0565b61020c61026c366004611ee0565b6106e3565b61020c61027f366004611ea3565b610757565b61020c610292366004611ea3565b6107c5565b6102fa6102a5366004611ea3565b60076020526000908152604090205461ffff80821691620100008104821691600160201b8204811691600160301b8104821691600160401b8204811691600160501b810490911690600160601b900460ff1687565b6040805161ffff988916815296881660208801529487169486019490945291851660608501528416608084015290921660a082015290151560c082015260e0016101f0565b61034760c881565b60405161ffff90911681526020016101f0565b6003546101dc906001600160a01b031681565b61038061037b366004611f19565b610886565b604080519283526020830191909152016101f0565b61020c6103a3366004611f4e565b610d90565b61020c6103b6366004611ea3565b610e20565b6005546102fa9061ffff80821691620100008104821691600160201b8204811691600160301b8104821691600160401b8204811691600160501b810490911690600160601b900460ff1687565b61042b610416366004611ea3565b60066020526000908152604090205460ff1681565b60405190151581526020016101f0565b61034761138881565b61020c610452366004611ea3565b610eb7565b61042b610465366004611ea3565b6001600160a01b0316600090815260076020526040902054600160601b900460ff1690565b61020c610498366004611ea3565b610f09565b6001546101dc906001600160a01b031681565b61020c6104be366004611f8c565b6110b4565b6104d66104d1366004611ea3565b61138f565b6040516101f09190612014565b61020c6104f1366004612074565b6114cf565b61020c610504366004611ea3565b6114ed565b61020c61158c565b61020c61051f366004611f4e565b611631565b6040516370a0823160e01b81523060048201526105929082906001600160a01b038216906370a0823190602401602060405180830381865afa15801561056e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a391906120e8565b50565b61059d61168e565b6127108111156105e75760405162461bcd60e51b815260206004820152601060248201526f686967686572207468616e203130302560801b60448201526064015b60405180910390fd5b60008190556040518181527f18182e268b61d2aada98f23ade23b0ea133d5b0b6712dbfa682dc6da29941c229060200160405180910390a150565b61062a6116d9565b6001600160a01b03811660009081526006602052604090205460ff16156106835760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481859191959609a1b60448201526064016105de565b6001600160a01b03811660008181526006602052604090819020805460ff1916600190811790915590517fce96c4db32686d3f0011df1abea0ab6c5794b848868dcbece79961fef7e8198d916106d891612101565b60405180910390a250565b6106eb61168e565b6001600160a01b03821660009081526006602052604090205460ff166107235760405162461bcd60e51b81526004016105de90612129565b6001600160a01b0391821660009081526008602090815260408083209390941682529190915220805460ff19166001179055565b6040516370a0823160e01b81523060048201526105929082906001600160a01b038216906370a0823190602401602060405180830381865afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051f91906120e8565b6107cd61168e565b6001600160a01b038116600090815260076020526040902054600160601b900460ff166108315760405162461bcd60e51b8152602060048201526012602482015271139bc818dd5cdd1bdb481999595cc81cd95d60721b60448201526064016105de565b6001600160a01b03811660008181526007602052604080822080546cffffffffffffffffffffffffff19169055517f3e6648a1d6918f893e09d7f2a385f04bdafbf8ad899b255b7f40e02c967b55879190a250565b600080610891611739565b33600090815260076020908152604091829020825160e081018452905461ffff8082168352620100008204811693830193909352600160201b8104831693820193909352600160301b830482166060820152600160401b830482166080820152600160501b830490911660a0820152600160601b90910460ff16151560c0820181905261098957506040805160e08101825260055461ffff808216835262010000820481166020840152600160201b8204811693830193909352600160301b810483166060830152600160401b810483166080830152600160501b810490921660a0820152600160601b90910460ff16151560c08201525b6040516339ebf82360e01b81526001600160a01b038716600482015260009033906339ebf82390602401608060405180830381865afa1580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f49190612152565b825190915061ffff1615610a59576000816020015142610a1491906121dc565b90506301e18558612710846000015161ffff16838560400151610a3791906121ef565b610a4191906121ef565b610a4b9190612206565b610a559190612206565b9450505b8515610b5f573360009081526008602090815260408083206001600160a01b038b16845290915290205460ff1615610abb573360009081526008602090815260408083206001600160a01b038b1684529091529020805460ff19169055610b2d565b608082015161ffff1615610b2d57612710826080015161ffff168260400151610ae491906121ef565b610aee9190612206565b861115610b2d5760405162461bcd60e51b815260206004820152600d60248201526c3a37b79036bab1b41033b0b4b760991b60448201526064016105de565b612710826020015161ffff1687610b4491906121ef565b610b4e9190612206565b610b589085612228565b9350610d4b565b3360009081526008602090815260408083206001600160a01b038b16845290915290205460ff1615610bbb573360009081526008602090815260408083206001600160a01b038b1684529091529020805460ff19169055610c31565b6127108260a0015161ffff161015610c31576127108260a0015161ffff168260400151610be891906121ef565b610bf29190612206565b851115610c315760405162461bcd60e51b815260206004820152600d60248201526c746f6f206d756368206c6f737360981b60448201526064016105de565b604082015161ffff1615610d4b576000336001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca3919061223b565b9050610d36612710846040015161ffff1688610cbf91906121ef565b610cc99190612206565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3191906120e8565b611768565b93508315610d4957610d49338286611782565b505b606082015161ffff1615610d8657610d83612710836060015161ffff1688610d7391906121ef565b610d7d9190612206565b85611768565b93505b5050935093915050565b610d9861168e565b600054604051639f40a7b360e01b8152600481018390523060248201819052604482015260648101919091526001600160a01b03831690639f40a7b3906084016020604051808303816000875af1158015610df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1b91906120e8565b505050565b610e2861168e565b6001600160a01b038116610e6d5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b60448201526064016105de565b600480546001600160a01b0319166001600160a01b0383169081179091556040517fa839c45565e8a86de41783841928f4acde049c2b7160f0ea4d4698220c5af61b90600090a250565b610ebf61168e565b600380546001600160a01b0319166001600160a01b0383169081179091556040517fda833a9122ed0b27d5c78c99315bb3758f1b77fb240db484a67fd0f286b263e590600090a250565b610f116116d9565b6001600160a01b03811660009081526006602052604090205460ff16610f655760405162461bcd60e51b81526020600482015260096024820152681b9bdd08185919195960ba1b60448201526064016105de565b6000816001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc9919061223b565b604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301529192509082169063dd62ed3e90604401602060405180830381865afa158015611019573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103d91906120e8565b15611057576110576001600160a01b038216836000611820565b6001600160a01b03821660008181526006602052604090819020805460ff19169055517fce96c4db32686d3f0011df1abea0ab6c5794b848868dcbece79961fef7e8198d906110a890600290612101565b60405180910390a25050565b6110bc61168e565b6001600160a01b03871660009081526006602052604090205460ff166110f45760405162461bcd60e51b81526004016105de90612129565b60c861ffff871611156111445760405162461bcd60e51b81526020600482015260186024820152771b585b9859d95b595b9d08199959481d1a1c995cda1bdb1960421b60448201526064016105de565b61138861ffff861611156111965760405162461bcd60e51b81526020600482015260196024820152781c195c999bdc9b585b98d948199959481d1a1c995cda1bdb19603a1b60448201526064016105de565b6127108161ffff1611156111d75760405162461bcd60e51b81526020600482015260086024820152670e8dede40d0d2ced60c31b60448201526064016105de565b60006040518060e001604052808861ffff1681526020018761ffff1681526020018661ffff1681526020018561ffff1681526020018461ffff1681526020018361ffff16815260200160011515815250905080600760008a6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a81548161ffff021916908361ffff16021790555060408201518160000160046101000a81548161ffff021916908361ffff16021790555060608201518160000160066101000a81548161ffff021916908361ffff16021790555060808201518160000160086101000a81548161ffff021916908361ffff16021790555060a082015181600001600a6101000a81548161ffff021916908361ffff16021790555060c082015181600001600c6101000a81548160ff021916908315150217905550905050876001600160a01b03167fff2b689837652b4795317128d1dd57305f04ec90d567ff4b921424f1a19e8b0a8260405161137d9190612014565b60405180910390a25050505050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506001600160a01b038116600090815260076020908152604091829020825160e081018452905461ffff8082168352620100008204811693830193909352600160201b8104831693820193909352600160301b830482166060820152600160401b830482166080820152600160501b830490911660a0820152600160601b90910460ff16151560c082018190526114ca57506040805160e08101825260055461ffff808216835262010000820481166020840152600160201b8204811693830193909352600160301b810483166060830152600160401b810483166080830152600160501b810490921660a0820152600160601b90910460ff16151560c08201525b919050565b6114d761168e565b6114e5868686868686611968565b505050505050565b6114f561168e565b6001600160a01b03811661153a5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b60448201526064016105de565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fb03f92c8c7ac39710f28b146f754650929499d599a66d51423cbd7f3ceb9aee390600090a35050565b6004546001600160a01b031633146115df5760405162461bcd60e51b81526020600482015260166024820152753737ba10333aba3ab932903332b29036b0b730b3b2b960511b60448201526064016105de565b60048054600180546001600160a01b03199081166001600160a01b0384161790915516905560405133907f772ddcfc9a0f3b1401c0f60000a81999005d9d593b71bb67707c5f326eb7c94d90600090a2565b611639611b9d565b600254611653906001600160a01b03848116911683611bf9565b816001600160a01b03167f962bc326c7b063c70721a63687e0e19450155f93c58eca94769746c0cfb02c5d826040516110a891815260200190565b6001546001600160a01b031633146116d75760405162461bcd60e51b815260206004820152600c60248201526b10b332b29036b0b730b3b2b960a11b60448201526064016105de565b565b6001546001600160a01b03163314806116fc57506003546001600160a01b031633145b6116d75760405162461bcd60e51b815260206004820152600e60248201526d10bb30bab63a1036b0b730b3b2b960911b60448201526064016105de565b3360009081526006602052604090205460ff166116d75760405162461bcd60e51b81526004016105de90612129565b60008183106117775781611779565b825b90505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b03848116602483015282919084169063dd62ed3e90604401602060405180830381865afa1580156117d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f591906120e8565b1015610e1b576118106001600160a01b038316846000611820565b610e1b6001600160a01b03831684835b80158061189a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611874573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189891906120e8565b155b6119055760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105de565b6040516001600160a01b038316602482015260448101829052610e1b90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c29565b60c861ffff871611156119b85760405162461bcd60e51b81526020600482015260186024820152771b585b9859d95b595b9d08199959481d1a1c995cda1bdb1960421b60448201526064016105de565b61138861ffff86161115611a0a5760405162461bcd60e51b81526020600482015260196024820152781c195c999bdc9b585b98d948199959481d1a1c995cda1bdb19603a1b60448201526064016105de565b6127108161ffff161115611a4b5760405162461bcd60e51b81526020600482015260086024820152670e8dede40d0d2ced60c31b60448201526064016105de565b6040805160e0808201835261ffff89811680845289821660208086018290528a84168688018190528a851660608089018290528b87166080808b018290528c891660a0808d01829052600060c09d8e018190526005805463ffffffff1916909b1762010000909a029990991767ffffffff000000001916600160201b90970267ffff000000000000191696909617600160301b909502949094176bffffffff00000000000000001916600160401b90920261ffff60501b191691909117600160501b9093029290921760ff60601b19811690965589518688168152601087901c8816818601529386901c8716848b0152603086901c8716908401529784901c85169782019790975260509290921c90921694810194909452918301919091527fbbcfba7e6e61ab9dbbe4ee1512e1e0c0ff1b236ba707ef51c8f45e7af433b89d910160405180910390a1505050505050565b6002546001600160a01b0316331480611bc057506001546001600160a01b031633145b6116d75760405162461bcd60e51b815260206004820152600a602482015269085c9958da5c1a595b9d60b21b60448201526064016105de565b6040516001600160a01b038316602482015260448101829052610e1b90849063a9059cbb60e01b90606401611931565b6000611c7e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611cfe9092919063ffffffff16565b9050805160001480611c9f575080806020019051810190611c9f9190612258565b610e1b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105de565b6060611d0d8484600085611d15565b949350505050565b606082471015611d765760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105de565b600080866001600160a01b03168587604051611d92919061229e565b60006040518083038185875af1925050503d8060008114611dcf576040519150601f19603f3d011682016040523d82523d6000602084013e611dd4565b606091505b5091509150611de587838387611df0565b979650505050505050565b60608315611e5f578251600003611e58576001600160a01b0385163b611e585760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105de565b5081611d0d565b611d0d8383815115611e745781518083602001fd5b8060405162461bcd60e51b81526004016105de91906122ba565b6001600160a01b038116811461059257600080fd5b600060208284031215611eb557600080fd5b8135611ec081611e8e565b9392505050565b600060208284031215611ed957600080fd5b5035919050565b60008060408385031215611ef357600080fd5b8235611efe81611e8e565b91506020830135611f0e81611e8e565b809150509250929050565b600080600060608486031215611f2e57600080fd5b8335611f3981611e8e565b95602085013595506040909401359392505050565b60008060408385031215611f6157600080fd5b8235611f6c81611e8e565b946020939093013593505050565b803561ffff811681146114ca57600080fd5b600080600080600080600060e0888a031215611fa757600080fd5b8735611fb281611e8e565b9650611fc060208901611f7a565b9550611fce60408901611f7a565b9450611fdc60608901611f7a565b9350611fea60808901611f7a565b9250611ff860a08901611f7a565b915061200660c08901611f7a565b905092959891949750929550565b600060e08201905061ffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401528060a08501511660a08401525060c0830151151560c083015292915050565b60008060008060008060c0878903121561208d57600080fd5b61209687611f7a565b95506120a460208801611f7a565b94506120b260408801611f7a565b93506120c060608801611f7a565b92506120ce60808801611f7a565b91506120dc60a08801611f7a565b90509295509295509295565b6000602082840312156120fa57600080fd5b5051919050565b602081016003831061212357634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252600f908201526e1d985d5b1d081b9bdd081859191959608a1b604082015260600190565b60006080828403121561216457600080fd5b6040516080810181811067ffffffffffffffff8211171561219557634e487b7160e01b600052604160045260246000fd5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561177c5761177c6121c6565b808202811582820484141761177c5761177c6121c6565b60008261222357634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561177c5761177c6121c6565b60006020828403121561224d57600080fd5b8151611ec081611e8e565b60006020828403121561226a57600080fd5b81518015158114611ec057600080fd5b60005b8381101561229557818101518382015260200161227d565b50506000910152565b600082516122b081846020870161227a565b9190910192915050565b60208152600082518060208401526122d981604085016020870161227a565b601f01601f1916919091016040019291505056fea26469706673582212203d5546abc7ae2fb72be8a7bf157b6de8d4d0928c614817dd35df13a4a3f58d7864736f6c6343000812003300000000000000000000000078d4bdebc0b4140f01bab63085f94a5a7a1294f200000000000000000000000078d4bdebc0b4140f01bab63085f94a5a7a1294f2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000004e200000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80639b3b6955116100f9578063d0fb020311610097578063e2a85ce411610071578063e2a85ce4146104e3578063e74b981b146104f6578063f94c53c714610509578063fb9321081461051157600080fd5b8063d0fb02031461049d578063d8609c5b146104b0578063de1eb9a3146104c357600080fd5b8063b53d68e5116100d3578063b53d68e51461043b578063b543503e14610444578063c7c504b914610457578063ceb68c231461048a57600080fd5b80639b3b6955146103a85780639e09ed5f146103bb578063a622ee7c1461040857600080fd5b806363453ae11161016657806382e4dd6f1161014057806382e4dd6f1461033f5780638a4adf241461035a578063921f8a8f1461036d578063962941781461039557600080fd5b806363453ae11461027157806367bee7e9146102845780637b5d7b651461029757600080fd5b8063256b5a02116101a2578063256b5a021461022157806346904840146102345780635783fe39146102475780635cece03a1461025e57600080fd5b8063015cf150146101c957806303579dca146101f957806324be66281461020e575b600080fd5b6004546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61020c610207366004611ea3565b610524565b005b61020c61021c366004611ec7565b610595565b61020c61022f366004611ea3565b610622565b6002546101dc906001600160a01b031681565b61025060005481565b6040519081526020016101f0565b61020c61026c366004611ee0565b6106e3565b61020c61027f366004611ea3565b610757565b61020c610292366004611ea3565b6107c5565b6102fa6102a5366004611ea3565b60076020526000908152604090205461ffff80821691620100008104821691600160201b8204811691600160301b8104821691600160401b8204811691600160501b810490911690600160601b900460ff1687565b6040805161ffff988916815296881660208801529487169486019490945291851660608501528416608084015290921660a082015290151560c082015260e0016101f0565b61034760c881565b60405161ffff90911681526020016101f0565b6003546101dc906001600160a01b031681565b61038061037b366004611f19565b610886565b604080519283526020830191909152016101f0565b61020c6103a3366004611f4e565b610d90565b61020c6103b6366004611ea3565b610e20565b6005546102fa9061ffff80821691620100008104821691600160201b8204811691600160301b8104821691600160401b8204811691600160501b810490911690600160601b900460ff1687565b61042b610416366004611ea3565b60066020526000908152604090205460ff1681565b60405190151581526020016101f0565b61034761138881565b61020c610452366004611ea3565b610eb7565b61042b610465366004611ea3565b6001600160a01b0316600090815260076020526040902054600160601b900460ff1690565b61020c610498366004611ea3565b610f09565b6001546101dc906001600160a01b031681565b61020c6104be366004611f8c565b6110b4565b6104d66104d1366004611ea3565b61138f565b6040516101f09190612014565b61020c6104f1366004612074565b6114cf565b61020c610504366004611ea3565b6114ed565b61020c61158c565b61020c61051f366004611f4e565b611631565b6040516370a0823160e01b81523060048201526105929082906001600160a01b038216906370a0823190602401602060405180830381865afa15801561056e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a391906120e8565b50565b61059d61168e565b6127108111156105e75760405162461bcd60e51b815260206004820152601060248201526f686967686572207468616e203130302560801b60448201526064015b60405180910390fd5b60008190556040518181527f18182e268b61d2aada98f23ade23b0ea133d5b0b6712dbfa682dc6da29941c229060200160405180910390a150565b61062a6116d9565b6001600160a01b03811660009081526006602052604090205460ff16156106835760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481859191959609a1b60448201526064016105de565b6001600160a01b03811660008181526006602052604090819020805460ff1916600190811790915590517fce96c4db32686d3f0011df1abea0ab6c5794b848868dcbece79961fef7e8198d916106d891612101565b60405180910390a250565b6106eb61168e565b6001600160a01b03821660009081526006602052604090205460ff166107235760405162461bcd60e51b81526004016105de90612129565b6001600160a01b0391821660009081526008602090815260408083209390941682529190915220805460ff19166001179055565b6040516370a0823160e01b81523060048201526105929082906001600160a01b038216906370a0823190602401602060405180830381865afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051f91906120e8565b6107cd61168e565b6001600160a01b038116600090815260076020526040902054600160601b900460ff166108315760405162461bcd60e51b8152602060048201526012602482015271139bc818dd5cdd1bdb481999595cc81cd95d60721b60448201526064016105de565b6001600160a01b03811660008181526007602052604080822080546cffffffffffffffffffffffffff19169055517f3e6648a1d6918f893e09d7f2a385f04bdafbf8ad899b255b7f40e02c967b55879190a250565b600080610891611739565b33600090815260076020908152604091829020825160e081018452905461ffff8082168352620100008204811693830193909352600160201b8104831693820193909352600160301b830482166060820152600160401b830482166080820152600160501b830490911660a0820152600160601b90910460ff16151560c0820181905261098957506040805160e08101825260055461ffff808216835262010000820481166020840152600160201b8204811693830193909352600160301b810483166060830152600160401b810483166080830152600160501b810490921660a0820152600160601b90910460ff16151560c08201525b6040516339ebf82360e01b81526001600160a01b038716600482015260009033906339ebf82390602401608060405180830381865afa1580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f49190612152565b825190915061ffff1615610a59576000816020015142610a1491906121dc565b90506301e18558612710846000015161ffff16838560400151610a3791906121ef565b610a4191906121ef565b610a4b9190612206565b610a559190612206565b9450505b8515610b5f573360009081526008602090815260408083206001600160a01b038b16845290915290205460ff1615610abb573360009081526008602090815260408083206001600160a01b038b1684529091529020805460ff19169055610b2d565b608082015161ffff1615610b2d57612710826080015161ffff168260400151610ae491906121ef565b610aee9190612206565b861115610b2d5760405162461bcd60e51b815260206004820152600d60248201526c3a37b79036bab1b41033b0b4b760991b60448201526064016105de565b612710826020015161ffff1687610b4491906121ef565b610b4e9190612206565b610b589085612228565b9350610d4b565b3360009081526008602090815260408083206001600160a01b038b16845290915290205460ff1615610bbb573360009081526008602090815260408083206001600160a01b038b1684529091529020805460ff19169055610c31565b6127108260a0015161ffff161015610c31576127108260a0015161ffff168260400151610be891906121ef565b610bf29190612206565b851115610c315760405162461bcd60e51b815260206004820152600d60248201526c746f6f206d756368206c6f737360981b60448201526064016105de565b604082015161ffff1615610d4b576000336001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca3919061223b565b9050610d36612710846040015161ffff1688610cbf91906121ef565b610cc99190612206565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3191906120e8565b611768565b93508315610d4957610d49338286611782565b505b606082015161ffff1615610d8657610d83612710836060015161ffff1688610d7391906121ef565b610d7d9190612206565b85611768565b93505b5050935093915050565b610d9861168e565b600054604051639f40a7b360e01b8152600481018390523060248201819052604482015260648101919091526001600160a01b03831690639f40a7b3906084016020604051808303816000875af1158015610df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1b91906120e8565b505050565b610e2861168e565b6001600160a01b038116610e6d5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b60448201526064016105de565b600480546001600160a01b0319166001600160a01b0383169081179091556040517fa839c45565e8a86de41783841928f4acde049c2b7160f0ea4d4698220c5af61b90600090a250565b610ebf61168e565b600380546001600160a01b0319166001600160a01b0383169081179091556040517fda833a9122ed0b27d5c78c99315bb3758f1b77fb240db484a67fd0f286b263e590600090a250565b610f116116d9565b6001600160a01b03811660009081526006602052604090205460ff16610f655760405162461bcd60e51b81526020600482015260096024820152681b9bdd08185919195960ba1b60448201526064016105de565b6000816001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc9919061223b565b604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301529192509082169063dd62ed3e90604401602060405180830381865afa158015611019573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103d91906120e8565b15611057576110576001600160a01b038216836000611820565b6001600160a01b03821660008181526006602052604090819020805460ff19169055517fce96c4db32686d3f0011df1abea0ab6c5794b848868dcbece79961fef7e8198d906110a890600290612101565b60405180910390a25050565b6110bc61168e565b6001600160a01b03871660009081526006602052604090205460ff166110f45760405162461bcd60e51b81526004016105de90612129565b60c861ffff871611156111445760405162461bcd60e51b81526020600482015260186024820152771b585b9859d95b595b9d08199959481d1a1c995cda1bdb1960421b60448201526064016105de565b61138861ffff861611156111965760405162461bcd60e51b81526020600482015260196024820152781c195c999bdc9b585b98d948199959481d1a1c995cda1bdb19603a1b60448201526064016105de565b6127108161ffff1611156111d75760405162461bcd60e51b81526020600482015260086024820152670e8dede40d0d2ced60c31b60448201526064016105de565b60006040518060e001604052808861ffff1681526020018761ffff1681526020018661ffff1681526020018561ffff1681526020018461ffff1681526020018361ffff16815260200160011515815250905080600760008a6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a81548161ffff021916908361ffff16021790555060408201518160000160046101000a81548161ffff021916908361ffff16021790555060608201518160000160066101000a81548161ffff021916908361ffff16021790555060808201518160000160086101000a81548161ffff021916908361ffff16021790555060a082015181600001600a6101000a81548161ffff021916908361ffff16021790555060c082015181600001600c6101000a81548160ff021916908315150217905550905050876001600160a01b03167fff2b689837652b4795317128d1dd57305f04ec90d567ff4b921424f1a19e8b0a8260405161137d9190612014565b60405180910390a25050505050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506001600160a01b038116600090815260076020908152604091829020825160e081018452905461ffff8082168352620100008204811693830193909352600160201b8104831693820193909352600160301b830482166060820152600160401b830482166080820152600160501b830490911660a0820152600160601b90910460ff16151560c082018190526114ca57506040805160e08101825260055461ffff808216835262010000820481166020840152600160201b8204811693830193909352600160301b810483166060830152600160401b810483166080830152600160501b810490921660a0820152600160601b90910460ff16151560c08201525b919050565b6114d761168e565b6114e5868686868686611968565b505050505050565b6114f561168e565b6001600160a01b03811661153a5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b60448201526064016105de565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fb03f92c8c7ac39710f28b146f754650929499d599a66d51423cbd7f3ceb9aee390600090a35050565b6004546001600160a01b031633146115df5760405162461bcd60e51b81526020600482015260166024820152753737ba10333aba3ab932903332b29036b0b730b3b2b960511b60448201526064016105de565b60048054600180546001600160a01b03199081166001600160a01b0384161790915516905560405133907f772ddcfc9a0f3b1401c0f60000a81999005d9d593b71bb67707c5f326eb7c94d90600090a2565b611639611b9d565b600254611653906001600160a01b03848116911683611bf9565b816001600160a01b03167f962bc326c7b063c70721a63687e0e19450155f93c58eca94769746c0cfb02c5d826040516110a891815260200190565b6001546001600160a01b031633146116d75760405162461bcd60e51b815260206004820152600c60248201526b10b332b29036b0b730b3b2b960a11b60448201526064016105de565b565b6001546001600160a01b03163314806116fc57506003546001600160a01b031633145b6116d75760405162461bcd60e51b815260206004820152600e60248201526d10bb30bab63a1036b0b730b3b2b960911b60448201526064016105de565b3360009081526006602052604090205460ff166116d75760405162461bcd60e51b81526004016105de90612129565b60008183106117775781611779565b825b90505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b03848116602483015282919084169063dd62ed3e90604401602060405180830381865afa1580156117d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f591906120e8565b1015610e1b576118106001600160a01b038316846000611820565b610e1b6001600160a01b03831684835b80158061189a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611874573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189891906120e8565b155b6119055760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105de565b6040516001600160a01b038316602482015260448101829052610e1b90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c29565b60c861ffff871611156119b85760405162461bcd60e51b81526020600482015260186024820152771b585b9859d95b595b9d08199959481d1a1c995cda1bdb1960421b60448201526064016105de565b61138861ffff86161115611a0a5760405162461bcd60e51b81526020600482015260196024820152781c195c999bdc9b585b98d948199959481d1a1c995cda1bdb19603a1b60448201526064016105de565b6127108161ffff161115611a4b5760405162461bcd60e51b81526020600482015260086024820152670e8dede40d0d2ced60c31b60448201526064016105de565b6040805160e0808201835261ffff89811680845289821660208086018290528a84168688018190528a851660608089018290528b87166080808b018290528c891660a0808d01829052600060c09d8e018190526005805463ffffffff1916909b1762010000909a029990991767ffffffff000000001916600160201b90970267ffff000000000000191696909617600160301b909502949094176bffffffff00000000000000001916600160401b90920261ffff60501b191691909117600160501b9093029290921760ff60601b19811690965589518688168152601087901c8816818601529386901c8716848b0152603086901c8716908401529784901c85169782019790975260509290921c90921694810194909452918301919091527fbbcfba7e6e61ab9dbbe4ee1512e1e0c0ff1b236ba707ef51c8f45e7af433b89d910160405180910390a1505050505050565b6002546001600160a01b0316331480611bc057506001546001600160a01b031633145b6116d75760405162461bcd60e51b815260206004820152600a602482015269085c9958da5c1a595b9d60b21b60448201526064016105de565b6040516001600160a01b038316602482015260448101829052610e1b90849063a9059cbb60e01b90606401611931565b6000611c7e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611cfe9092919063ffffffff16565b9050805160001480611c9f575080806020019051810190611c9f9190612258565b610e1b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105de565b6060611d0d8484600085611d15565b949350505050565b606082471015611d765760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105de565b600080866001600160a01b03168587604051611d92919061229e565b60006040518083038185875af1925050503d8060008114611dcf576040519150601f19603f3d011682016040523d82523d6000602084013e611dd4565b606091505b5091509150611de587838387611df0565b979650505050505050565b60608315611e5f578251600003611e58576001600160a01b0385163b611e585760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105de565b5081611d0d565b611d0d8383815115611e745781518083602001fd5b8060405162461bcd60e51b81526004016105de91906122ba565b6001600160a01b038116811461059257600080fd5b600060208284031215611eb557600080fd5b8135611ec081611e8e565b9392505050565b600060208284031215611ed957600080fd5b5035919050565b60008060408385031215611ef357600080fd5b8235611efe81611e8e565b91506020830135611f0e81611e8e565b809150509250929050565b600080600060608486031215611f2e57600080fd5b8335611f3981611e8e565b95602085013595506040909401359392505050565b60008060408385031215611f6157600080fd5b8235611f6c81611e8e565b946020939093013593505050565b803561ffff811681146114ca57600080fd5b600080600080600080600060e0888a031215611fa757600080fd5b8735611fb281611e8e565b9650611fc060208901611f7a565b9550611fce60408901611f7a565b9450611fdc60608901611f7a565b9350611fea60808901611f7a565b9250611ff860a08901611f7a565b915061200660c08901611f7a565b905092959891949750929550565b600060e08201905061ffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401528060a08501511660a08401525060c0830151151560c083015292915050565b60008060008060008060c0878903121561208d57600080fd5b61209687611f7a565b95506120a460208801611f7a565b94506120b260408801611f7a565b93506120c060608801611f7a565b92506120ce60808801611f7a565b91506120dc60a08801611f7a565b90509295509295509295565b6000602082840312156120fa57600080fd5b5051919050565b602081016003831061212357634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252600f908201526e1d985d5b1d081b9bdd081859191959608a1b604082015260600190565b60006080828403121561216457600080fd5b6040516080810181811067ffffffffffffffff8211171561219557634e487b7160e01b600052604160045260246000fd5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561177c5761177c6121c6565b808202811582820484141761177c5761177c6121c6565b60008261222357634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561177c5761177c6121c6565b60006020828403121561224d57600080fd5b8151611ec081611e8e565b60006020828403121561226a57600080fd5b81518015158114611ec057600080fd5b60005b8381101561229557818101518382015260200161227d565b50506000910152565b600082516122b081846020870161227a565b9190910192915050565b60208152600082518060208401526122d981604085016020870161227a565b601f01601f1916919091016040019291505056fea26469706673582212203d5546abc7ae2fb72be8a7bf157b6de8d4d0928c614817dd35df13a4a3f58d7864736f6c63430008120033

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

00000000000000000000000078d4bdebc0b4140f01bab63085f94a5a7a1294f200000000000000000000000078d4bdebc0b4140f01bab63085f94a5a7a1294f2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000004e200000000000000000000000000000000000000000000000000000000000000001

-----Decoded View---------------
Arg [0] : _feeManager (address): 0x78d4BDEBc0B4140f01BAB63085F94A5a7A1294f2
Arg [1] : _feeRecipient (address): 0x78d4BDEBc0B4140f01BAB63085F94A5a7A1294f2
Arg [2] : defaultManagement (uint16): 0
Arg [3] : defaultPerformance (uint16): 1000
Arg [4] : defaultRefund (uint16): 0
Arg [5] : defaultMaxFee (uint16): 10000
Arg [6] : defaultMaxGain (uint16): 20000
Arg [7] : defaultMaxLoss (uint16): 1

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 00000000000000000000000078d4bdebc0b4140f01bab63085f94a5a7a1294f2
Arg [1] : 00000000000000000000000078d4bdebc0b4140f01bab63085f94a5a7a1294f2
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [6] : 0000000000000000000000000000000000000000000000000000000000004e20
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000001


Deployed Bytecode Sourcemap

70201:21445:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;74308:31;;;;;-1:-1:-1;;;;;74308:31:0;;;;;;-1:-1:-1;;;;;178:32:1;;;160:51;;148:2;133:18;74308:31:0;;;;;;;;87164:140;;;;;;:::i;:::-;;:::i;:::-;;87878:371;;;;;;:::i;:::-;;:::i;79732:276::-;;;;;;:::i;:::-;;:::i;74121:27::-;;;;;-1:-1:-1;;;;;74121:27:0;;;73956:22;;;;;;;;;941:25:1;;;929:2;914:18;73956:22:0;795:177:1;85711:275:0;;;;;;:::i;:::-;;:::i;88410:127::-;;;;;;:::i;:::-;;:::i;85039:385::-;;;;;;:::i;:::-;;:::i;74584:43::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;74584:43:0;;;;;-1:-1:-1;;;74584:43:0;;;;;-1:-1:-1;;;74584:43:0;;;;;-1:-1:-1;;;74584:43:0;;;;;;-1:-1:-1;;;74584:43:0;;;;;;;;;;1677:6:1;1710:15;;;1692:34;;1762:15;;;1757:2;1742:18;;1735:43;1814:15;;;1794:18;;;1787:43;;;;1866:15;;;1861:2;1846:18;;1839:43;1919:15;;1913:3;1898:19;;1891:44;1972:15;;;1966:3;1951:19;;1944:44;2032:14;;2025:22;2019:3;2004:19;;1997:51;1654:3;1639:19;74584:43:0;1370:684:1;73688:53:0;;73738:3;73688:53;;;;;2233:6:1;2221:19;;;2203:38;;2191:2;2176:18;73688:53:0;2059:188:1;74216:27:0;;;;;-1:-1:-1;;;;;74216:27:0;;;75919:3504;;;;;;:::i;:::-;;:::i;:::-;;;;2814:25:1;;;2870:2;2855:18;;2848:34;;;;2787:18;75919:3504:0;2640:248:1;87507:198:0;;;;;;:::i;:::-;;:::i;89147:345::-;;;;;;:::i;:::-;;:::i;74396:24::-;;;;;;;;;;;;;;;;-1:-1:-1;;;74396:24:0;;;;;-1:-1:-1;;;74396:24:0;;;;;-1:-1:-1;;;74396:24:0;;;;;-1:-1:-1;;;74396:24:0;;;;;;-1:-1:-1;;;74396:24:0;;;;;;74477:38;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3378:14:1;;3371:22;3353:41;;3341:2;3326:18;74477:38:0;3213:187:1;73816:56:0;;73867:5;73816:56;;90171:200;;;;;;:::i;:::-;;:::i;86297:145::-;;;;;;:::i;:::-;-1:-1:-1;;;;;86408:19:0;86384:4;86408:19;;;:12;:19;;;;;:26;-1:-1:-1;;;86408:26:0;;;;;86297:145;80201:492;;;;;;:::i;:::-;;:::i;74036:25::-;;;;;-1:-1:-1;;;;;74036:25:0;;;83614:1248;;;;;;:::i;:::-;;:::i;86645:310::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;81304:494::-;;;;;;:::i;:::-;;:::i;90543:387::-;;;;;;:::i;:::-;;:::i;89716:312::-;;;:::i;88747:233::-;;;;;;:::i;:::-;;:::i;87164:140::-;87257:38;;-1:-1:-1;;;87257:38:0;;87289:4;87257:38;;;160:51:1;87233:63:0;;87250:5;;-1:-1:-1;;;;;87257:23:0;;;;;133:18:1;;87257:38:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;87233:63::-;87164:140;:::o;87878:371::-;72393:18;:16;:18::i;:::-;73479:6:::1;88054:8;:19;;88046:48;;;::::0;-1:-1:-1;;;88046:48:0;;5905:2:1;88046:48:0::1;::::0;::::1;5887:21:1::0;5944:2;5924:18;;;5917:30;-1:-1:-1;;;5963:18:1;;;5956:46;6019:18;;88046:48:0::1;;;;;;;;;88107:7;:18:::0;;;88218:23:::1;::::0;941:25:1;;;88218:23:0::1;::::0;929:2:1;914:18;88218:23:0::1;;;;;;;87878:371:::0;:::o;79732:276::-;72483:25;:23;:25::i;:::-;-1:-1:-1;;;;;79881:13:0;::::1;;::::0;;;:6:::1;:13;::::0;;;;;::::1;;79880:14;79872:40;;;::::0;-1:-1:-1;;;79872:40:0;;6250:2:1;79872:40:0::1;::::0;::::1;6232:21:1::0;6289:2;6269:18;;;6262:30;-1:-1:-1;;;6308:18:1;;;6301:43;6361:18;;79872:40:0::1;6048:337:1::0;79872:40:0::1;-1:-1:-1::0;;;;;79925:13:0;::::1;;::::0;;;:6:::1;:13;::::0;;;;;;:20;;-1:-1:-1;;79925:20:0::1;79941:4;79925:20:::0;;::::1;::::0;;;79963:37;;::::1;::::0;::::1;::::0;::::1;:::i;:::-;;;;;;;;79732:276:::0;:::o;85711:275::-;72393:18;:16;:18::i;:::-;-1:-1:-1;;;;;85893:13:0;::::1;;::::0;;;:6:::1;:13;::::0;;;;;::::1;;85885:41;;;;-1:-1:-1::0;;;85885:41:0::1;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;85939:22:0;;::::1;;::::0;;;:15:::1;:22;::::0;;;;;;;:32;;;::::1;::::0;;;;;;;:39;;-1:-1:-1;;85939:39:0::1;85974:4;85939:39;::::0;;85711:275::o;88410:127::-;88491:37;;-1:-1:-1;;;88491:37:0;;88522:4;88491:37;;;160:51:1;88473:56:0;;88484:5;;-1:-1:-1;;;;;88491:22:0;;;;;133:18:1;;88491:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;85039:385::-;72393:18;:16;:18::i;:::-;-1:-1:-1;;;;;85197:19:0;::::1;;::::0;;;:12:::1;:19;::::0;;;;:26;-1:-1:-1;;;85197:26:0;::::1;;;85189:57;;;::::0;-1:-1:-1;;;85189:57:0;;7284:2:1;85189:57:0::1;::::0;::::1;7266:21:1::0;7323:2;7303:18;;;7296:30;-1:-1:-1;;;7342:18:1;;;7335:48;7400:18;;85189:57:0::1;7082:342:1::0;85189:57:0::1;-1:-1:-1::0;;;;;85317:19:0;::::1;;::::0;;;:12:::1;:19;::::0;;;;;85310:26;;-1:-1:-1;;85310:26:0;;;85387:29;::::1;::::0;85317:19;85387:29:::1;85039:385:::0;:::o;75919:3504::-;76091:17;76110:20;72679;:18;:20::i;:::-;76231:10:::1;76201:14;76218:24:::0;;;:12:::1;:24;::::0;;;;;;;;76201:41;;::::1;::::0;::::1;::::0;;;;::::1;::::0;;::::1;::::0;;;;::::1;::::0;::::1;::::0;;::::1;::::0;;;;-1:-1:-1;;;76201:41:0;::::1;::::0;::::1;::::0;;;;;;;-1:-1:-1;;;76201:41:0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;76201:41:0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;76201:41:0;::::1;::::0;;::::1;::::0;;;;-1:-1:-1;;;76201:41:0;;::::1;;;;;::::0;;;;;;76309:106:::1;;-1:-1:-1::0;76384:19:0::1;::::0;;::::1;::::0;::::1;::::0;;76390:13:::1;76384:19:::0;::::1;::::0;;::::1;::::0;;;;::::1;::::0;::::1;;::::0;::::1;::::0;-1:-1:-1;;;76384:19:0;::::1;::::0;::::1;::::0;;;;;;;-1:-1:-1;;;76384:19:0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;76384:19:0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;76384:19:0;::::1;::::0;;::::1;::::0;;;;-1:-1:-1;;;76384:19:0;;::::1;;;;;::::0;;;;76309:106:::1;76532:53;::::0;-1:-1:-1;;;76532:53:0;;-1:-1:-1;;;;;178:32:1;;76532:53:0::1;::::0;::::1;160:51:1::0;76486:43:0::1;::::0;76539:10:::1;::::0;76532:43:::1;::::0;133:18:1;;76532:53:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;76661:17:::0;;76486:99;;-1:-1:-1;76661:21:0::1;;::::0;76657:434:::1;;76744:16;76781:14;:26;;;76763:15;:44;;;;:::i;:::-;76744:63;;73604:10;73479:6;76999:3;:17;;;76923:94;;76970:8;76923:14;:27;;;:55;;;;:::i;:::-;:94;;;;:::i;:::-;76922:123;;;;:::i;:::-;:156;;;;:::i;:::-;76909:170;;76684:407;76657:434;77168:8:::0;;77164:1979:::1;;77276:10;77260:27;::::0;;;:15:::1;:27;::::0;;;;;;;-1:-1:-1;;;;;77260:37:0;::::1;::::0;;;;;;;;::::1;;77256:506;;;77394:10;77418:5;77378:27:::0;;;:15:::1;:27;::::0;;;;;;;-1:-1:-1;;;;;77378:37:0;::::1;::::0;;;;;;;:45;;-1:-1:-1;;77378:45:0::1;::::0;;77256:506:::1;;;77535:11;::::0;::::1;::::0;:15:::1;;::::0;77531:231:::1;;73479:6;77666:3;:11;;;77635:43;;:14;:27;;;:43;;;;:::i;:::-;77634:55;;;;:::i;:::-;77601:4;:88;;77571:175;;;::::0;-1:-1:-1;;;77571:175:0;;9020:2:1;77571:175:0::1;::::0;::::1;9002:21:1::0;9059:2;9039:18;;;9032:30;-1:-1:-1;;;9078:18:1;;;9071:43;9131:18;;77571:175:0::1;8818:337:1::0;77571:175:0::1;73479:6;77800:3;:18;;;77792:27;;:4;:27;;;;:::i;:::-;77791:39;;;;:::i;:::-;77778:52;::::0;;::::1;:::i;:::-;;;77164:1979;;;77946:10;77930:27;::::0;;;:15:::1;:27;::::0;;;;;;;-1:-1:-1;;;;;77930:37:0;::::1;::::0;;;;;;;;::::1;;77926:516;;;78064:10;78088:5;78048:27:::0;;;:15:::1;:27;::::0;;;;;;;-1:-1:-1;;;;;78048:37:0;::::1;::::0;;;;;;;:45;;-1:-1:-1;;78048:45:0::1;::::0;;77926:516:::1;;;73479:6;78209:3;:11;;;:21;;;78205:237;;;73479:6;78346:3;:11;;;78315:43;;:14;:27;;;:43;;;;:::i;:::-;78314:55;;;;:::i;:::-;78281:4;:88;;78251:175;;;::::0;-1:-1:-1;;;78251:175:0;;9492:2:1;78251:175:0::1;::::0;::::1;9474:21:1::0;9531:2;9511:18;;;9504:30;-1:-1:-1;;;9550:18:1;;;9543:43;9603:18;;78251:175:0::1;9290:337:1::0;78251:175:0::1;78507:15;::::0;::::1;::::0;:19:::1;;::::0;78503:629:::1;;78610:13;78633:10;-1:-1:-1::0;;;;;78626:24:0::1;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;78610:42;;78765:146;73479:6;78805:3;:15;;;78797:24;;:4;:24;;;;:::i;:::-;78796:36;;;;:::i;:::-;78855:37;::::0;-1:-1:-1;;;78855:37:0;;78886:4:::1;78855:37;::::0;::::1;160:51:1::0;-1:-1:-1;;;;;78855:22:0;::::1;::::0;::::1;::::0;133:18:1;;78855:37:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;78765:8;:146::i;:::-;78750:161:::0;-1:-1:-1;78936:16:0;;78932:185:::1;;79049:48;79065:10;79077:5;79084:12;79049:15;:48::i;:::-;78528:604;78503:629;79207:10;::::0;::::1;::::0;:14:::1;;::::0;79203:168:::1;;79307:52;73479:6;79325:3;:10;;;79317:19;;:4;:19;;;;:::i;:::-;79316:31;;;;:::i;:::-;79349:9;79307:8;:52::i;:::-;79295:64;;79203:168;79383:32;;75919:3504:::0;;;;;;:::o;87507:198::-;72393:18;:16;:18::i;:::-;87689:7:::1;::::0;87630:67:::1;::::0;-1:-1:-1;;;87630:67:0;;::::1;::::0;::::1;10119:25:1::0;;;87667:4:0::1;10198:18:1::0;;;10191:43;;;10250:18;;;10243:43;10302:18;;;10295:34;;;;-1:-1:-1;;;;;87630:20:0;::::1;::::0;::::1;::::0;10091:19:1;;87630:67:0::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;87507:198:::0;;:::o;89147:345::-;72393:18;:16;:18::i;:::-;-1:-1:-1;;;;;89333:31:0;::::1;89325:56;;;::::0;-1:-1:-1;;;89325:56:0;;10542:2:1;89325:56:0::1;::::0;::::1;10524:21:1::0;10581:2;10561:18;;;10554:30;-1:-1:-1;;;10600:18:1;;;10593:42;10652:18;;89325:56:0::1;10340:336:1::0;89325:56:0::1;89392:16;:36:::0;;-1:-1:-1;;;;;;89392:36:0::1;-1:-1:-1::0;;;;;89392:36:0;::::1;::::0;;::::1;::::0;;;89446:38:::1;::::0;::::1;::::0;-1:-1:-1;;89446:38:0::1;89147:345:::0;:::o;90171:200::-;72393:18;:16;:18::i;:::-;90280:12:::1;:30:::0;;-1:-1:-1;;;;;;90280:30:0::1;-1:-1:-1::0;;;;;90280:30:0;::::1;::::0;;::::1;::::0;;;90328:35:::1;::::0;::::1;::::0;-1:-1:-1;;90328:35:0::1;90171:200:::0;:::o;80201:492::-;72483:25;:23;:25::i;:::-;-1:-1:-1;;;;;80351:13:0;::::1;;::::0;;;:6:::1;:13;::::0;;;;;::::1;;80343:35;;;::::0;-1:-1:-1;;;80343:35:0;;10883:2:1;80343:35:0::1;::::0;::::1;10865:21:1::0;10922:1;10902:18;;;10895:29;-1:-1:-1;;;10940:18:1;;;10933:39;10989:18;;80343:35:0::1;10681:332:1::0;80343:35:0::1;80391:13;80414:5;-1:-1:-1::0;;;;;80407:19:0::1;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;80483:44;::::0;-1:-1:-1;;;80483:44:0;;80514:4:::1;80483:44;::::0;::::1;11230:34:1::0;-1:-1:-1;;;;;11300:15:1;;;11280:18;;;11273:43;80391:37:0;;-1:-1:-1;80483:22:0;;::::1;::::0;::::1;::::0;11165:18:1;;80483:44:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:49:::0;80479:116:::1;;80549:34;-1:-1:-1::0;;;;;80549:24:0;::::1;80574:5:::0;80581:1:::1;80549:24;:34::i;:::-;-1:-1:-1::0;;;;;80607:13:0;::::1;80623:5;80607:13:::0;;;:6:::1;:13;::::0;;;;;;:21;;-1:-1:-1;;80607:21:0::1;::::0;;80646:39;::::1;::::0;::::1;::::0;80666:18:::1;::::0;80646:39:::1;:::i;:::-;;;;;;;;80276:417;80201:492:::0;:::o;83614:1248::-;72393:18;:16;:18::i;:::-;-1:-1:-1;;;;;83957:13:0;::::1;;::::0;;;:6:::1;:13;::::0;;;;;::::1;;83949:41;;;;-1:-1:-1::0;;;83949:41:0::1;;;;;;;:::i;:::-;73738:3;84077:44;::::0;::::1;;;84055:118;;;::::0;-1:-1:-1;;;84055:118:0;;11529:2:1;84055:118:0::1;::::0;::::1;11511:21:1::0;11568:2;11548:18;;;11541:30;-1:-1:-1;;;11587:18:1;;;11580:54;11651:18;;84055:118:0::1;11327:348:1::0;84055:118:0::1;73867:5;84206:46;::::0;::::1;;;84184:121;;;::::0;-1:-1:-1;;;84184:121:0;;11882:2:1;84184:121:0::1;::::0;::::1;11864:21:1::0;11921:2;11901:18;;;11894:30;-1:-1:-1;;;11940:18:1;;;11933:55;12005:18;;84184:121:0::1;11680:349:1::0;84184:121:0::1;73479:6;84324:13;:24;;;;84316:45;;;::::0;-1:-1:-1;;;84316:45:0;;12236:2:1;84316:45:0::1;::::0;::::1;12218:21:1::0;12275:1;12255:18;;;12248:29;-1:-1:-1;;;12293:18:1;;;12286:38;12341:18;;84316:45:0::1;12034:331:1::0;84316:45:0::1;84420:18;84441:286;;;;;;;;84475:16;84441:286;;;;;;84522:17;84441:286;;;;;;84567:12;84441:286;;;;;;84602:12;84441:286;;;;;;84638:13;84441:286;;;;;;84675:13;84441:286;;;;;;84711:4;84441:286;;;;::::0;84420:307:::1;;84792:7;84770:12;:19;84783:5;-1:-1:-1::0;;;;;84770:19:0::1;-1:-1:-1::0;;;;;84770:19:0::1;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84839:5;-1:-1:-1::0;;;;;84817:37:0::1;;84846:7;84817:37;;;;;;:::i;:::-;;;;;;;;83893:969;83614:1248:::0;;;;;;;:::o;86645:310::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86756:19:0;;;;;;:12;:19;;;;;;;;;86750:25;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;86750:25:0;;;;;;;;;;;-1:-1:-1;;;86750:25:0;;;;;;;;-1:-1:-1;;;86750:25:0;;;;;;;;-1:-1:-1;;;86750:25:0;;;;;;;;;-1:-1:-1;;;86750:25:0;;;;;;;;;;;;;86842:106;;-1:-1:-1;86917:19:0;;;;;;;;86923:13;86917:19;;;;;;;;;;;;;;;;-1:-1:-1;;;86917:19:0;;;;;;;;;;;-1:-1:-1;;;86917:19:0;;;;;;;;-1:-1:-1;;;86917:19:0;;;;;;;;-1:-1:-1;;;86917:19:0;;;;;;;;;-1:-1:-1;;;86917:19:0;;;;;;;;;;;86842:106;86645:310;;;:::o;81304:494::-;72393:18;:16;:18::i;:::-;81580:210:::1;81615:17;81647:18;81680:13;81708;81736:14;81765;81580:20;:210::i;:::-;81304:494:::0;;;;;;:::o;90543:387::-;72393:18;:16;:18::i;:::-;-1:-1:-1;;;;;90722:29:0;::::1;90714:54;;;::::0;-1:-1:-1;;;90714:54:0;;10542:2:1;90714:54:0::1;::::0;::::1;10524:21:1::0;10581:2;10561:18;;;10554:30;-1:-1:-1;;;10600:18:1;;;10593:42;10652:18;;90714:54:0::1;10340:336:1::0;90714:54:0::1;90802:12;::::0;;-1:-1:-1;;;;;90825:30:0;;::::1;-1:-1:-1::0;;;;;;90825:30:0;::::1;::::0;::::1;::::0;;;90873:49:::1;::::0;90802:12;::::1;::::0;90825:30;90802:12;;90873:49:::1;::::0;90779:20:::1;::::0;90873:49:::1;90641:289;90543:387:::0;:::o;89716:312::-;89854:16;;-1:-1:-1;;;;;89854:16:0;89840:10;:30;89832:65;;;;-1:-1:-1;;;89832:65:0;;12572:2:1;89832:65:0;;;12554:21:1;12611:2;12591:18;;;12584:30;-1:-1:-1;;;12630:18:1;;;12623:52;12692:18;;89832:65:0;12370:346:1;89832:65:0;89921:16;;;;89908:29;;-1:-1:-1;;;;;;89908:29:0;;;-1:-1:-1;;;;;89921:16:0;;89908:29;;;;89948;;;89995:25;;90009:10;;89995:25;;89921:16;;89995:25;89716:312::o;88747:233::-;72584:29;:27;:29::i;:::-;88901:12:::1;::::0;88875:47:::1;::::0;-1:-1:-1;;;;;88875:25:0;;::::1;::::0;88901:12:::1;88915:6:::0;88875:25:::1;:47::i;:::-;88958:5;-1:-1:-1::0;;;;;88940:32:0::1;;88965:6;88940:32;;;;941:25:1::0;;929:2;914:18;;795:177;72727:118:0;72810:10;;-1:-1:-1;;;;;72810:10:0;72796;:24;72788:49;;;;-1:-1:-1;;;72788:49:0;;12923:2:1;72788:49:0;;;12905:21:1;12962:2;12942:18;;;12935:30;-1:-1:-1;;;12981:18:1;;;12974:42;13033:18;;72788:49:0;12721:336:1;72788:49:0;72727:118::o;72853:194::-;72957:10;;-1:-1:-1;;;;;72957:10:0;72943;:24;;:54;;-1:-1:-1;72985:12:0;;-1:-1:-1;;;;;72985:12:0;72971:10;:26;72943:54;72921:118;;;;-1:-1:-1;;;72921:118:0;;13264:2:1;72921:118:0;;;13246:21:1;13303:2;13283:18;;;13276:30;-1:-1:-1;;;13322:18:1;;;13315:44;13376:18;;72921:118:0;13062:338:1;73257:117:0;73335:10;73328:18;;;;:6;:18;;;;;;;;73320:46;;;;-1:-1:-1;;;73320:46:0;;;;;;;:::i;23253:106::-;23311:7;23342:1;23338;:5;:13;;23350:1;23338:13;;;23346:1;23338:13;23331:20;;23253:106;;;;;:::o;91314:329::-;91449:49;;-1:-1:-1;;;91449:49:0;;91481:4;91449:49;;;11230:34:1;-1:-1:-1;;;;;11300:15:1;;;11280:18;;;11273:43;91501:7:0;;91449:23;;;;;;11165:18:1;;91449:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:59;91445:191;;;91525:39;-1:-1:-1;;;;;91525:25:0;;91551:9;91562:1;91525:25;:39::i;:::-;91579:45;-1:-1:-1;;;;;91579:25:0;;91605:9;91616:7;64825:582;65155:10;;;65154:62;;-1:-1:-1;65171:39:0;;-1:-1:-1;;;65171:39:0;;65195:4;65171:39;;;11230:34:1;-1:-1:-1;;;;;11300:15:1;;;11280:18;;;11273:43;65171:15:0;;;;;11165:18:1;;65171:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:44;65154:62;65132:166;;;;-1:-1:-1;;;65132:166:0;;13607:2:1;65132:166:0;;;13589:21:1;13646:2;13626:18;;;13619:30;13685:34;13665:18;;;13658:62;-1:-1:-1;;;13736:18:1;;;13729:52;13798:19;;65132:166:0;13405:418:1;65132:166:0;65336:62;;-1:-1:-1;;;;;14020:32:1;;65336:62:0;;;14002:51:1;14069:18;;;14062:34;;;65309:90:0;;65329:5;;-1:-1:-1;;;65359:22:0;13975:18:1;;65336:62:0;;;;-1:-1:-1;;65336:62:0;;;;;;;;;;;;;;-1:-1:-1;;;;;65336:62:0;-1:-1:-1;;;;;;65336:62:0;;;;;;;;;;65309:19;:90::i;81949:1060::-;73738:3;82287:45;;;;;82265:119;;;;-1:-1:-1;;;82265:119:0;;11529:2:1;82265:119:0;;;11511:21:1;11568:2;11548:18;;;11541:30;-1:-1:-1;;;11587:18:1;;;11580:54;11651:18;;82265:119:0;11327:348:1;82265:119:0;73867:5;82417:47;;;;;82395:122;;;;-1:-1:-1;;;82395:122:0;;11882:2:1;82395:122:0;;;11864:21:1;11921:2;11901:18;;;11894:30;-1:-1:-1;;;11940:18:1;;;11933:55;12005:18;;82395:122:0;11680:349:1;82395:122:0;73479:6;82536:14;:25;;;;82528:46;;;;-1:-1:-1;;;82528:46:0;;12236:2:1;82528:46:0;;;12218:21:1;12275:1;12255:18;;;12248:29;-1:-1:-1;;;12293:18:1;;;12286:38;12341:18;;82528:46:0;12034:331:1;82528:46:0;82653:293;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;82653:293:0;;;;;;;82637:13;:309;;-1:-1:-1;;82637:309:0;;;;;;;;;;;;-1:-1:-1;;82637:309:0;-1:-1:-1;;;82637:309:0;;;-1:-1:-1;;82637:309:0;;;;;-1:-1:-1;;;82637:309:0;;;;;;;-1:-1:-1;;82637:309:0;-1:-1:-1;;;82637:309:0;;;-1:-1:-1;;;;82637:309:0;;;;;-1:-1:-1;;;82637:309:0;;;;;;;-1:-1:-1;;;;82637:309:0;;;;;82964:37;;14375:18:1;;;14357:37;;14440:2;14436:18;;;14432:27;;14410:20;;;14403:57;14502:20;;;;14498:29;;14476:20;;;14469:59;14574:2;14570:18;;;14566:27;;14544:20;;;14537:57;14636:20;;;;14632:29;;14610:20;;;14603:59;;;;14708:2;14704:18;;;;14700:27;;;14678:20;;;14671:57;;;;14744:20;;;14737:77;;;;82964:37:0;;14265:19:1;82964:37:0;;;;;;;81949:1060;;;;;;:::o;73055:194::-;73163:12;;-1:-1:-1;;;;;73163:12:0;73149:10;:26;;:54;;-1:-1:-1;73193:10:0;;-1:-1:-1;;;;;73193:10:0;73179;:24;73149:54;73127:114;;;;-1:-1:-1;;;73127:114:0;;15027:2:1;73127:114:0;;;15009:21:1;15066:2;15046:18;;;15039:30;-1:-1:-1;;;15085:18:1;;;15078:40;15135:18;;73127:114:0;14825:334:1;63929:177:0;64039:58;;-1:-1:-1;;;;;14020:32:1;;64039:58:0;;;14002:51:1;14069:18;;;14062:34;;;64012:86:0;;64032:5;;-1:-1:-1;;;64062:23:0;13975:18:1;;64039:58:0;13828:274:1;68275:649:0;68699:23;68725:69;68753:4;68725:69;;;;;;;;;;;;;;;;;68733:5;-1:-1:-1;;;;;68725:27:0;;;:69;;;;;:::i;:::-;68699:95;;68813:10;:17;68834:1;68813:22;:56;;;;68850:10;68839:30;;;;;;;;;;;;:::i;:::-;68805:111;;;;-1:-1:-1;;;68805:111:0;;15648:2:1;68805:111:0;;;15630:21:1;15687:2;15667:18;;;15660:30;15726:34;15706:18;;;15699:62;-1:-1:-1;;;15777:18:1;;;15770:40;15827:19;;68805:111:0;15446:406:1;57811:229:0;57948:12;57980:52;58002:6;58010:4;58016:1;58019:12;57980:21;:52::i;:::-;57973:59;57811:229;-1:-1:-1;;;;57811:229:0:o;58897:455::-;59067:12;59125:5;59100:21;:30;;59092:81;;;;-1:-1:-1;;;59092:81:0;;16059:2:1;59092:81:0;;;16041:21:1;16098:2;16078:18;;;16071:30;16137:34;16117:18;;;16110:62;-1:-1:-1;;;16188:18:1;;;16181:36;16234:19;;59092:81:0;15857:402:1;59092:81:0;59185:12;59199:23;59226:6;-1:-1:-1;;;;;59226:11:0;59245:5;59252:4;59226:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;59184:73;;;;59275:69;59302:6;59310:7;59319:10;59331:12;59275:26;:69::i;:::-;59268:76;58897:455;-1:-1:-1;;;;;;;58897:455:0:o;61470:644::-;61655:12;61684:7;61680:427;;;61712:10;:17;61733:1;61712:22;61708:290;;-1:-1:-1;;;;;55351:19:0;;;61922:60;;;;-1:-1:-1;;;61922:60:0;;17013:2:1;61922:60:0;;;16995:21:1;17052:2;17032:18;;;17025:30;17091:31;17071:18;;;17064:59;17140:18;;61922:60:0;16811:353:1;61922:60:0;-1:-1:-1;62019:10:0;62012:17;;61680:427;62062:33;62070:10;62082:12;62817:17;;:21;62813:388;;63049:10;63043:17;63106:15;63093:10;63089:2;63085:19;63078:44;62813:388;63176:12;63169:20;;-1:-1:-1;;;63169:20:0;;;;;;;;:::i;222:131:1:-;-1:-1:-1;;;;;297:31:1;;287:42;;277:70;;343:1;340;333:12;358:247;417:6;470:2;458:9;449:7;445:23;441:32;438:52;;;486:1;483;476:12;438:52;525:9;512:23;544:31;569:5;544:31;:::i;:::-;594:5;358:247;-1:-1:-1;;;358:247:1:o;610:180::-;669:6;722:2;710:9;701:7;697:23;693:32;690:52;;;738:1;735;728:12;690:52;-1:-1:-1;761:23:1;;610:180;-1:-1:-1;610:180:1:o;977:388::-;1045:6;1053;1106:2;1094:9;1085:7;1081:23;1077:32;1074:52;;;1122:1;1119;1112:12;1074:52;1161:9;1148:23;1180:31;1205:5;1180:31;:::i;:::-;1230:5;-1:-1:-1;1287:2:1;1272:18;;1259:32;1300:33;1259:32;1300:33;:::i;:::-;1352:7;1342:17;;;977:388;;;;;:::o;2252:383::-;2329:6;2337;2345;2398:2;2386:9;2377:7;2373:23;2369:32;2366:52;;;2414:1;2411;2404:12;2366:52;2453:9;2440:23;2472:31;2497:5;2472:31;:::i;:::-;2522:5;2574:2;2559:18;;2546:32;;-1:-1:-1;2625:2:1;2610:18;;;2597:32;;2252:383;-1:-1:-1;;;2252:383:1:o;2893:315::-;2961:6;2969;3022:2;3010:9;3001:7;2997:23;2993:32;2990:52;;;3038:1;3035;3028:12;2990:52;3077:9;3064:23;3096:31;3121:5;3096:31;:::i;:::-;3146:5;3198:2;3183:18;;;;3170:32;;-1:-1:-1;;;2893:315:1:o;3405:159::-;3472:20;;3532:6;3521:18;;3511:29;;3501:57;;3554:1;3551;3544:12;3569:683;3676:6;3684;3692;3700;3708;3716;3724;3777:3;3765:9;3756:7;3752:23;3748:33;3745:53;;;3794:1;3791;3784:12;3745:53;3833:9;3820:23;3852:31;3877:5;3852:31;:::i;:::-;3902:5;-1:-1:-1;3926:37:1;3959:2;3944:18;;3926:37;:::i;:::-;3916:47;;3982:37;4015:2;4004:9;4000:18;3982:37;:::i;:::-;3972:47;;4038:37;4071:2;4060:9;4056:18;4038:37;:::i;:::-;4028:47;;4094:38;4127:3;4116:9;4112:19;4094:38;:::i;:::-;4084:48;;4151:38;4184:3;4173:9;4169:19;4151:38;:::i;:::-;4141:48;;4208:38;4241:3;4230:9;4226:19;4208:38;:::i;:::-;4198:48;;3569:683;;;;;;;;;;:::o;4257:700::-;4391:4;4433:3;4422:9;4418:19;4410:27;;4456:6;4508:2;4499:6;4493:13;4489:22;4478:9;4471:41;4580:2;4572:4;4564:6;4560:17;4554:24;4550:33;4543:4;4532:9;4528:20;4521:63;4652:2;4644:4;4636:6;4632:17;4626:24;4622:33;4615:4;4604:9;4600:20;4593:63;4724:2;4716:4;4708:6;4704:17;4698:24;4694:33;4687:4;4676:9;4672:20;4665:63;4796:2;4788:4;4780:6;4776:17;4770:24;4766:33;4759:4;4748:9;4744:20;4737:63;4868:2;4860:4;4852:6;4848:17;4842:24;4838:33;4831:4;4820:9;4816:20;4809:63;;4942:4;4934:6;4930:17;4924:24;4917:32;4910:40;4903:4;4892:9;4888:20;4881:70;4257:700;;;;:::o;4962:547::-;5060:6;5068;5076;5084;5092;5100;5153:3;5141:9;5132:7;5128:23;5124:33;5121:53;;;5170:1;5167;5160:12;5121:53;5193:28;5211:9;5193:28;:::i;:::-;5183:38;;5240:37;5273:2;5262:9;5258:18;5240:37;:::i;:::-;5230:47;;5296:37;5329:2;5318:9;5314:18;5296:37;:::i;:::-;5286:47;;5352:37;5385:2;5374:9;5370:18;5352:37;:::i;:::-;5342:47;;5408:38;5441:3;5430:9;5426:19;5408:38;:::i;:::-;5398:48;;5465:38;5498:3;5487:9;5483:19;5465:38;:::i;:::-;5455:48;;4962:547;;;;;;;;:::o;5514:184::-;5584:6;5637:2;5625:9;5616:7;5612:23;5608:32;5605:52;;;5653:1;5650;5643:12;5605:52;-1:-1:-1;5676:16:1;;5514:184;-1:-1:-1;5514:184:1:o;6390:343::-;6537:2;6522:18;;6570:1;6559:13;;6549:144;;6615:10;6610:3;6606:20;6603:1;6596:31;6650:4;6647:1;6640:15;6678:4;6675:1;6668:15;6549:144;6702:25;;;6390:343;:::o;6738:339::-;6940:2;6922:21;;;6979:2;6959:18;;;6952:30;-1:-1:-1;;;7013:2:1;6998:18;;6991:45;7068:2;7053:18;;6738:339::o;7429:724::-;7530:6;7583:3;7571:9;7562:7;7558:23;7554:33;7551:53;;;7600:1;7597;7590:12;7551:53;7633:2;7627:9;7675:3;7667:6;7663:16;7745:6;7733:10;7730:22;7709:18;7697:10;7694:34;7691:62;7688:185;;;7795:10;7790:3;7786:20;7783:1;7776:31;7830:4;7827:1;7820:15;7858:4;7855:1;7848:15;7688:185;7893:10;7889:2;7882:22;;7934:9;7928:16;7920:6;7913:32;7999:2;7988:9;7984:18;7978:25;7973:2;7965:6;7961:15;7954:50;8058:2;8047:9;8043:18;8037:25;8032:2;8024:6;8020:15;8013:50;8117:2;8106:9;8102:18;8096:25;8091:2;8083:6;8079:15;8072:50;8141:6;8131:16;;;7429:724;;;;:::o;8158:127::-;8219:10;8214:3;8210:20;8207:1;8200:31;8250:4;8247:1;8240:15;8274:4;8271:1;8264:15;8290:128;8357:9;;;8378:11;;;8375:37;;;8392:18;;:::i;8423:168::-;8496:9;;;8527;;8544:15;;;8538:22;;8524:37;8514:71;;8565:18;;:::i;8596:217::-;8636:1;8662;8652:132;;8706:10;8701:3;8697:20;8694:1;8687:31;8741:4;8738:1;8731:15;8769:4;8766:1;8759:15;8652:132;-1:-1:-1;8798:9:1;;8596:217::o;9160:125::-;9225:9;;;9246:10;;;9243:36;;;9259:18;;:::i;9632:251::-;9702:6;9755:2;9743:9;9734:7;9730:23;9726:32;9723:52;;;9771:1;9768;9761:12;9723:52;9803:9;9797:16;9822:31;9847:5;9822:31;:::i;15164:277::-;15231:6;15284:2;15272:9;15263:7;15259:23;15255:32;15252:52;;;15300:1;15297;15290:12;15252:52;15332:9;15326:16;15385:5;15378:13;15371:21;15364:5;15361:32;15351:60;;15407:1;15404;15397:12;16264:250;16349:1;16359:113;16373:6;16370:1;16367:13;16359:113;;;16449:11;;;16443:18;16430:11;;;16423:39;16395:2;16388:10;16359:113;;;-1:-1:-1;;16506:1:1;16488:16;;16481:27;16264:250::o;16519:287::-;16648:3;16686:6;16680:13;16702:66;16761:6;16756:3;16749:4;16741:6;16737:17;16702:66;:::i;:::-;16784:16;;;;;16519:287;-1:-1:-1;;16519:287:1:o;17169:396::-;17318:2;17307:9;17300:21;17281:4;17350:6;17344:13;17393:6;17388:2;17377:9;17373:18;17366:34;17409:79;17481:6;17476:2;17465:9;17461:18;17456:2;17448:6;17444:15;17409:79;:::i;:::-;17549:2;17528:15;-1:-1:-1;;17524:29:1;17509:45;;;;17556:2;17505:54;;17169:396;-1:-1:-1;;17169:396:1:o

Swarm Source

ipfs://3d5546abc7ae2fb72be8a7bf157b6de8d4d0928c614817dd35df13a4a3f58d78

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.