ETH Price: $3,402.80 (-7.46%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer206907922024-09-06 9:55:11123 days ago1725616511IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000697273.12677143
Approve206747712024-09-04 4:16:59125 days ago1725423419IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000033911.4
Approve206684822024-09-03 7:13:35126 days ago1725347615IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000064651.3968914
Approve205042422024-08-11 8:40:59149 days ago1723365659IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000032051.31994843
Approve204883212024-08-09 3:21:47151 days ago1723173707IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000104862.2646427
Approve202156302024-07-02 1:43:59189 days ago1719884639IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000078871.70506543
Approve201790452024-06-26 23:08:59195 days ago1719443339IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.00021364.61402964
Approve201647942024-06-24 23:23:11197 days ago1719271391IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000186474.02800405
Approve200673122024-06-11 8:11:47210 days ago1718093507IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000133685.50419434
Approve200672782024-06-11 8:04:59210 days ago1718093099IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000257285.55885848
Approve199378222024-05-24 6:01:59228 days ago1716530519IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0003019112.43118522
Approve199097312024-05-20 7:44:59232 days ago1716191099IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000153983.32525717
Approve198987592024-05-18 18:56:35234 days ago1716058595IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000134582.9070361
Approve197823392024-05-02 12:08:23250 days ago1714651703IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0003185413.11606955
Approve197823372024-05-02 12:07:59250 days ago1714651679IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0003615414.88643237
Approve197823372024-05-02 12:07:59250 days ago1714651679IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0003606514.88643237
Approve197823362024-05-02 12:07:47250 days ago1714651667IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000349414.3863595
Approve196808192024-04-18 7:21:23264 days ago1713424883IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0002999310.29450692
Approve196808112024-04-18 7:19:47264 days ago1713424787IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000258959.83767526
Approve196807652024-04-18 7:10:35264 days ago1713424235IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0002984111.33649382
Approve196807572024-04-18 7:08:59264 days ago1713424139IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0002797810.62886511
Approve196807522024-04-18 7:07:59264 days ago1713424079IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.0003093211.75114904
Approve196798022024-04-18 3:57:23264 days ago1713412643IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000229658.72458088
Approve196797712024-04-18 3:51:11264 days ago1713412271IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000218938.31712359
Approve196797632024-04-18 3:49:35264 days ago1713412175IN
Pendle: SY-FRAXUSDC_CurveLP Convex Token
0 ETH0.000385298.33551082
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PendleCurveFraxUsdcSY

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 90000 runs

Other Settings:
default evmVersion
File 1 of 34 : PendleCurveFraxUsdcSY.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "./base/PendleConvexLPSY.sol";
import "./base/CurveFraxUsdcPoolHelper.sol";
import "../../../libraries/ArrayLib.sol";

contract PendleCurveFraxUsdcSY is PendleConvexLPSY {
    using ArrayLib for address[];

    uint256 public constant PID = 100;

    address public constant FRAX = CurveFraxUsdcPoolHelper.FRAX;
    address public constant USDC = CurveFraxUsdcPoolHelper.USDC;

    constructor(string memory _name, string memory _symbol)
        PendleConvexLPSY(
            _name,
            _symbol,
            PID,
            CurveFraxUsdcPoolHelper.LP,
            CurveFraxUsdcPoolHelper.POOL
        )
    {
        _safeApproveInf(FRAX, crvPool);
        _safeApproveInf(USDC, crvPool);
    }

    function _depositToCurve(address tokenIn, uint256 amountTokenToDeposit)
        internal
        virtual
        override
        returns (uint256 amountLpOut)
    {
        uint256[2] memory amounts;
        amounts[_getIndex(tokenIn)] = amountTokenToDeposit;
        amountLpOut = ICrvPool(crvPool).add_liquidity(amounts, 0);
    }

    function _redeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
        internal
        virtual
        override
        returns (uint256 amountTokenOut)
    {
        amountTokenOut = ICrvPool(crvPool).remove_liquidity_one_coin(
            amountLpToRedeem,
            Math.Int128(_getIndex(tokenOut)),
            0
        );
    }

    function _previewDepositToCurve(address tokenIn, uint256 amountTokenToDeposit)
        internal
        view
        virtual
        override
        returns (uint256)
    {
        return CurveFraxUsdcPoolHelper.previewAddLiquidity(tokenIn, amountTokenToDeposit);
    }

    function _previewRedeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
        internal
        view
        virtual
        override
        returns (uint256)
    {
        return
            ICrvPool(crvPool).calc_withdraw_one_coin(
                amountLpToRedeem,
                Math.Int128(_getIndex(tokenOut))
            );
    }

    function _getIndex(address token) internal pure returns (uint256) {
        return (token == FRAX ? 0 : 1);
    }

    function getTokensIn() public view virtual override returns (address[] memory res) {
        res = new address[](3);
        res[0] = crvLp;
        res[1] = FRAX;
        res[2] = USDC;
    }

    function getTokensOut() public view virtual override returns (address[] memory res) {
        res = new address[](3);
        res[0] = crvLp;
        res[1] = FRAX;
        res[2] = USDC;
    }

    function isValidTokenIn(address token) public view virtual override returns (bool res) {
        res = (token == crvLp || token == FRAX || token == USDC);
    }

    function isValidTokenOut(address token) public view override returns (bool res) {
        res = (token == crvLp || token == FRAX || token == USDC);
    }
}

File 2 of 34 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 3 of 34 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 4 of 34 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 34 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

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

        _beforeTokenTransfer(from, to, amount);

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

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 34 : draft-ERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/draft-ERC20Permit.sol)

pragma solidity ^0.8.0;

import "./draft-IERC20Permit.sol";
import "../ERC20.sol";
import "../../../utils/cryptography/draft-EIP712.sol";
import "../../../utils/cryptography/ECDSA.sol";
import "../../../utils/Counters.sol";

/**
 * @dev Implementation 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.
 *
 * _Available since v3.4._
 */
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
    using Counters for Counters.Counter;

    mapping(address => Counters.Counter) private _nonces;

    // solhint-disable-next-line var-name-mixedcase
    bytes32 private constant _PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    /**
     * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.
     * However, to ensure consistency with the upgradeable transpiler, we will continue
     * to reserve a slot.
     * @custom:oz-renamed-from _PERMIT_TYPEHASH
     */
    // solhint-disable-next-line var-name-mixedcase
    bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;

    /**
     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
     *
     * It's a good idea to use the same `name` that is defined as the ERC20 token name.
     */
    constructor(string memory name) EIP712(name, "1") {}

    /**
     * @dev See {IERC20Permit-permit}.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual override {
        require(block.timestamp <= deadline, "ERC20Permit: expired deadline");

        bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));

        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSA.recover(hash, v, r, s);
        require(signer == owner, "ERC20Permit: invalid signature");

        _approve(owner, spender, value);
    }

    /**
     * @dev See {IERC20Permit-nonces}.
     */
    function nonces(address owner) public view virtual override returns (uint256) {
        return _nonces[owner].current();
    }

    /**
     * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view override returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev "Consume a nonce": return the current value and increment.
     *
     * _Available since v4.1._
     */
    function _useNonce(address owner) internal virtual returns (uint256 current) {
        Counters.Counter storage nonce = _nonces[owner];
        current = nonce.current();
        nonce.increment();
    }
}

File 7 of 34 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 8 of 34 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.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);
}

File 9 of 34 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 10 of 34 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

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

File 11 of 34 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

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

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

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

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 34 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 13 of 34 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 14 of 34 : draft-EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

File 15 of 34 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 16 of 34 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

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

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

File 17 of 34 : PendleERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";

/**
 * @dev Pendle's ERC20 implementation, modified from @openzeppelin implementation
 * Changes are:
 * - comes with built-in reentrancy protection, storage-packed with totalSupply variable
 * - delete increaseAllowance / decreaseAllowance
 * - add nonReentrancy protection to transfer / transferFrom functions
 * - allow decimals to be passed in
 * - block self-transfer by default
 */
// solhint-disable
contract PendleERC20 is Context, IERC20, IERC20Metadata {
    uint8 private constant _NOT_ENTERED = 1;
    uint8 private constant _ENTERED = 2;

    mapping(address => uint256) private _balances;

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

    uint248 private _totalSupply;
    uint8 private _status;

    string private _name;
    string private _symbol;
    uint8 public immutable decimals;

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

    /**
     * @dev Sets the values for {name}, {symbol} and {decimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(
        string memory name_,
        string memory symbol_,
        uint8 decimals_
    ) {
        _name = name_;
        _symbol = symbol_;
        decimals = decimals_;
        _status = _NOT_ENTERED;
    }

    /**
     * @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 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)
        external
        virtual
        override
        nonReentrant
        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) external 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
    ) external virtual override nonReentrant returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * 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");
        require(from != to, "ERC20: transfer to self");

        _beforeTokenTransfer(from, to, amount);

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

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

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

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

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

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

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= toUint248(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 {}

    function toUint248(uint256 x) internal virtual returns (uint248) {
        require(x <= type(uint248).max); // signed, lim = bit-1
        return uint248(x);
    }
}

File 18 of 34 : PendleERC20Permit.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./PendleERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

/// @dev forked from OZ's ERC20Permit
contract PendleERC20Permit is PendleERC20, IERC20Permit, EIP712 {
    using Counters for Counters.Counter;

    mapping(address => Counters.Counter) private _nonces;

    // solhint-disable-next-line var-name-mixedcase
    bytes32 private constant _PERMIT_TYPEHASH =
        keccak256(
            "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
        );

    constructor(
        string memory name_,
        string memory symbol_,
        uint8 decimals_
    ) PendleERC20(name_, symbol_, decimals_) EIP712(name_, "1") {}

    /**
     * @dev See {IERC20Permit-permit}.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual override {
        require(block.timestamp <= deadline, "ERC20Permit: expired deadline");

        bytes32 structHash = keccak256(
            abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)
        );

        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSA.recover(hash, v, r, s);
        require(signer == owner, "ERC20Permit: invalid signature");

        _approve(owner, spender, value);
    }

    /**
     * @dev See {IERC20Permit-nonces}.
     */
    function nonces(address owner) public view virtual override returns (uint256) {
        return _nonces[owner].current();
    }

    /**
     * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view override returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev "Consume a nonce": return the current value and increment.
     *
     * _Available since v4.1._
     */
    function _useNonce(address owner) internal virtual returns (uint256 current) {
        Counters.Counter storage nonce = _nonces[owner];
        current = nonce.current();
        nonce.increment();
    }
}

File 19 of 34 : ArrayLib.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;

library ArrayLib {
    function sum(uint256[] memory input) internal pure returns (uint256) {
        uint256 value = 0;
        for (uint256 i = 0; i < input.length; ) {
            value += input[i];
            unchecked {
                i++;
            }
        }
        return value;
    }

    function contains(address[] memory array, address element) internal pure returns (bool) {
        uint256 length = array.length;
        for (uint256 i = 0; i < length; ) {
            if (array[i] == element) return true;
            unchecked {
                i++;
            }
        }
        return false;
    }

    function append(address[] memory inp, address element)
        internal
        pure
        returns (address[] memory out)
    {
        uint256 length = inp.length;
        out = new address[](length + 1);
        for (uint256 i = 0; i < length; ) {
            out[i] = inp[i];
            unchecked {
                i++;
            }
        }
        out[length] = element;
    }
}

File 20 of 34 : BoringOwnableUpgradeable.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract BoringOwnableUpgradeableData {
    address public owner;
    address public pendingOwner;
}

abstract contract BoringOwnableUpgradeable is BoringOwnableUpgradeableData, Initializable {
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    function __BoringOwnable_init() internal onlyInitializing {
        owner = msg.sender;
    }

    /// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
    /// Can only be invoked by the current `owner`.
    /// @param newOwner Address of the new owner.
    /// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
    /// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
    function transferOwnership(
        address newOwner,
        bool direct,
        bool renounce
    ) public onlyOwner {
        if (direct) {
            // Checks
            require(newOwner != address(0) || renounce, "Ownable: zero address");

            // Effects
            emit OwnershipTransferred(owner, newOwner);
            owner = newOwner;
            pendingOwner = address(0);
        } else {
            // Effects
            pendingOwner = newOwner;
        }
    }

    /// @notice Needs to be called by `pendingOwner` to claim ownership.
    function claimOwnership() public {
        address _pendingOwner = pendingOwner;

        // Checks
        require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");

        // Effects
        emit OwnershipTransferred(owner, _pendingOwner);
        owner = _pendingOwner;
        pendingOwner = address(0);
    }

    /// @notice Only allows the `owner` to execute the function.
    modifier onlyOwner() {
        require(msg.sender == owner, "Ownable: caller is not the owner");
        _;
    }

    uint256[48] private __gap;
}

File 21 of 34 : Errors.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

/// Adapted from UniswapV3's Oracle

library Errors {
    // BulkSeller
    error BulkInsufficientSyForTrade(uint256 currentAmount, uint256 requiredAmount);
    error BulkInsufficientTokenForTrade(uint256 currentAmount, uint256 requiredAmount);
    error BulkInSufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
    error BulkInSufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
    error BulkInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
    error BulkNotMaintainer();
    error BulkNotAdmin();
    error BulkSellerAlreadyExisted(address token, address SY, address bulk);
    error BulkSellerInvalidToken(address token, address SY);
    error BulkBadRateTokenToSy(uint256 actualRate, uint256 currentRate, uint256 eps);
    error BulkBadRateSyToToken(uint256 actualRate, uint256 currentRate, uint256 eps);

    // APPROX
    error ApproxFail();
    error ApproxParamsInvalid(uint256 guessMin, uint256 guessMax, uint256 eps);
    error ApproxBinarySearchInputInvalid(
        uint256 approxGuessMin,
        uint256 approxGuessMax,
        uint256 minGuessMin,
        uint256 maxGuessMax
    );

    // MARKET + MARKET MATH CORE
    error MarketExpired();
    error MarketZeroAmountsInput();
    error MarketZeroAmountsOutput();
    error MarketZeroLnImpliedRate();
    error MarketInsufficientPtForTrade(int256 currentAmount, int256 requiredAmount);
    error MarketInsufficientPtReceived(uint256 actualBalance, uint256 requiredBalance);
    error MarketInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
    error MarketZeroTotalPtOrTotalAsset(int256 totalPt, int256 totalAsset);
    error MarketExchangeRateBelowOne(int256 exchangeRate);
    error MarketProportionMustNotEqualOne();
    error MarketRateScalarBelowZero(int256 rateScalar);
    error MarketScalarRootBelowZero(int256 scalarRoot);
    error MarketProportionTooHigh(int256 proportion, int256 maxProportion);

    error OracleUninitialized();
    error OracleTargetTooOld(uint32 target, uint32 oldest);
    error OracleZeroCardinality();

    error MarketFactoryExpiredPt();
    error MarketFactoryInvalidPt();
    error MarketFactoryMarketExists();

    error MarketFactoryLnFeeRateRootTooHigh(uint80 lnFeeRateRoot, uint256 maxLnFeeRateRoot);
    error MarketFactoryReserveFeePercentTooHigh(
        uint8 reserveFeePercent,
        uint8 maxReserveFeePercent
    );
    error MarketFactoryZeroTreasury();
    error MarketFactoryInitialAnchorTooLow(int256 initialAnchor, int256 minInitialAnchor);

    // ROUTER
    error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
    error RouterInsufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
    error RouterInsufficientPtOut(uint256 actualPtOut, uint256 requiredPtOut);
    error RouterInsufficientYtOut(uint256 actualYtOut, uint256 requiredYtOut);
    error RouterInsufficientPYOut(uint256 actualPYOut, uint256 requiredPYOut);
    error RouterInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
    error RouterExceededLimitSyIn(uint256 actualSyIn, uint256 limitSyIn);
    error RouterExceededLimitPtIn(uint256 actualPtIn, uint256 limitPtIn);
    error RouterExceededLimitYtIn(uint256 actualYtIn, uint256 limitYtIn);
    error RouterInsufficientSyRepay(uint256 actualSyRepay, uint256 requiredSyRepay);
    error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
    error RouterNotAllSyUsed(uint256 netSyDesired, uint256 netSyUsed);

    error RouterTimeRangeZero();
    error RouterCallbackNotPendleMarket(address caller);
    error RouterInvalidAction(bytes4 selector);

    error RouterKyberSwapDataZero();

    // YIELD CONTRACT
    error YCExpired();
    error YCNotExpired();
    error YieldContractInsufficientSy(uint256 actualSy, uint256 requiredSy);
    error YCNothingToRedeem();
    error YCPostExpiryDataNotSet();
    error YCNoFloatingSy();

    // YieldFactory
    error YCFactoryInvalidExpiry();
    error YCFactoryYieldContractExisted();
    error YCFactoryZeroExpiryDivisor();
    error YCFactoryZeroTreasury();
    error YCFactoryInterestFeeRateTooHigh(uint256 interestFeeRate, uint256 maxInterestFeeRate);
    error YCFactoryRewardFeeRateTooHigh(uint256 newRewardFeeRate, uint256 maxRewardFeeRate);

    // SY
    error SYInvalidTokenIn(address token);
    error SYInvalidTokenOut(address token);
    error SYZeroDeposit();
    error SYZeroRedeem();
    error SYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
    error SYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);

    // SY-specific
    error SYQiTokenMintFailed(uint256 errCode);
    error SYQiTokenRedeemFailed(uint256 errCode);
    error SYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
    error SYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);

    error SYCurveInvalidPid();
    error SYCurve3crvPoolNotFound();

    // Liquidity Mining
    error VCInactivePool(address pool);
    error VCPoolAlreadyActive(address pool);
    error VCZeroVePendle(address user);
    error VCExceededMaxWeight(uint256 totalWeight, uint256 maxWeight);
    error VCEpochNotFinalized(uint256 wTime);
    error VCPoolAlreadyAddAndRemoved(address pool);

    error VEInvalidNewExpiry(uint256 newExpiry);
    error VEExceededMaxLockTime();
    error VEInsufficientLockTime();
    error VENotAllowedReduceExpiry();
    error VEZeroAmountLocked();
    error VEPositionNotExpired();
    error VEZeroPosition();
    error VEZeroSlope(uint128 bias, uint128 slope);
    error VEReceiveOldSupply(uint256 msgTime);

    error GCNotPendleMarket(address caller);
    error GCNotVotingController(address caller);

    error InvalidWTime(uint256 wTime);
    error ExpiryInThePast(uint256 expiry);
    error ChainNotSupported(uint256 chainId);

    error FDCantFundFutureEpoch();
    error FDFactoryDistributorAlreadyExisted(address pool, address distributor);

    // Cross-Chain
    error MsgNotFromSendEndpoint(uint16 srcChainId, bytes path);
    error MsgNotFromReceiveEndpoint(address sender);
    error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee);
    error ApproxDstExecutionGasNotSet();
    error InvalidRetryData();

    // GENERIC MSG
    error ArrayLengthMismatch();
    error ArrayEmpty();
    error ArrayOutOfBounds();
    error ZeroAddress();

    error OnlyLayerZeroEndpoint();
    error OnlyYT();
    error OnlyYCFactory();
    error OnlyWhitelisted();
}

File 22 of 34 : Math.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity 0.8.17;

/* solhint-disable private-vars-leading-underscore, reason-string */

library Math {
    uint256 internal constant ONE = 1e18; // 18 decimal places
    int256 internal constant IONE = 1e18; // 18 decimal places

    function subMax0(uint256 a, uint256 b) internal pure returns (uint256) {
        unchecked {
            return (a >= b ? a - b : 0);
        }
    }

    function subNoNeg(int256 a, int256 b) internal pure returns (int256) {
        require(a >= b, "negative");
        return a - b; // no unchecked since if b is very negative, a - b might overflow
    }

    function mulDown(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 product = a * b;
        unchecked {
            return product / ONE;
        }
    }

    function mulDown(int256 a, int256 b) internal pure returns (int256) {
        int256 product = a * b;
        unchecked {
            return product / IONE;
        }
    }

    function divDown(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 aInflated = a * ONE;
        unchecked {
            return aInflated / b;
        }
    }

    function divDown(int256 a, int256 b) internal pure returns (int256) {
        int256 aInflated = a * IONE;
        unchecked {
            return aInflated / b;
        }
    }

    function rawDivUp(uint256 a, uint256 b) internal pure returns (uint256) {
        return (a + b - 1) / b;
    }

    // @author Uniswap
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }

    function abs(int256 x) internal pure returns (uint256) {
        return uint256(x > 0 ? x : -x);
    }

    function neg(int256 x) internal pure returns (int256) {
        return x * (-1);
    }

    function neg(uint256 x) internal pure returns (int256) {
        return Int(x) * (-1);
    }

    function max(uint256 x, uint256 y) internal pure returns (uint256) {
        return (x > y ? x : y);
    }

    function max(int256 x, int256 y) internal pure returns (int256) {
        return (x > y ? x : y);
    }

    function min(uint256 x, uint256 y) internal pure returns (uint256) {
        return (x < y ? x : y);
    }

    function min(int256 x, int256 y) internal pure returns (int256) {
        return (x < y ? x : y);
    }

    /*///////////////////////////////////////////////////////////////
                               SIGNED CASTS
    //////////////////////////////////////////////////////////////*/

    function Int(uint256 x) internal pure returns (int256) {
        require(x <= uint256(type(int256).max));
        return int256(x);
    }

    function Int128(int256 x) internal pure returns (int128) {
        require(type(int128).min <= x && x <= type(int128).max);
        return int128(x);
    }

    function Int128(uint256 x) internal pure returns (int128) {
        return Int128(Int(x));
    }

    /*///////////////////////////////////////////////////////////////
                               UNSIGNED CASTS
    //////////////////////////////////////////////////////////////*/

    function Uint(int256 x) internal pure returns (uint256) {
        require(x >= 0);
        return uint256(x);
    }

    function Uint32(uint256 x) internal pure returns (uint32) {
        require(x <= type(uint32).max);
        return uint32(x);
    }

    function Uint112(uint256 x) internal pure returns (uint112) {
        require(x <= type(uint112).max);
        return uint112(x);
    }

    function Uint96(uint256 x) internal pure returns (uint96) {
        require(x <= type(uint96).max);
        return uint96(x);
    }

    function Uint128(uint256 x) internal pure returns (uint128) {
        require(x <= type(uint128).max);
        return uint128(x);
    }

    function isAApproxB(
        uint256 a,
        uint256 b,
        uint256 eps
    ) internal pure returns (bool) {
        return mulDown(b, ONE - eps) <= a && a <= mulDown(b, ONE + eps);
    }

    function isAGreaterApproxB(
        uint256 a,
        uint256 b,
        uint256 eps
    ) internal pure returns (bool) {
        return a >= b && a <= mulDown(b, ONE + eps);
    }

    function isASmallerApproxB(
        uint256 a,
        uint256 b,
        uint256 eps
    ) internal pure returns (bool) {
        return a <= b && a >= mulDown(b, ONE - eps);
    }
}

File 23 of 34 : TokenHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

abstract contract TokenHelper {
    using SafeERC20 for IERC20;
    address internal constant NATIVE = address(0);
    uint256 internal constant LOWER_BOUND_APPROVAL = type(uint96).max / 2; // some tokens use 96 bits for approval

    function _transferIn(
        address token,
        address from,
        uint256 amount
    ) internal {
        if (token == NATIVE) require(msg.value == amount, "eth mismatch");
        else if (amount != 0) IERC20(token).safeTransferFrom(from, address(this), amount);
    }

    function _transferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        if (amount != 0) token.safeTransferFrom(from, to, amount);
    }

    function _transferOut(
        address token,
        address to,
        uint256 amount
    ) internal {
        if (amount == 0) return;
        if (token == NATIVE) {
            (bool success, ) = to.call{ value: amount }("");
            require(success, "eth send failed");
        } else {
            IERC20(token).safeTransfer(to, amount);
        }
    }

    function _transferOut(
        address[] memory tokens,
        address to,
        uint256[] memory amounts
    ) internal {
        uint256 numTokens = tokens.length;
        require(numTokens == amounts.length, "length mismatch");
        for (uint256 i = 0; i < numTokens; ) {
            _transferOut(tokens[i], to, amounts[i]);
            unchecked {
                i++;
            }
        }
    }

    function _selfBalance(address token) internal view returns (uint256) {
        return (token == NATIVE) ? address(this).balance : IERC20(token).balanceOf(address(this));
    }

    function _selfBalance(IERC20 token) internal view returns (uint256) {
        return token.balanceOf(address(this));
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev PLS PAY ATTENTION to tokens that requires the approval to be set to 0 before changing it
    function _safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.approve.selector, to, value)
        );
        require(success && (data.length == 0 || abi.decode(data, (bool))), "Safe Approve");
    }

    function _safeApproveInf(address token, address to) internal {
        if (token == NATIVE) return;
        if (IERC20(token).allowance(address(this), to) < LOWER_BOUND_APPROVAL) {
            _safeApprove(token, to, 0);
            _safeApprove(token, to, type(uint256).max);
        }
    }
}

File 24 of 34 : RewardManager.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "./RewardManagerAbstract.sol";

/// NOTE: This RewardManager is used with PendleMarket & SY. For YT, it will use RewardManagerAbstract
/// NOTE: RewardManager must not have duplicated rewardTokens
abstract contract RewardManager is RewardManagerAbstract {
    using Math for uint256;
    using ArrayLib for uint256[];

    uint256 public lastRewardBlock;

    mapping(address => RewardState) public rewardState;

    uint256 internal constant INITIAL_REWARD_INDEX = 1;

    function _updateRewardIndex()
        internal
        virtual
        override
        returns (address[] memory tokens, uint256[] memory indexes)
    {
        tokens = _getRewardTokens();
        indexes = new uint256[](tokens.length);

        if (tokens.length == 0) return (tokens, indexes);

        if (lastRewardBlock != block.number) {
            // if we have not yet update the index for this block
            lastRewardBlock = block.number;

            uint256 totalShares = _rewardSharesTotal();

            _redeemExternalReward();

            for (uint256 i = 0; i < tokens.length; ++i) {
                address token = tokens[i];

                // the entire token balance of the contract must be the rewards of the contract
                uint256 accrued = _selfBalance(tokens[i]) - rewardState[token].lastBalance;
                uint256 index = rewardState[token].index;

                if (index == 0) index = INITIAL_REWARD_INDEX;
                if (totalShares != 0) index += accrued.divDown(totalShares);

                rewardState[token].index = index.Uint128();
                rewardState[token].lastBalance += accrued.Uint128();
            }
        }

        for (uint256 i = 0; i < tokens.length; i++) indexes[i] = rewardState[tokens[i]].index;
    }

    /// @dev this function doesn't need redeemExternal since redeemExternal is bundled in updateRewardIndex
    /// @dev this function also has to update rewardState.lastBalance
    function _doTransferOutRewards(address user, address receiver)
        internal
        virtual
        override
        returns (uint256[] memory rewardAmounts)
    {
        address[] memory tokens = _getRewardTokens();
        rewardAmounts = new uint256[](tokens.length);
        for (uint256 i = 0; i < tokens.length; i++) {
            rewardAmounts[i] = userReward[tokens[i]][user].accrued;
            if (rewardAmounts[i] != 0) {
                userReward[tokens[i]][user].accrued = 0;
                rewardState[tokens[i]].lastBalance -= rewardAmounts[i].Uint128();
                _transferOut(tokens[i], receiver, rewardAmounts[i]);
            }
        }
    }

    function _getRewardTokens() internal view virtual returns (address[] memory);

    function _rewardSharesTotal() internal view virtual returns (uint256);
}

File 25 of 34 : RewardManagerAbstract.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "../../interfaces/IRewardManager.sol";

import "../libraries/ArrayLib.sol";
import "../libraries/TokenHelper.sol";
import "../libraries/math/Math.sol";

import "./RewardManagerAbstract.sol";

/// NOTE: RewardManager must not have duplicated rewardTokens
abstract contract RewardManagerAbstract is IRewardManager, TokenHelper {
    using Math for uint256;

    struct RewardState {
        uint128 index;
        uint128 lastBalance;
    }

    struct UserReward {
        uint128 index;
        uint128 accrued;
    }

    // [token] => [user] => (index,accrued)
    mapping(address => mapping(address => UserReward)) public userReward;

    function _updateAndDistributeRewards(address user) internal virtual {
        _updateAndDistributeRewardsForTwo(user, address(0));
    }

    function _updateAndDistributeRewardsForTwo(address user1, address user2) internal virtual {
        (address[] memory tokens, uint256[] memory indexes) = _updateRewardIndex();
        if (tokens.length == 0) return;

        if (user1 != address(0) && user1 != address(this))
            _distributeRewardsPrivate(user1, tokens, indexes);
        if (user2 != address(0) && user2 != address(this))
            _distributeRewardsPrivate(user2, tokens, indexes);
    }

    // should only be callable from `_updateAndDistributeRewardsForTwo` to guarantee user != address(0) && user != address(this)
    function _distributeRewardsPrivate(
        address user,
        address[] memory tokens,
        uint256[] memory indexes
    ) private {
        assert(user != address(0) && user != address(this));

        uint256 userShares = _rewardSharesUser(user);

        for (uint256 i = 0; i < tokens.length; ++i) {
            address token = tokens[i];
            uint256 index = indexes[i];
            uint256 userIndex = userReward[token][user].index;

            if (userIndex == 0) {
                userReward[token][user].index = index.Uint128();
                continue;
            }

            if (userIndex == index) continue;

            uint256 deltaIndex = index - userIndex;
            uint256 rewardDelta = userShares.mulDown(deltaIndex);
            uint256 rewardAccrued = userReward[token][user].accrued + rewardDelta;

            userReward[token][user] = UserReward({
                index: index.Uint128(),
                accrued: rewardAccrued.Uint128()
            });
        }
    }

    function _updateRewardIndex()
        internal
        virtual
        returns (address[] memory tokens, uint256[] memory indexes);

    function _redeemExternalReward() internal virtual;

    function _doTransferOutRewards(address user, address receiver)
        internal
        virtual
        returns (uint256[] memory rewardAmounts);

    function _rewardSharesUser(address user) internal view virtual returns (uint256);
}

File 26 of 34 : CurveFraxUsdcPoolHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "../../../../libraries/math/Math.sol";
import "../../../../../interfaces/Curve/ICrvPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

library CurveFraxUsdcPoolHelper {
    uint256 internal constant N_COINS = 2;
    uint256 internal constant A_PRECISION = 100;
    uint256 internal constant PRECISION = 10**18;
    uint256 internal constant RATE_0 = 1000000000000000000;
    uint256 internal constant RATE_1 = 1000000000000000000000000000000;
    uint256 internal constant FEE_DENOMINATOR = 10**10;

    address internal constant POOL = 0xDcEF968d416a41Cdac0ED8702fAC8128A64241A2;
    address internal constant LP = 0x3175Df0976dFA876431C2E9eE6Bc45b65d3473CC;
    address internal constant FRAX = 0x853d955aCEf822Db058eb8505911ED77F175b99e;
    address internal constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;

    using Math for uint256;

    function previewAddLiquidity(address token, uint256 amount) internal view returns (uint256) {
        uint256 amp = ICrvPool(POOL).A_precise();
        uint256[N_COINS] memory _amounts = _getTokenAmounts(token, amount);
        uint256[N_COINS] memory old_balances = _getBalances();
        uint256[N_COINS] memory new_balances;
        memcpy(new_balances, old_balances);

        uint256 D0 = _get_D_mem(old_balances, amp);
        uint256 total_supply = IERC20(LP).totalSupply();

        for (uint256 i = 0; i < N_COINS; ++i) {
            // skip totalSupply = 0 check
            new_balances[i] += _amounts[i];
        }

        uint256 D1 = _get_D_mem(new_balances, amp);
        assert(D1 > D0);

        uint256[N_COINS] memory fees;

        // skip total_supply > 0 check
        uint256 fee = (ICrvPool(POOL).fee() * N_COINS) / (4 * (N_COINS - 1));
        for (uint256 i = 0; i < N_COINS; ++i) {
            uint256 ideal_balance = (D1 * old_balances[i]) / D0;
            uint256 difference = 0;
            uint256 new_balance = new_balances[i];

            if (ideal_balance > new_balance) {
                difference = ideal_balance - new_balance;
            } else {
                difference = new_balance - ideal_balance;
            }
            fees[i] = (fee * difference) / FEE_DENOMINATOR;
            new_balances[i] -= fees[i];
        }
        uint256 D2 = _get_D_mem(new_balances, amp);
        return (total_supply * (D2 - D0)) / D0;
    }

    function _get_D_mem(uint256[N_COINS] memory balances, uint256 _amp)
        internal
        pure
        returns (uint256)
    {
        uint256[N_COINS] memory _xp;
        _xp[0] = (RATE_0 * balances[0]) / PRECISION;
        _xp[1] = (RATE_1 * balances[1]) / PRECISION;

        return _get_D(_xp, _amp);
    }

    function _get_D(uint256[N_COINS] memory _xp, uint256 _amp) internal pure returns (uint256) {
        uint256 S = 0;
        uint256 Dprev = 0;

        for (uint256 k = 0; k < N_COINS; ++k) {
            S += _xp[k];
        }
        if (S == 0) return 0;

        uint256 D = S;
        uint256 Ann = _amp * N_COINS;

        for (uint256 _i = 0; _i < 255; ++_i) {
            uint256 D_P = D;
            for (uint256 k = 0; k < N_COINS; ++k) {
                D_P = (D_P * D) / (_xp[k] * N_COINS);
            }
            Dprev = D;
            D =
                (((Ann * S) / A_PRECISION + D_P * N_COINS) * D) /
                (((Ann - A_PRECISION) * D) / A_PRECISION + (N_COINS + 1) * D_P);

            if (D > Dprev) {
                if (D - Dprev <= 1) {
                    return D;
                }
            } else {
                if (Dprev - D <= 1) {
                    return D;
                }
            }
        }
        assert(false);
    }

    function _getBalances() internal view returns (uint256[N_COINS] memory balances) {
        balances[0] = ICrvPool(POOL).balances(0);
        balances[1] = ICrvPool(POOL).balances(1);
    }

    function memcpy(uint256[N_COINS] memory a, uint256[N_COINS] memory b) internal pure {
        for (uint256 i = 0; i < N_COINS; ++i) {
            a[i] = b[i];
        }
    }

    function _getTokenAmounts(address token, uint256 amount)
        internal
        pure
        returns (uint256[N_COINS] memory res)
    {
        res[token == FRAX ? 0 : 1] = amount;
    }
}

File 27 of 34 : PendleConvexLPSY.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "../../../SYBaseWithRewards.sol";
import "../../../../../interfaces/ConvexCurve/IBooster.sol";
import "../../../../../interfaces/ConvexCurve/IRewards.sol";
import "../../../../../interfaces/Curve/ICrvPool.sol";

abstract contract PendleConvexLPSY is SYBaseWithRewards {
    using SafeERC20 for IERC20;

    uint256 public immutable cvxPid;
    address public immutable cvxRewardManager;

    address public immutable crvPool;
    address public immutable crvLp;

    address public constant BOOSTER = 0xF403C135812408BFbE8713b5A23a04b3D48AAE31;
    address public constant CRV = 0xD533a949740bb3306d119CC777fa900bA034cd52;
    address public constant CVX = 0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B;

    constructor(
        string memory _name,
        string memory _symbol,
        uint256 _cvxPid,
        address _crvLp,
        address _crvPool
    ) SYBaseWithRewards(_name, _symbol, _crvLp) {
        cvxPid = _cvxPid;
        crvPool = _crvPool;

        (crvLp, cvxRewardManager) = _getPoolInfo(cvxPid);
        if (crvLp != _crvLp) revert Errors.SYCurveInvalidPid();

        _safeApproveInf(crvLp, BOOSTER);
    }

    function _getPoolInfo(uint256 _cvxPid)
        internal
        view
        returns (address _crvLp, address _cvxRewardManager)
    {
        if (_cvxPid > IBooster(BOOSTER).poolLength()) revert Errors.SYCurveInvalidPid();

        (_crvLp, , , _cvxRewardManager, , ) = IBooster(BOOSTER).poolInfo(_cvxPid);
    }

    /*///////////////////////////////////////////////////////////////
                    DEPOSIT/REDEEM USING BASE TOKENS
    //////////////////////////////////////////////////////////////*/

    /**
     * If any of the base pool tokens are deposited, it will first add liquidity to the curve pool and mint LP,
     * which will then be deposited into convex
     */
    function _deposit(address tokenIn, uint256 amount)
        internal
        virtual
        override
        returns (uint256 amountSharesOut)
    {
        if (tokenIn == crvLp) {
            amountSharesOut = amount;
        } else {
            amountSharesOut = _depositToCurve(tokenIn, amount);
        }

        IBooster(BOOSTER).deposit(cvxPid, amountSharesOut, true);
    }

    /**
     * If any of the base curve pool tokens is specified as 'tokenOut',
     * it will redeem the corresponding liquidity the LP token represents via the prevailing exchange rate.
     */
    function _redeem(
        address receiver,
        address tokenOut,
        uint256 amountSharesToRedeem
    ) internal virtual override returns (uint256 amountTokenOut) {
        IRewards(cvxRewardManager).withdrawAndUnwrap(amountSharesToRedeem, false);

        if (tokenOut == crvLp) {
            amountTokenOut = amountSharesToRedeem;
        } else {
            amountTokenOut = _redeemFromCurve(tokenOut, amountSharesToRedeem);
        }
        _transferOut(tokenOut, receiver, amountTokenOut);
    }

    /*///////////////////////////////////////////////////////////////
                               EXCHANGE-RATE
    //////////////////////////////////////////////////////////////*/

    /**
     * The current price of the pool LP token relative to the underlying pool assets. Given as an integer with 1e18 precision.
     */
    function exchangeRate() public view virtual override returns (uint256) {
        return ICrvPool(crvPool).get_virtual_price();
    }

    /*///////////////////////////////////////////////////////////////
                               REWARDS-RELATED
    //////////////////////////////////////////////////////////////*/

    /**
     * Refer to currentExtraRewards array of reward tokens specific to the curve pool.
     * @dev We are aware that Convex might add or remove reward tokens, but also agreed that it was
     * not worth the complexity
     **/
    function _getRewardTokens() internal view virtual override returns (address[] memory res) {
        res = new address[](2);
        res[0] = CRV;
        res[1] = CVX;
    }

    function _redeemExternalReward() internal virtual override {
        // Redeem all extra rewards from the curve pool
        IRewards(cvxRewardManager).getReward();
    }

    /*///////////////////////////////////////////////////////////////
                    MISC FUNCTIONS FOR METADATA
    //////////////////////////////////////////////////////////////*/

    function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
        internal
        view
        virtual
        override
        returns (uint256 amountSharesOut)
    {
        if (tokenIn == crvLp) {
            amountSharesOut = amountTokenToDeposit;
        } else {
            amountSharesOut = _previewDepositToCurve(tokenIn, amountTokenToDeposit);
        }
    }

    function _previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
        internal
        view
        virtual
        override
        returns (uint256 amountTokenOut)
    {
        if (tokenOut == crvLp) {
            amountTokenOut = amountSharesToRedeem;
        } else {
            amountTokenOut = _previewRedeemFromCurve(tokenOut, amountSharesToRedeem);
        }
    }

    function getTokensIn() public view virtual override returns (address[] memory res);

    function getTokensOut() public view virtual override returns (address[] memory res);

    function isValidTokenIn(address token) public view virtual override returns (bool);

    function isValidTokenOut(address token) public view virtual override returns (bool);

    function _depositToCurve(address tokenIn, uint256 amountTokenToDeposit)
        internal
        virtual
        returns (uint256);

    function _redeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
        internal
        virtual
        returns (uint256);

    function _previewDepositToCurve(address token, uint256 amountTokenToDeposit)
        internal
        view
        virtual
        returns (uint256 amountLpOut);

    function _previewRedeemFromCurve(address token, uint256 amountLpToRedeem)
        internal
        view
        virtual
        returns (uint256 amountTokenOut);

    function assetInfo()
        external
        view
        returns (
            AssetType assetType,
            address assetAddress,
            uint8 assetDecimals
        )
    {
        return (AssetType.LIQUIDITY, crvLp, IERC20Metadata(crvLp).decimals());
    }
}

File 28 of 34 : SYBase.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "../../interfaces/IStandardizedYield.sol";

import "../erc20/PendleERC20Permit.sol";

import "../libraries/math/Math.sol";
import "../libraries/TokenHelper.sol";
import "../libraries/Errors.sol";
import "../libraries/BoringOwnableUpgradeable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

abstract contract SYBase is
    IStandardizedYield,
    PendleERC20Permit,
    TokenHelper,
    BoringOwnableUpgradeable,
    Pausable
{
    using Math for uint256;

    address public immutable yieldToken;

    constructor(
        string memory _name,
        string memory _symbol,
        address _yieldToken
    ) PendleERC20Permit(_name, _symbol, IERC20Metadata(_yieldToken).decimals()) initializer {
        yieldToken = _yieldToken;
        __BoringOwnable_init();
    }

    // solhint-disable no-empty-blocks
    receive() external payable {}

    /*///////////////////////////////////////////////////////////////
                    DEPOSIT/REDEEM USING BASE TOKENS
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See {IStandardizedYield-deposit}
     */
    function deposit(
        address receiver,
        address tokenIn,
        uint256 amountTokenToDeposit,
        uint256 minSharesOut
    ) external payable nonReentrant returns (uint256 amountSharesOut) {
        if (!isValidTokenIn(tokenIn)) revert Errors.SYInvalidTokenIn(tokenIn);
        if (amountTokenToDeposit == 0) revert Errors.SYZeroDeposit();

        _transferIn(tokenIn, msg.sender, amountTokenToDeposit);

        amountSharesOut = _deposit(tokenIn, amountTokenToDeposit);
        if (amountSharesOut < minSharesOut)
            revert Errors.SYInsufficientSharesOut(amountSharesOut, minSharesOut);

        _mint(receiver, amountSharesOut);
        emit Deposit(msg.sender, receiver, tokenIn, amountTokenToDeposit, amountSharesOut);
    }

    /**
     * @dev See {IStandardizedYield-redeem}
     */
    function redeem(
        address receiver,
        uint256 amountSharesToRedeem,
        address tokenOut,
        uint256 minTokenOut,
        bool burnFromInternalBalance
    ) external nonReentrant returns (uint256 amountTokenOut) {
        if (!isValidTokenOut(tokenOut)) revert Errors.SYInvalidTokenOut(tokenOut);
        if (amountSharesToRedeem == 0) revert Errors.SYZeroRedeem();

        if (burnFromInternalBalance) {
            _burn(address(this), amountSharesToRedeem);
        } else {
            _burn(msg.sender, amountSharesToRedeem);
        }

        amountTokenOut = _redeem(receiver, tokenOut, amountSharesToRedeem);
        if (amountTokenOut < minTokenOut)
            revert Errors.SYInsufficientTokenOut(amountTokenOut, minTokenOut);
        emit Redeem(msg.sender, receiver, tokenOut, amountSharesToRedeem, amountTokenOut);
    }

    /**
     * @notice mint shares based on the deposited base tokens
     * @param tokenIn base token address used to mint shares
     * @param amountDeposited amount of base tokens deposited
     * @return amountSharesOut amount of shares minted
     */
    function _deposit(address tokenIn, uint256 amountDeposited)
        internal
        virtual
        returns (uint256 amountSharesOut);

    /**
     * @notice redeems base tokens based on amount of shares to be burned
     * @param tokenOut address of the base token to be redeemed
     * @param amountSharesToRedeem amount of shares to be burned
     * @return amountTokenOut amount of base tokens redeemed
     */
    function _redeem(
        address receiver,
        address tokenOut,
        uint256 amountSharesToRedeem
    ) internal virtual returns (uint256 amountTokenOut);

    /*///////////////////////////////////////////////////////////////
                               EXCHANGE-RATE
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See {IStandardizedYield-exchangeRate}
     */
    function exchangeRate() external view virtual override returns (uint256 res);

    /*///////////////////////////////////////////////////////////////
                               REWARDS-RELATED
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See {IStandardizedYield-claimRewards}
     */
    function claimRewards(
        address /*user*/
    ) external virtual override returns (uint256[] memory rewardAmounts) {
        rewardAmounts = new uint256[](0);
    }

    /**
     * @dev See {IStandardizedYield-getRewardTokens}
     */
    function getRewardTokens()
        external
        view
        virtual
        override
        returns (address[] memory rewardTokens)
    {
        rewardTokens = new address[](0);
    }

    /**
     * @dev See {IStandardizedYield-accruedRewards}
     */
    function accruedRewards(
        address /*user*/
    ) external view virtual override returns (uint256[] memory rewardAmounts) {
        rewardAmounts = new uint256[](0);
    }

    function rewardIndexesCurrent() external virtual override returns (uint256[] memory indexes) {
        indexes = new uint256[](0);
    }

    function rewardIndexesStored()
        external
        view
        virtual
        override
        returns (uint256[] memory indexes)
    {
        indexes = new uint256[](0);
    }

    /*///////////////////////////////////////////////////////////////
                MISC METADATA FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    function previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
        external
        view
        virtual
        returns (uint256 amountSharesOut)
    {
        if (!isValidTokenIn(tokenIn)) revert Errors.SYInvalidTokenIn(tokenIn);
        return _previewDeposit(tokenIn, amountTokenToDeposit);
    }

    function previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
        external
        view
        virtual
        returns (uint256 amountTokenOut)
    {
        if (!isValidTokenOut(tokenOut)) revert Errors.SYInvalidTokenOut(tokenOut);
        return _previewRedeem(tokenOut, amountSharesToRedeem);
    }

    function pause() external onlyOwner {
        _pause();
    }

    function unpause() external onlyOwner {
        _unpause();
    }

    function _beforeTokenTransfer(
        address,
        address,
        uint256
    ) internal virtual override whenNotPaused {}

    function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
        internal
        view
        virtual
        returns (uint256 amountSharesOut);

    function _previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
        internal
        view
        virtual
        returns (uint256 amountTokenOut);

    function getTokensIn() public view virtual returns (address[] memory res);

    function getTokensOut() public view virtual returns (address[] memory res);

    function isValidTokenIn(address token) public view virtual returns (bool);

    function isValidTokenOut(address token) public view virtual returns (bool);
}

File 29 of 34 : SYBaseWithRewards.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "../RewardManager/RewardManager.sol";
import "./SYBase.sol";

/// NOTE: yieldToken MUST NEVER BE a rewardToken, else the rewardManager will behave erroneously
abstract contract SYBaseWithRewards is SYBase, RewardManager {
    using Math for uint256;
    using ArrayLib for address[];

    constructor(
        string memory _name,
        string memory _symbol,
        address _yieldToken
    )
        SYBase(_name, _symbol, _yieldToken) // solhint-disable-next-line no-empty-blocks
    {}

    /*///////////////////////////////////////////////////////////////
                               REWARDS-RELATED
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See {IStandardizedYield-claimRewards}
     */
    function claimRewards(address user)
        external
        virtual
        override
        nonReentrant
        whenNotPaused
        returns (uint256[] memory rewardAmounts)
    {
        _updateAndDistributeRewards(user);
        rewardAmounts = _doTransferOutRewards(user, user);

        emit ClaimRewards(user, _getRewardTokens(), rewardAmounts);
    }

    /**
     * @dev See {IStandardizedYield-getRewardTokens}
     */
    function getRewardTokens()
        external
        view
        virtual
        override
        returns (address[] memory rewardTokens)
    {
        rewardTokens = _getRewardTokens();
    }

    /**
     * @dev See {IStandardizedYield-accruedRewards}
     */
    function accruedRewards(address user)
        external
        view
        virtual
        override
        returns (uint256[] memory rewardAmounts)
    {
        address[] memory rewardTokens = _getRewardTokens();
        rewardAmounts = new uint256[](rewardTokens.length);
        for (uint256 i = 0; i < rewardTokens.length; ) {
            rewardAmounts[i] = userReward[rewardTokens[i]][user].accrued;
            unchecked {
                i++;
            }
        }
    }

    function rewardIndexesCurrent()
        external
        override
        whenNotPaused
        nonReentrant
        returns (uint256[] memory indexes)
    {
        _updateRewardIndex();
        return rewardIndexesStored();
    }

    function rewardIndexesStored()
        public
        view
        virtual
        override
        returns (uint256[] memory indexes)
    {
        address[] memory rewardTokens = _getRewardTokens();
        indexes = new uint256[](rewardTokens.length);
        for (uint256 i = 0; i < rewardTokens.length; ) {
            indexes[i] = rewardState[rewardTokens[i]].index;
            unchecked {
                i++;
            }
        }
    }

    /**
     * @notice returns the total number of reward shares
     * @dev this is simply the total supply of shares, as rewards shares are equivalent to SY shares
     */
    function _rewardSharesTotal() internal view virtual override returns (uint256) {
        return totalSupply();
    }

    /**
     * @notice returns the reward shares of (`user`)
     * @dev this is simply the SY balance of (`user`), as rewards shares are equivalent to SY shares
     */
    function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
        return balanceOf(user);
    }

    /*///////////////////////////////////////////////////////////////
                            TRANSFER HOOKS
    //////////////////////////////////////////////////////////////*/
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256
    ) internal virtual override whenNotPaused {
        _updateAndDistributeRewardsForTwo(from, to);
    }
}

File 30 of 34 : IBooster.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

interface IBooster {
    function crv() external view returns (address);

    function poolLength() external view returns (uint256);

    function poolInfo(uint256)
        external
        view
        returns (
            address lpToken,
            address,
            address,
            address,
            address,
            bool
        );

    function deposit(
        uint256 _pid,
        uint256 _amount,
        bool _stake
    ) external returns (bool);

    function depositAll(uint256 _pid, bool _stake) external returns (bool);

    function withdraw(uint256 _pid, uint256 _amount) external returns (bool);

    function withdrawAll(uint256 _pid) external returns (bool);
}

File 31 of 34 : IRewards.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

interface IRewards {
    function operator() external view returns (address);

    function stake(address, uint256) external;

    function stakeFor(address, uint256) external;

    function withdraw(uint256, bool) external returns (bool);

    function withdrawAndUnwrap(uint256, bool) external returns (bool);

    function exit(address) external;

    function getReward() external;

    function queueNewRewards(uint256) external;

    function notifyRewardAmount(uint256) external;

    function addExtraReward(address) external;

    function rewardToken() external returns (address);

    function rewardPerToken() external returns (uint256);

    function rewardPerTokenStored() external view returns (uint256);

    function extraRewardsLength() external view returns (uint256);

    function extraRewards(uint256) external returns (address);

    function stakingToken() external returns (address);

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

File 32 of 34 : ICrvPool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

interface ICrvPool {
    function coins(uint256 i) external view returns (address);

    function get_virtual_price() external view returns (uint256);

    function lp_token() external view returns (address);

    function fee() external view returns (uint256);

    function admin_fee() external view returns (uint256);

    function get_dy(
        int128 i,
        int128 j,
        uint256 dx // The amount of i being exchanged.
    ) external view returns (uint256);

    function exchange(
        int128 i,
        int128 j,
        uint256 dx,
        uint256 min_dy // The amount of i being exchanged.
    ) external returns (uint256);

    function add_liquidity(uint256[2] memory _deposit_amount, uint256 _min_amount)
        external
        returns (uint256 lpOut);

    function remove_liquidity_one_coin(
        uint256 _burn_amount,
        int128 i,
        uint256 _min_amount
    ) external returns (uint256 tokenOut);

    function calc_token_amount(uint256[2] memory _amounts, bool _is_deposit)
        external
        view
        returns (uint256);

    function calc_withdraw_one_coin(uint256 _burn_amount, int128 i)
        external
        view
        returns (uint256);

    function balances(uint256 i) external view returns (uint256);

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

File 33 of 34 : IRewardManager.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

interface IRewardManager {
    function userReward(address token, address user)
        external
        view
        returns (uint128 index, uint128 accrued);
}

File 34 of 34 : IStandardizedYield.sol
// SPDX-License-Identifier: GPL-3.0-or-later
/*
 * MIT License
 * ===========
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 */

pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface IStandardizedYield is IERC20Metadata {
    /// @dev Emitted when any base tokens is deposited to mint shares
    event Deposit(
        address indexed caller,
        address indexed receiver,
        address indexed tokenIn,
        uint256 amountDeposited,
        uint256 amountSyOut
    );

    /// @dev Emitted when any shares are redeemed for base tokens
    event Redeem(
        address indexed caller,
        address indexed receiver,
        address indexed tokenOut,
        uint256 amountSyToRedeem,
        uint256 amountTokenOut
    );

    /// @dev check `assetInfo()` for more information
    enum AssetType {
        TOKEN,
        LIQUIDITY
    }

    /// @dev Emitted when (`user`) claims their rewards
    event ClaimRewards(address indexed user, address[] rewardTokens, uint256[] rewardAmounts);

    /**
     * @notice mints an amount of shares by depositing a base token.
     * @param receiver shares recipient address
     * @param tokenIn address of the base tokens to mint shares
     * @param amountTokenToDeposit amount of base tokens to be transferred from (`msg.sender`)
     * @param minSharesOut reverts if amount of shares minted is lower than this
     * @return amountSharesOut amount of shares minted
     * @dev Emits a {Deposit} event
     *
     * Requirements:
     * - (`baseTokenIn`) must be a valid base token.
     */
    function deposit(
        address receiver,
        address tokenIn,
        uint256 amountTokenToDeposit,
        uint256 minSharesOut
    ) external payable returns (uint256 amountSharesOut);

    /**
     * @notice redeems an amount of base tokens by burning some shares
     * @param receiver recipient address
     * @param amountSharesToRedeem amount of shares to be burned
     * @param tokenOut address of the base token to be redeemed
     * @param minTokenOut reverts if amount of base token redeemed is lower than this
     * @param burnFromInternalBalance if true, burns from balance of `address(this)`, otherwise burns from `msg.sender`
     * @return amountTokenOut amount of base tokens redeemed
     * @dev Emits a {Redeem} event
     *
     * Requirements:
     * - (`tokenOut`) must be a valid base token.
     */
    function redeem(
        address receiver,
        uint256 amountSharesToRedeem,
        address tokenOut,
        uint256 minTokenOut,
        bool burnFromInternalBalance
    ) external returns (uint256 amountTokenOut);

    /**
     * @notice exchangeRate * syBalance / 1e18 must return the asset balance of the account
     * @notice vice-versa, if a user uses some amount of tokens equivalent to X asset, the amount of sy
     he can mint must be X * exchangeRate / 1e18
     * @dev SYUtils's assetToSy & syToAsset should be used instead of raw multiplication
     & division
     */
    function exchangeRate() external view returns (uint256 res);

    /**
     * @notice claims reward for (`user`)
     * @param user the user receiving their rewards
     * @return rewardAmounts an array of reward amounts in the same order as `getRewardTokens`
     * @dev
     * Emits a `ClaimRewards` event
     * See {getRewardTokens} for list of reward tokens
     */
    function claimRewards(address user) external returns (uint256[] memory rewardAmounts);

    /**
     * @notice get the amount of unclaimed rewards for (`user`)
     * @param user the user to check for
     * @return rewardAmounts an array of reward amounts in the same order as `getRewardTokens`
     */
    function accruedRewards(address user) external view returns (uint256[] memory rewardAmounts);

    function rewardIndexesCurrent() external returns (uint256[] memory indexes);

    function rewardIndexesStored() external view returns (uint256[] memory indexes);

    /**
     * @notice returns the list of reward token addresses
     */
    function getRewardTokens() external view returns (address[] memory);

    /**
     * @notice returns the address of the underlying yield token
     */
    function yieldToken() external view returns (address);

    /**
     * @notice returns all tokens that can mint this SY
     */
    function getTokensIn() external view returns (address[] memory res);

    /**
     * @notice returns all tokens that can be redeemed by this SY
     */
    function getTokensOut() external view returns (address[] memory res);

    function isValidTokenIn(address token) external view returns (bool);

    function isValidTokenOut(address token) external view returns (bool);

    function previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
        external
        view
        returns (uint256 amountSharesOut);

    function previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
        external
        view
        returns (uint256 amountTokenOut);

    /**
     * @notice This function contains information to interpret what the asset is
     * @return assetType the type of the asset (0 for ERC20 tokens, 1 for AMM liquidity tokens)
     * @return assetAddress the address of the asset
     * @return assetDecimals the decimals of the asset
     */
    function assetInfo()
        external
        view
        returns (
            AssetType assetType,
            address assetAddress,
            uint8 assetDecimals
        );
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 90000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"SYCurveInvalidPid","type":"error"},{"inputs":[{"internalType":"uint256","name":"actualSharesOut","type":"uint256"},{"internalType":"uint256","name":"requiredSharesOut","type":"uint256"}],"name":"SYInsufficientSharesOut","type":"error"},{"inputs":[{"internalType":"uint256","name":"actualTokenOut","type":"uint256"},{"internalType":"uint256","name":"requiredTokenOut","type":"uint256"}],"name":"SYInsufficientTokenOut","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SYInvalidTokenIn","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SYInvalidTokenOut","type":"error"},{"inputs":[],"name":"SYZeroDeposit","type":"error"},{"inputs":[],"name":"SYZeroRedeem","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"rewardAmounts","type":"uint256[]"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountDeposited","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountSyOut","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSyToRedeem","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountTokenOut","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BOOSTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CRV","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FRAX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"accruedRewards","outputs":[{"internalType":"uint256[]","name":"rewardAmounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"assetInfo","outputs":[{"internalType":"enum IStandardizedYield.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"assetAddress","type":"address"},{"internalType":"uint8","name":"assetDecimals","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"uint256[]","name":"rewardAmounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"crvLp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crvPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvxPid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvxRewardManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountTokenToDeposit","type":"uint256"},{"internalType":"uint256","name":"minSharesOut","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"amountSharesOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardTokens","outputs":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensIn","outputs":[{"internalType":"address[]","name":"res","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensOut","outputs":[{"internalType":"address[]","name":"res","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isValidTokenIn","outputs":[{"internalType":"bool","name":"res","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isValidTokenOut","outputs":[{"internalType":"bool","name":"res","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountTokenToDeposit","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"amountSharesOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountSharesToRedeem","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"amountTokenOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amountSharesToRedeem","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"minTokenOut","type":"uint256"},{"internalType":"bool","name":"burnFromInternalBalance","type":"bool"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"amountTokenOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardIndexesCurrent","outputs":[{"internalType":"uint256[]","name":"indexes","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardIndexesStored","outputs":[{"internalType":"uint256[]","name":"indexes","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardState","outputs":[{"internalType":"uint128","name":"index","type":"uint128"},{"internalType":"uint128","name":"lastBalance","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"bool","name":"renounce","type":"bool"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userReward","outputs":[{"internalType":"uint128","name":"index","type":"uint128"},{"internalType":"uint128","name":"accrued","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6102006040523480156200001257600080fd5b5060405162006abd38038062006abd83398101604081905262000035916200087a565b81816064733175df0976dfa876431c2e9ee6bc45b65d3473cc73dcef968d416a41cdac0ed8702fac8128a64241a28484838282828282826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000aa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000d09190620008e4565b6040805180820190915260018152603160f81b602082015283908184846003620000fb84826200099f565b5060046200010a83826200099f565b5060ff166080525050600280546001600160f81b0316600160f81b17905581516020808401919091208251918301919091206101008290526101208190524660c0527f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620001bd8184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e0526101405250506038805460ff191690555050600754600160a81b900460ff161592508291505080156200020457506007546001600160a01b90910460ff16105b806200023b575062000221306200041660201b6200230c1760201c565b1580156200023b5750600754600160a01b900460ff166001145b620002a45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6007805460ff60a01b1916600160a01b1790558015620002d2576007805460ff60a81b1916600160a81b1790555b6001600160a01b03821661016052620002ea62000425565b801562000333576007805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050506101808790525050506001600160a01b0382166101c052506200035983620004a8565b6001600160a01b039081166101a0529081166101e0819052908316146200039357604051631738e62160e11b815260040160405180910390fd5b6101e051620003b79073f403c135812408bfbe8713b5a23a04b3d48aae31620005ca565b5050505050620003e573853d955acef822db058eb8505911ed77f175b99e6101c051620005ca60201b60201c565b6200040e73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486101c051620005ca60201b60201c565b505062000ba5565b6001600160a01b03163b151590565b600754600160a81b900460ff16620004945760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016200029b565b600680546001600160a01b03191633179055565b60008073f403c135812408bfbe8713b5a23a04b3d48aae316001600160a01b031663081e3eda6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620004fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000524919062000a6b565b8311156200054557604051631738e62160e11b815260040160405180910390fd5b604051631526fe2760e01b81526004810184905273f403c135812408bfbe8713b5a23a04b3d48aae3190631526fe279060240160c060405180830381865afa15801562000596573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005bc919062000ab3565b509397909650945050505050565b6001600160a01b038216620005dd575050565b620005f160026001600160601b0362000b34565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526001600160601b03929092169184169063dd62ed3e90604401602060405180830381865afa1580156200064b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000671919062000a6b565b10156200069557620006868282600062000699565b62000695828260001962000699565b5050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691620006f7919062000b69565b6000604051808303816000865af19150503d806000811462000736576040519150601f19603f3d011682016040523d82523d6000602084013e6200073b565b606091505b5091509150818015620007695750805115806200076957508080602001905181019062000769919062000b87565b620007a65760405162461bcd60e51b815260206004820152600c60248201526b5361666520417070726f766560a01b60448201526064016200029b565b5050505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620007e0578181015183820152602001620007c6565b50506000910152565b600082601f830112620007fb57600080fd5b81516001600160401b0380821115620008185762000818620007ad565b604051601f8301601f19908116603f01168101908282118183101715620008435762000843620007ad565b816040528381528660208588010111156200085d57600080fd5b62000870846020830160208901620007c3565b9695505050505050565b600080604083850312156200088e57600080fd5b82516001600160401b0380821115620008a657600080fd5b620008b486838701620007e9565b93506020850151915080821115620008cb57600080fd5b50620008da85828601620007e9565b9150509250929050565b600060208284031215620008f757600080fd5b815160ff811681146200090957600080fd5b9392505050565b600181811c908216806200092557607f821691505b6020821081036200094657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200099a57600081815260208120601f850160051c81016020861015620009755750805b601f850160051c820191505b81811015620009965782815560010162000981565b5050505b505050565b81516001600160401b03811115620009bb57620009bb620007ad565b620009d381620009cc845462000910565b846200094c565b602080601f83116001811462000a0b5760008415620009f25750858301515b600019600386901b1c1916600185901b17855562000996565b600085815260208120601f198616915b8281101562000a3c5788860151825594840194600190910190840162000a1b565b508582101562000a5b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121562000a7e57600080fd5b5051919050565b80516001600160a01b038116811462000a9d57600080fd5b919050565b8051801515811462000a9d57600080fd5b60008060008060008060c0878903121562000acd57600080fd5b62000ad88762000a85565b955062000ae86020880162000a85565b945062000af86040880162000a85565b935062000b086060880162000a85565b925062000b186080880162000a85565b915062000b2860a0880162000aa2565b90509295509295509295565b60006001600160601b038381168062000b5d57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b6000825162000b7d818460208701620007c3565b9190910192915050565b60006020828403121562000b9a57600080fd5b620009098262000aa2565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051615e1d62000ca06000396000818161077a01528181610b45015281816118cc01528181611a5201528181611a7301528181612636015281816132340152818161330301526133690152600081816108d7015281816113f001528181613d0701528181613e3e01526140360152600081816103d4015281816131af015261454601526000818161055201526126c30152600061070601526000612ddd01526000612e2c01526000612e0701526000612d6001526000612d8a01526000612db4015260006104cd0152615e1d6000f3fe6080604052600436106103175760003560e01c8063784367d61161019a578063b20fdc0d116100e1578063dd62ed3e1161008a578063ef5cfb8c11610064578063ef5cfb8c14610a5a578063f8b2f99114610a7a578063fa5a4f061461072857600080fd5b8063dd62ed3e14610983578063e30c3978146109d6578063ea64a82014610a0357600080fd5b8063cbe52ae3116100bb578063cbe52ae31461092e578063d505accf1461094e578063da88ecb41461096e57600080fd5b8063b20fdc0d146108c5578063b8f82b26146108f9578063c4f59f9b1461091957600080fd5b8063945c914211610143578063a9059cbb1161011d578063a9059cbb14610867578063a9f8d18114610887578063b0e4556f1461089d57600080fd5b8063945c91421461080657806395d89b411461082e578063a40bee501461084357600080fd5b80638456cb59116101745780638456cb591461079c57806389a30271146107b15780638da5cb5b146107d957600080fd5b8063784367d6146107285780637ecebe00146107485780637f44579b1461076857600080fd5b80633ba0b9a91161025e5780635eaec0e41161020757806375b0ffd1116101e157806375b0ffd1146106ac578063769f8e5d146106d457806376d5de85146106f457600080fd5b80635eaec0e41461062c57806370a0823114610641578063759cb53b1461068457600080fd5b80634e71e0c8116102385780634e71e0c8146105745780635c975abb146105895780635cbadbe4146105a157600080fd5b80633ba0b9a9146105165780633f4ba83a1461052b57806347aea09f1461054057600080fd5b806318160ddd116102c057806323b872dd1161029a57806323b872dd1461049b578063313ce567146104bb5780633644e5151461050157600080fd5b806318160ddd1461044857806320e8c56514610488578063213cae631461034e57600080fd5b8063095ea7b3116102f1578063095ea7b3146103925780630b1e1031146103c2578063128fced11461041b57600080fd5b806306fdde0314610323578063071bc3c91461034e578063078dfbe71461037057600080fd5b3661031e57005b600080fd5b34801561032f57600080fd5b50610338610a8f565b604051610345919061568c565b60405180910390f35b34801561035a57600080fd5b50610363610b21565b604051610345919061572e565b34801561037c57600080fd5b5061039061038b366004615778565b610c78565b005b34801561039e57600080fd5b506103b26103ad3660046157c1565b610e69565b6040519015158152602001610345565b3480156103ce57600080fd5b506103f67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610345565b34801561042757600080fd5b5061043b6104363660046157eb565b610e83565b6040516103459190615836565b34801561045457600080fd5b506002547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff165b604051908152602001610345565b61047a610496366004615849565b610fd6565b3480156104a757600080fd5b506103b26104b636600461588b565b611273565b3480156104c757600080fd5b506104ef7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610345565b34801561050d57600080fd5b5061047a6113dd565b34801561052257600080fd5b5061047a6113ec565b34801561053757600080fd5b5061039061147d565b34801561054c57600080fd5b5061047a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058057600080fd5b50610390611508565b34801561059557600080fd5b5060385460ff166103b2565b3480156105ad57600080fd5b506106036105bc3660046158c7565b60396020908152600092835260408084209091529082529020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b604080516fffffffffffffffffffffffffffffffff938416815292909116602083015201610345565b34801561063857600080fd5b5061047a606481565b34801561064d57600080fd5b5061047a61065c3660046157eb565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561069057600080fd5b506103f6734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81565b3480156106b857600080fd5b506103f673f403c135812408bfbe8713b5a23a04b3d48aae3181565b3480156106e057600080fd5b5061047a6106ef3660046158fa565b61161f565b34801561070057600080fd5b506103f67f000000000000000000000000000000000000000000000000000000000000000081565b34801561073457600080fd5b506103b26107433660046157eb565b6118c8565b34801561075457600080fd5b5061047a6107633660046157eb565b611986565b34801561077457600080fd5b506103f67f000000000000000000000000000000000000000000000000000000000000000081565b3480156107a857600080fd5b506103906119b1565b3480156107bd57600080fd5b506103f673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b3480156107e557600080fd5b506006546103f69073ffffffffffffffffffffffffffffffffffffffff1681565b34801561081257600080fd5b506103f673d533a949740bb3306d119cc777fa900ba034cd5281565b34801561083a57600080fd5b50610338611a3a565b34801561084f57600080fd5b50610858611a49565b60405161034593929190615984565b34801561087357600080fd5b506103b26108823660046157c1565b611b0b565b34801561089357600080fd5b5061047a603a5481565b3480156108a957600080fd5b506103f673853d955acef822db058eb8505911ed77f175b99e81565b3480156108d157600080fd5b506103f67f000000000000000000000000000000000000000000000000000000000000000081565b34801561090557600080fd5b5061047a6109143660046157c1565b611c69565b34801561092557600080fd5b50610363611cd3565b34801561093a57600080fd5b5061047a6109493660046157c1565b611cdd565b34801561095a57600080fd5b506103906109693660046159fb565b611d40565b34801561097a57600080fd5b5061043b611eff565b34801561098f57600080fd5b5061047a61099e3660046158c7565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b3480156109e257600080fd5b506007546103f69073ffffffffffffffffffffffffffffffffffffffff1681565b348015610a0f57600080fd5b50610603610a1e3660046157eb565b603b602052600090815260409020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b348015610a6657600080fd5b5061043b610a753660046157eb565b611fe7565b348015610a8657600080fd5b5061043b6121a7565b606060038054610a9e90615a68565b80601f0160208091040260200160405190810160405280929190818152602001828054610aca90615a68565b8015610b175780601f10610aec57610100808354040283529160200191610b17565b820191906000526020600020905b815481529060010190602001808311610afa57829003601f168201915b5050505050905090565b604080516003808252608082019092526060916020820183803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610b7757610b77615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073853d955acef822db058eb8505911ed77f175b99e81600181518110610bd957610bd9615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881600281518110610c3b57610c3b615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505090565b60065473ffffffffffffffffffffffffffffffffffffffff163314610cfe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b8115610e235773ffffffffffffffffffffffffffffffffffffffff8316151580610d255750805b610d8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4f776e61626c653a207a65726f206164647265737300000000000000000000006044820152606401610cf5565b60065460405173ffffffffffffffffffffffffffffffffffffffff8086169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff85167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155600780549091169055505050565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555b505050565b600033610e77818585612328565b60019150505b92915050565b60606000610e8f6124dc565b9050805167ffffffffffffffff811115610eab57610eab615ab5565b604051908082528060200260200182016040528015610ed4578160200160208202803683370190505b50915060005b8151811015610fcf5760396000838381518110610ef957610ef9615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16838281518110610fbc57610fbc615ae4565b6020908102919091010152600101610eda565b5050919050565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff160161108b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790556110dd846118c8565b61112b576040517faeabe71800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610cf5565b82600003611165576040517fa907f2f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611170843385612586565b61117a8484612632565b9050818110156111c0576040517fbc71f2ba0000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610cf5565b6111ca858261275e565b604080518481526020810183905273ffffffffffffffffffffffffffffffffffffffff808716929088169133917f5fe47ed6d4225326d3303476197d782ded5a4e9c14f479dc9ec4992af4e85d59910160405180910390a4600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0100000000000000000000000000000000000000000000000000000000000000179055949350505050565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff1601611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790553361137d85828561291c565b6113888585856129f3565b6001915050600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790559392505050565b60006113e7612d46565b905090565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa158015611459573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190615b13565b60065473ffffffffffffffffffffffffffffffffffffffff1633146114fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cf5565b611506612e7a565b565b60075473ffffffffffffffffffffffffffffffffffffffff1633811461158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e65726044820152606401610cf5565b60065460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055600780549091169055565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff16016116d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0200000000000000000000000000000000000000000000000000000000000000179055611726846118c8565b611774576040517f88a5056100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610cf5565b846000036117ae576040517fc3d83b0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81156117c3576117be3086612ef7565b6117cd565b6117cd3386612ef7565b6117d8868587613176565b90508281101561181e576040517fbfee4ca00000000000000000000000000000000000000000000000000000000081526004810182905260248101849052604401610cf5565b604080518681526020810183905273ffffffffffffffffffffffffffffffffffffffff808716929089169133917faee47cdf925cf525fdae94f9777ee5a06cac37e1c41220d0a8a89ed154f62d1c910160405180910390a4600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017905595945050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061194d575073ffffffffffffffffffffffffffffffffffffffff821673853d955acef822db058eb8505911ed77f175b99e145b80610e7d575073ffffffffffffffffffffffffffffffffffffffff821673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481492915050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040812054610e7d565b60065473ffffffffffffffffffffffffffffffffffffffff163314611a32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cf5565b6115066132a4565b606060048054610a9e90615a68565b600080600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b009190615b2c565b925092509250909192565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff1601611bc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f020000000000000000000000000000000000000000000000000000000000000017905533611c158185856129f3565b6001915050600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017905592915050565b6000611c74836118c8565b611cc2576040517faeabe71800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610cf5565b611ccc83836132ff565b9392505050565b60606113e76124dc565b6000611ce8836118c8565b611d36576040517f88a5056100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610cf5565b611ccc8383613365565b83421115611daa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610cf5565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888611dd98c6133cb565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000611e4182613400565b90506000611e5182878787613469565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611ee8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610cf5565b611ef38a8a8a612328565b50505050505050505050565b60606000611f0b6124dc565b9050805167ffffffffffffffff811115611f2757611f27615ab5565b604051908082528060200260200182016040528015611f50578160200160208202803683370190505b50915060005b8151811015611fe257603b6000838381518110611f7557611f75615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205483516fffffffffffffffffffffffffffffffff90911690849083908110611fcf57611fcf615ae4565b6020908102919091010152600101611f56565b505090565b6002546060907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff160161209c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790556120ed613491565b6120f6826134fe565b612100828361350c565b90508173ffffffffffffffffffffffffffffffffffffffff167f2193aa20a3717f5f4ac79482f4f553e5f0afe8f4e6ec3e3d1aa2e138adc4763f6121426124dc565b83604051612151929190615b49565b60405180910390a2600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0100000000000000000000000000000000000000000000000000000000000000179055919050565b60606121b1613491565b6002547ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff1601612263576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790556122b4613876565b50506122be611eff565b9050600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017905590565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff83166123ca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff821661246d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b604080516002808252606080830184529260208301908036833701905050905073d533a949740bb3306d119cc777fa900ba034cd528160008151811061252457612524615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81600181518110610c3b57610c3b615ae4565b73ffffffffffffffffffffffffffffffffffffffff831661260a57803414610e64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f657468206d69736d6174636800000000000000000000000000000000000000006044820152606401610cf5565b8015610e6457610e6473ffffffffffffffffffffffffffffffffffffffff8416833084613bc4565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361268e57508061269b565b6126988383613ca0565b90505b6040517f43a0d0660000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152602481018290526001604482015273f403c135812408bfbe8713b5a23a04b3d48aae31906343a0d066906064016020604051808303816000875af1158015612733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127579190615b77565b5092915050565b73ffffffffffffffffffffffffffffffffffffffff82166127db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610cf5565b6127e760008383613d8a565b6127f081613d9c565b600280546000906128239084907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16615bc3565b92506101000a8154817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128c59190615bfb565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146129ed57818110156129e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610cf5565b6129ed8484848403612328565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612a96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff8216612b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612bce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f45524332303a207472616e7366657220746f2073656c660000000000000000006044820152606401610cf5565b612bd9838383613d8a565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015612c8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290612cd3908490615bfb565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612d3991815260200190565b60405180910390a36129ed565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148015612dac57507f000000000000000000000000000000000000000000000000000000000000000046145b15612dd657507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b612e82613dce565b603880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff8216612f9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b612fa682600083613d8a565b73ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020548181101561305c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020828203905561308f82613d9c565b600280546000906130c29084907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16615c0e565b92506101000a8154817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516124cf91815260200190565b6040517fc32e720200000000000000000000000000000000000000000000000000000000815260048101829052600060248201819052907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063c32e7202906044016020604051808303816000875af115801561320d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132319190615b77565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361328c575080613299565b6132968383613e3a565b90505b611ccc838583613f13565b6132ac613491565b603880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612ecd3390565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361335b575080610e7d565b611ccc8383614026565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036133c1575080610e7d565b611ccc8383614032565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090208054600181018255905b50919050565b6000610e7d61340d612d46565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061347a878787876140d9565b91509150613487816141f1565b5095945050505050565b60385460ff1615611506576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610cf5565b613509816000614445565b50565b606060006135186124dc565b9050805167ffffffffffffffff81111561353457613534615ab5565b60405190808252806020026020018201604052801561355d578160200160208202803683370190505b50915060005b815181101561386e576039600083838151811061358257613582615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1683828151811061364557613645615ae4565b60200260200101818152505082818151811061366357613663615ae4565b602002602001015160001461385c5760006039600084848151811061368a5761368a615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555061376483828151811061375757613757615ae4565b60200260200101516144f9565b603b600084848151811061377a5761377a615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff166137e99190615c46565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555061385c82828151811061383457613834615ae4565b60200260200101518585848151811061384f5761384f615ae4565b6020026020010151613f13565b8061386681615c6f565b915050613563565b505092915050565b6060806138816124dc565b9150815167ffffffffffffffff81111561389d5761389d615ab5565b6040519080825280602002602001820160405280156138c6578160200160208202803683370190505b50905081516000036138d6579091565b43603a5414613b265743603a5560006138ed614518565b90506138f7614544565b60005b8351811015613b2357600084828151811061391757613917615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff81166000908152603b9092526040822054875191935070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906139989088908690811061398b5761398b615ae4565b60200260200101516145c0565b6139a29190615ca7565b73ffffffffffffffffffffffffffffffffffffffff83166000908152603b60205260408120549192506fffffffffffffffffffffffffffffffff909116908190036139eb575060015b8415613a08576139fb8286614678565b613a059082615bfb565b90505b613a11816144f9565b73ffffffffffffffffffffffffffffffffffffffff84166000908152603b6020526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055613a7e826144f9565b73ffffffffffffffffffffffffffffffffffffffff84166000908152603b602052604090208054601090613ad990849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16615cba565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050505080613b1c90615c6f565b90506138fa565b50505b60005b8251811015613bbf57603b6000848381518110613b4857613b48615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205482516fffffffffffffffffffffffffffffffff90911690839083908110613ba257613ba2615ae4565b602090810291909101015280613bb781615c6f565b915050613b29565b509091565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526129ed9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526146a7565b6000613caa61564a565b8281613cb5866147b3565b60028110613cc557613cc5615ae4565b60200201526040517f0b4c7e4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690630b4c7e4d90613d3f908490600090600401615ce3565b6020604051808303816000875af1158015613d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d829190615b13565b949350505050565b613d92613491565b610e648383614445565b60007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115613dca57600080fd5b5090565b60385460ff16611506576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610cf5565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631a4d01d283613e8a613e85876147b3565b6147f9565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252600f0b6024820152600060448201526064016020604051808303816000875af1158015613eef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc9190615b13565b80600003613f2057505050565b73ffffffffffffffffffffffffffffffffffffffff83166140055760008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114613f95576040519150601f19603f3d011682016040523d82523d6000602084013e613f9a565b606091505b50509050806129ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6574682073656e64206661696c656400000000000000000000000000000000006044820152606401610cf5565b610e6473ffffffffffffffffffffffffffffffffffffffff8416838361480c565b6000611ccc8383614862565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663cc2b27d78361407d613e85876147b3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252600f0b6024820152604401602060405180830381865afa158015613eef573d6000803e3d6000fd5b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561411057506000905060036141e8565b8460ff16601b1415801561412857508460ff16601c14155b1561413957506000905060046141e8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561418d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166141e1576000600192509250506141e8565b9150600090505b94509492505050565b600081600481111561420557614205615955565b0361420d5750565b600181600481111561422157614221615955565b03614288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610cf5565b600281600481111561429c5761429c615955565b03614303576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610cf5565b600381600481111561431757614317615955565b036143a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b60048160048111156143b8576143b8615955565b03613509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b600080614450613876565b9150915081516000036144635750505050565b73ffffffffffffffffffffffffffffffffffffffff84161580159061449e575073ffffffffffffffffffffffffffffffffffffffff84163014155b156144ae576144ae848383614c1f565b73ffffffffffffffffffffffffffffffffffffffff8316158015906144e9575073ffffffffffffffffffffffffffffffffffffffff83163014155b156129ed576129ed838383614c1f565b60006fffffffffffffffffffffffffffffffff821115613dca57600080fd5b60006113e76002547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156145ac57600080fd5b505af11580156129ed573d6000803e3d6000fd5b600073ffffffffffffffffffffffffffffffffffffffff821615614671576040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015614648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061466c9190615b13565b610e7d565b4792915050565b60008061468d670de0b6b3a764000085615d1b565b905082818161469e5761469e615d32565b04949350505050565b6000614709826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614f8a9092919063ffffffff16565b805190915015610e6457808060200190518101906147279190615b77565b610e64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610cf5565b600073ffffffffffffffffffffffffffffffffffffffff821673853d955acef822db058eb8505911ed77f175b99e146147ed5760016147f0565b60005b60ff1692915050565b6000610e7d61480783614f99565b614fc8565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610e649084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401613c1e565b60008073dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff166376a2f0f06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156148c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148e89190615b13565b905060006148f68585615013565b90506000614902615076565b905061490c61564a565b61491681836151a2565b600061492283866151ec565b90506000733175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149a99190615b13565b905060005b6002811015614a04578581600281106149c9576149c9615ae4565b60200201518482600281106149e0576149e0615ae4565b602002018181516149f19190615bfb565b9052506149fd81615c6f565b90506149ae565b506000614a1184886151ec565b9050828111614a2257614a22615d61565b614a2a61564a565b6000614a3860016002615ca7565b614a43906004615d1b565b600273dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015614aa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ac89190615b13565b614ad29190615d1b565b614adc9190615d90565b905060005b6002811015614be057600086898360028110614aff57614aff615ae4565b6020020151614b0e9087615d1b565b614b189190615d90565b9050600080898460028110614b2f57614b2f615ae4565b6020020151905080831115614b4f57614b488184615ca7565b9150614b5c565b614b598382615ca7565b91505b6402540be400614b6c8387615d1b565b614b769190615d90565b868560028110614b8857614b88615ae4565b6020020152858460028110614b9f57614b9f615ae4565b60200201518a8560028110614bb657614bb6615ae4565b60200201818151614bc79190615ca7565b905250614bd99250839150615c6f9050565b9050614ae1565b506000614bed878b6151ec565b905085614bfa8183615ca7565b614c049087615d1b565b614c0e9190615d90565b9d9c50505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff831615801590614c5a575073ffffffffffffffffffffffffffffffffffffffff83163014155b614c6657614c66615d61565b6000614c7184615257565b905060005b8351811015614f83576000848281518110614c9357614c93615ae4565b602002602001015190506000848381518110614cb157614cb1615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff8085166000908152603984526040808220928c168252919093528220549092506fffffffffffffffffffffffffffffffff1690819003614d9157614d15826144f9565b73ffffffffffffffffffffffffffffffffffffffff9384166000908152603960209081526040808320968c1683529590529390932080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9094169390931790925550614f739050565b818103614da057505050614f73565b6000614dac8284615ca7565b90506000614dba8783615282565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152603960209081526040808320938f1683529290529081205491925090614e2490839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16615bfb565b90506040518060400160405280614e3a876144f9565b6fffffffffffffffffffffffffffffffff168152602001614e5a836144f9565b6fffffffffffffffffffffffffffffffff16815250603960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050505050505050505b614f7c81615c6f565b9050614c76565b5050505050565b6060613d8284846000856152a0565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115613dca57600080fd5b60007fffffffffffffffffffffffffffffffff80000000000000000000000000000000821280159061500a57506f7fffffffffffffffffffffffffffffff8213155b613dca57600080fd5b61501b61564a565b818173ffffffffffffffffffffffffffffffffffffffff851673853d955acef822db058eb8505911ed77f175b99e14615055576001615058565b60005b60ff166002811061506b5761506b615ae4565b602002015292915050565b61507e61564a565b6040517f4903b0d10000000000000000000000000000000000000000000000000000000081526000600482015273dcef968d416a41cdac0ed8702fac8128a64241a290634903b0d190602401602060405180830381865afa1580156150e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061510b9190615b13565b81526040517f4903b0d10000000000000000000000000000000000000000000000000000000081526001600482015273dcef968d416a41cdac0ed8702fac8128a64241a290634903b0d190602401602060405180830381865afa158015615176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061519a9190615b13565b602082015290565b60005b6002811015610e64578181600281106151c0576151c0615ae4565b60200201518382600281106151d7576151d7615ae4565b60200201526151e581615c6f565b90506151a5565b60006151f661564a565b8351670de0b6b3a76400009061520c9082615d1b565b6152169190615d90565b81526020840151670de0b6b3a76400009061523e906c0c9f2c9cd04674edea40000000615d1b565b6152489190615d90565b6020820152613d828184615436565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812054610e7d565b60008061528f8385615d1b565b9050670de0b6b3a76400008161469e565b606082471015615332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff85163b6153b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610cf5565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516153d99190615dcb565b60006040518083038185875af1925050503d8060008114615416576040519150601f19603f3d011682016040523d82523d6000602084013e61541b565b606091505b509150915061542b8282866155f7565b979650505050505050565b60008080805b60028110156154785785816002811061545757615457615ae4565b60200201516154669084615bfb565b925061547181615c6f565b905061543c565b508160000361548c57600092505050610e7d565b81600061549a600287615d1b565b905060005b60ff8110156155e4578260005b60028110156154fe5760028a82600281106154c9576154c9615ae4565b60200201516154d89190615d1b565b6154e28684615d1b565b6154ec9190615d90565b91506154f781615c6f565b90506154ac565b5083945080600260016155119190615bfb565b61551b9190615d1b565b6064856155288287615ca7565b6155329190615d1b565b61553c9190615d90565b6155469190615bfb565b84615552600284615d1b565b606461555e8a88615d1b565b6155689190615d90565b6155729190615bfb565b61557c9190615d1b565b6155869190615d90565b9350848411156155b457600161559c8686615ca7565b116155af57839650505050505050610e7d565b6155d3565b60016155c08587615ca7565b116155d357839650505050505050610e7d565b506155dd81615c6f565b905061549f565b506155ed615d61565b5050505092915050565b60608315615606575081611ccc565b8251156156165782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf5919061568c565b60405180604001604052806002906020820280368337509192915050565b60005b8381101561568357818101518382015260200161566b565b50506000910152565b60208152600082518060208401526156ab816040850160208701615668565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600081518084526020808501945080840160005b8381101561572357815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016156f1565b509495945050505050565b602081526000611ccc60208301846156dd565b803573ffffffffffffffffffffffffffffffffffffffff8116811461576557600080fd5b919050565b801515811461350957600080fd5b60008060006060848603121561578d57600080fd5b61579684615741565b925060208401356157a68161576a565b915060408401356157b68161576a565b809150509250925092565b600080604083850312156157d457600080fd5b6157dd83615741565b946020939093013593505050565b6000602082840312156157fd57600080fd5b611ccc82615741565b600081518084526020808501945080840160005b838110156157235781518752958201959082019060010161581a565b602081526000611ccc6020830184615806565b6000806000806080858703121561585f57600080fd5b61586885615741565b935061587660208601615741565b93969395505050506040820135916060013590565b6000806000606084860312156158a057600080fd5b6158a984615741565b92506158b760208501615741565b9150604084013590509250925092565b600080604083850312156158da57600080fd5b6158e383615741565b91506158f160208401615741565b90509250929050565b600080600080600060a0868803121561591257600080fd5b61591b86615741565b94506020860135935061593060408701615741565b92506060860135915060808601356159478161576a565b809150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60608101600285106159bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b93815273ffffffffffffffffffffffffffffffffffffffff92909216602083015260ff1660409091015290565b60ff8116811461350957600080fd5b600080600080600080600060e0888a031215615a1657600080fd5b615a1f88615741565b9650615a2d60208901615741565b955060408801359450606088013593506080880135615a4b816159ec565b9699959850939692959460a0840135945060c09093013592915050565b600181811c90821680615a7c57607f821691505b6020821081036133fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215615b2557600080fd5b5051919050565b600060208284031215615b3e57600080fd5b8151611ccc816159ec565b604081526000615b5c60408301856156dd565b8281036020840152615b6e8185615806565b95945050505050565b600060208284031215615b8957600080fd5b8151611ccc8161576a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81811683821601908082111561275757612757615b94565b80820180821115610e7d57610e7d615b94565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82811682821603908082111561275757612757615b94565b6fffffffffffffffffffffffffffffffff82811682821603908082111561275757612757615b94565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615ca057615ca0615b94565b5060010190565b81810381811115610e7d57610e7d615b94565b6fffffffffffffffffffffffffffffffff81811683821601908082111561275757612757615b94565b60608101818460005b6002811015615d0b578151835260209283019290910190600101615cec565b5050508260408301529392505050565b8082028115828204841417610e7d57610e7d615b94565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600082615dc6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251615ddd818460208701615668565b919091019291505056fea2646970667358221220bf6c5df3fad3bd43053f11c967647b2c0fe2730c5050277da9c764a5dd3ac15364736f6c6343000811003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001a53592046524158555344435f43757276654c5020436f6e766578000000000000000000000000000000000000000000000000000000000000000000000000001a53592d46524158555344435f43757276654c5020436f6e766578000000000000

Deployed Bytecode

0x6080604052600436106103175760003560e01c8063784367d61161019a578063b20fdc0d116100e1578063dd62ed3e1161008a578063ef5cfb8c11610064578063ef5cfb8c14610a5a578063f8b2f99114610a7a578063fa5a4f061461072857600080fd5b8063dd62ed3e14610983578063e30c3978146109d6578063ea64a82014610a0357600080fd5b8063cbe52ae3116100bb578063cbe52ae31461092e578063d505accf1461094e578063da88ecb41461096e57600080fd5b8063b20fdc0d146108c5578063b8f82b26146108f9578063c4f59f9b1461091957600080fd5b8063945c914211610143578063a9059cbb1161011d578063a9059cbb14610867578063a9f8d18114610887578063b0e4556f1461089d57600080fd5b8063945c91421461080657806395d89b411461082e578063a40bee501461084357600080fd5b80638456cb59116101745780638456cb591461079c57806389a30271146107b15780638da5cb5b146107d957600080fd5b8063784367d6146107285780637ecebe00146107485780637f44579b1461076857600080fd5b80633ba0b9a91161025e5780635eaec0e41161020757806375b0ffd1116101e157806375b0ffd1146106ac578063769f8e5d146106d457806376d5de85146106f457600080fd5b80635eaec0e41461062c57806370a0823114610641578063759cb53b1461068457600080fd5b80634e71e0c8116102385780634e71e0c8146105745780635c975abb146105895780635cbadbe4146105a157600080fd5b80633ba0b9a9146105165780633f4ba83a1461052b57806347aea09f1461054057600080fd5b806318160ddd116102c057806323b872dd1161029a57806323b872dd1461049b578063313ce567146104bb5780633644e5151461050157600080fd5b806318160ddd1461044857806320e8c56514610488578063213cae631461034e57600080fd5b8063095ea7b3116102f1578063095ea7b3146103925780630b1e1031146103c2578063128fced11461041b57600080fd5b806306fdde0314610323578063071bc3c91461034e578063078dfbe71461037057600080fd5b3661031e57005b600080fd5b34801561032f57600080fd5b50610338610a8f565b604051610345919061568c565b60405180910390f35b34801561035a57600080fd5b50610363610b21565b604051610345919061572e565b34801561037c57600080fd5b5061039061038b366004615778565b610c78565b005b34801561039e57600080fd5b506103b26103ad3660046157c1565b610e69565b6040519015158152602001610345565b3480156103ce57600080fd5b506103f67f0000000000000000000000007e880867363a7e321f5d260cade2b0bb2f717b0281565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610345565b34801561042757600080fd5b5061043b6104363660046157eb565b610e83565b6040516103459190615836565b34801561045457600080fd5b506002547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff165b604051908152602001610345565b61047a610496366004615849565b610fd6565b3480156104a757600080fd5b506103b26104b636600461588b565b611273565b3480156104c757600080fd5b506104ef7f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610345565b34801561050d57600080fd5b5061047a6113dd565b34801561052257600080fd5b5061047a6113ec565b34801561053757600080fd5b5061039061147d565b34801561054c57600080fd5b5061047a7f000000000000000000000000000000000000000000000000000000000000006481565b34801561058057600080fd5b50610390611508565b34801561059557600080fd5b5060385460ff166103b2565b3480156105ad57600080fd5b506106036105bc3660046158c7565b60396020908152600092835260408084209091529082529020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b604080516fffffffffffffffffffffffffffffffff938416815292909116602083015201610345565b34801561063857600080fd5b5061047a606481565b34801561064d57600080fd5b5061047a61065c3660046157eb565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561069057600080fd5b506103f6734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81565b3480156106b857600080fd5b506103f673f403c135812408bfbe8713b5a23a04b3d48aae3181565b3480156106e057600080fd5b5061047a6106ef3660046158fa565b61161f565b34801561070057600080fd5b506103f67f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc81565b34801561073457600080fd5b506103b26107433660046157eb565b6118c8565b34801561075457600080fd5b5061047a6107633660046157eb565b611986565b34801561077457600080fd5b506103f67f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc81565b3480156107a857600080fd5b506103906119b1565b3480156107bd57600080fd5b506103f673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b3480156107e557600080fd5b506006546103f69073ffffffffffffffffffffffffffffffffffffffff1681565b34801561081257600080fd5b506103f673d533a949740bb3306d119cc777fa900ba034cd5281565b34801561083a57600080fd5b50610338611a3a565b34801561084f57600080fd5b50610858611a49565b60405161034593929190615984565b34801561087357600080fd5b506103b26108823660046157c1565b611b0b565b34801561089357600080fd5b5061047a603a5481565b3480156108a957600080fd5b506103f673853d955acef822db058eb8505911ed77f175b99e81565b3480156108d157600080fd5b506103f67f000000000000000000000000dcef968d416a41cdac0ed8702fac8128a64241a281565b34801561090557600080fd5b5061047a6109143660046157c1565b611c69565b34801561092557600080fd5b50610363611cd3565b34801561093a57600080fd5b5061047a6109493660046157c1565b611cdd565b34801561095a57600080fd5b506103906109693660046159fb565b611d40565b34801561097a57600080fd5b5061043b611eff565b34801561098f57600080fd5b5061047a61099e3660046158c7565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b3480156109e257600080fd5b506007546103f69073ffffffffffffffffffffffffffffffffffffffff1681565b348015610a0f57600080fd5b50610603610a1e3660046157eb565b603b602052600090815260409020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b348015610a6657600080fd5b5061043b610a753660046157eb565b611fe7565b348015610a8657600080fd5b5061043b6121a7565b606060038054610a9e90615a68565b80601f0160208091040260200160405190810160405280929190818152602001828054610aca90615a68565b8015610b175780601f10610aec57610100808354040283529160200191610b17565b820191906000526020600020905b815481529060010190602001808311610afa57829003601f168201915b5050505050905090565b604080516003808252608082019092526060916020820183803683370190505090507f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc81600081518110610b7757610b77615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073853d955acef822db058eb8505911ed77f175b99e81600181518110610bd957610bd9615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881600281518110610c3b57610c3b615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505090565b60065473ffffffffffffffffffffffffffffffffffffffff163314610cfe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b8115610e235773ffffffffffffffffffffffffffffffffffffffff8316151580610d255750805b610d8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4f776e61626c653a207a65726f206164647265737300000000000000000000006044820152606401610cf5565b60065460405173ffffffffffffffffffffffffffffffffffffffff8086169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff85167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155600780549091169055505050565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555b505050565b600033610e77818585612328565b60019150505b92915050565b60606000610e8f6124dc565b9050805167ffffffffffffffff811115610eab57610eab615ab5565b604051908082528060200260200182016040528015610ed4578160200160208202803683370190505b50915060005b8151811015610fcf5760396000838381518110610ef957610ef9615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16838281518110610fbc57610fbc615ae4565b6020908102919091010152600101610eda565b5050919050565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff160161108b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790556110dd846118c8565b61112b576040517faeabe71800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610cf5565b82600003611165576040517fa907f2f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611170843385612586565b61117a8484612632565b9050818110156111c0576040517fbc71f2ba0000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610cf5565b6111ca858261275e565b604080518481526020810183905273ffffffffffffffffffffffffffffffffffffffff808716929088169133917f5fe47ed6d4225326d3303476197d782ded5a4e9c14f479dc9ec4992af4e85d59910160405180910390a4600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0100000000000000000000000000000000000000000000000000000000000000179055949350505050565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff1601611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790553361137d85828561291c565b6113888585856129f3565b6001915050600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790559392505050565b60006113e7612d46565b905090565b60007f000000000000000000000000dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa158015611459573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190615b13565b60065473ffffffffffffffffffffffffffffffffffffffff1633146114fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cf5565b611506612e7a565b565b60075473ffffffffffffffffffffffffffffffffffffffff1633811461158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e65726044820152606401610cf5565b60065460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055600780549091169055565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff16016116d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0200000000000000000000000000000000000000000000000000000000000000179055611726846118c8565b611774576040517f88a5056100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610cf5565b846000036117ae576040517fc3d83b0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81156117c3576117be3086612ef7565b6117cd565b6117cd3386612ef7565b6117d8868587613176565b90508281101561181e576040517fbfee4ca00000000000000000000000000000000000000000000000000000000081526004810182905260248101849052604401610cf5565b604080518681526020810183905273ffffffffffffffffffffffffffffffffffffffff808716929089169133917faee47cdf925cf525fdae94f9777ee5a06cac37e1c41220d0a8a89ed154f62d1c910160405180910390a4600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017905595945050505050565b60007f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148061194d575073ffffffffffffffffffffffffffffffffffffffff821673853d955acef822db058eb8505911ed77f175b99e145b80610e7d575073ffffffffffffffffffffffffffffffffffffffff821673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481492915050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040812054610e7d565b60065473ffffffffffffffffffffffffffffffffffffffff163314611a32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cf5565b6115066132a4565b606060048054610a9e90615a68565b600080600060017f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc7f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b009190615b2c565b925092509250909192565b6002546000907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff1601611bc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f020000000000000000000000000000000000000000000000000000000000000017905533611c158185856129f3565b6001915050600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017905592915050565b6000611c74836118c8565b611cc2576040517faeabe71800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610cf5565b611ccc83836132ff565b9392505050565b60606113e76124dc565b6000611ce8836118c8565b611d36576040517f88a5056100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610cf5565b611ccc8383613365565b83421115611daa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610cf5565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888611dd98c6133cb565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000611e4182613400565b90506000611e5182878787613469565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611ee8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610cf5565b611ef38a8a8a612328565b50505050505050505050565b60606000611f0b6124dc565b9050805167ffffffffffffffff811115611f2757611f27615ab5565b604051908082528060200260200182016040528015611f50578160200160208202803683370190505b50915060005b8151811015611fe257603b6000838381518110611f7557611f75615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205483516fffffffffffffffffffffffffffffffff90911690849083908110611fcf57611fcf615ae4565b6020908102919091010152600101611f56565b505090565b6002546060907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff160161209c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790556120ed613491565b6120f6826134fe565b612100828361350c565b90508173ffffffffffffffffffffffffffffffffffffffff167f2193aa20a3717f5f4ac79482f4f553e5f0afe8f4e6ec3e3d1aa2e138adc4763f6121426124dc565b83604051612151929190615b49565b60405180910390a2600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0100000000000000000000000000000000000000000000000000000000000000179055919050565b60606121b1613491565b6002547ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f010000000000000000000000000000000000000000000000000000000000000090910460ff1601612263576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610cf5565b600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001790556122b4613876565b50506122be611eff565b9050600280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017905590565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff83166123ca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff821661246d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b604080516002808252606080830184529260208301908036833701905050905073d533a949740bb3306d119cc777fa900ba034cd528160008151811061252457612524615ae4565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81600181518110610c3b57610c3b615ae4565b73ffffffffffffffffffffffffffffffffffffffff831661260a57803414610e64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f657468206d69736d6174636800000000000000000000000000000000000000006044820152606401610cf5565b8015610e6457610e6473ffffffffffffffffffffffffffffffffffffffff8416833084613bc4565b60007f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361268e57508061269b565b6126988383613ca0565b90505b6040517f43a0d0660000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000646004820152602481018290526001604482015273f403c135812408bfbe8713b5a23a04b3d48aae31906343a0d066906064016020604051808303816000875af1158015612733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127579190615b77565b5092915050565b73ffffffffffffffffffffffffffffffffffffffff82166127db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610cf5565b6127e760008383613d8a565b6127f081613d9c565b600280546000906128239084907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16615bc3565b92506101000a8154817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128c59190615bfb565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146129ed57818110156129e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610cf5565b6129ed8484848403612328565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612a96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff8216612b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612bce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f45524332303a207472616e7366657220746f2073656c660000000000000000006044820152606401610cf5565b612bd9838383613d8a565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015612c8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290612cd3908490615bfb565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612d3991815260200190565b60405180910390a36129ed565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d393d1ddd6b8811a86d925f5e14014282581bc0416148015612dac57507f000000000000000000000000000000000000000000000000000000000000000146145b15612dd657507fac81a09d6be299cc9d7c5c2b8cea9812819871c9dc6347a8b24442d79013edee90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fb2ce7afed6af63e19eb371df425d1977ba1403533d205a7e34d3db371ba1d08c828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b612e82613dce565b603880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff8216612f9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b612fa682600083613d8a565b73ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020548181101561305c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020828203905561308f82613d9c565b600280546000906130c29084907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16615c0e565b92506101000a8154817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516124cf91815260200190565b6040517fc32e720200000000000000000000000000000000000000000000000000000000815260048101829052600060248201819052907f0000000000000000000000007e880867363a7e321f5d260cade2b0bb2f717b0273ffffffffffffffffffffffffffffffffffffffff169063c32e7202906044016020604051808303816000875af115801561320d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132319190615b77565b507f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361328c575080613299565b6132968383613e3a565b90505b611ccc838583613f13565b6132ac613491565b603880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612ecd3390565b60007f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361335b575080610e7d565b611ccc8383614026565b60007f0000000000000000000000003175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036133c1575080610e7d565b611ccc8383614032565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090208054600181018255905b50919050565b6000610e7d61340d612d46565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061347a878787876140d9565b91509150613487816141f1565b5095945050505050565b60385460ff1615611506576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610cf5565b613509816000614445565b50565b606060006135186124dc565b9050805167ffffffffffffffff81111561353457613534615ab5565b60405190808252806020026020018201604052801561355d578160200160208202803683370190505b50915060005b815181101561386e576039600083838151811061358257613582615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1683828151811061364557613645615ae4565b60200260200101818152505082818151811061366357613663615ae4565b602002602001015160001461385c5760006039600084848151811061368a5761368a615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555061376483828151811061375757613757615ae4565b60200260200101516144f9565b603b600084848151811061377a5761377a615ae4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff166137e99190615c46565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555061385c82828151811061383457613834615ae4565b60200260200101518585848151811061384f5761384f615ae4565b6020026020010151613f13565b8061386681615c6f565b915050613563565b505092915050565b6060806138816124dc565b9150815167ffffffffffffffff81111561389d5761389d615ab5565b6040519080825280602002602001820160405280156138c6578160200160208202803683370190505b50905081516000036138d6579091565b43603a5414613b265743603a5560006138ed614518565b90506138f7614544565b60005b8351811015613b2357600084828151811061391757613917615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff81166000908152603b9092526040822054875191935070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906139989088908690811061398b5761398b615ae4565b60200260200101516145c0565b6139a29190615ca7565b73ffffffffffffffffffffffffffffffffffffffff83166000908152603b60205260408120549192506fffffffffffffffffffffffffffffffff909116908190036139eb575060015b8415613a08576139fb8286614678565b613a059082615bfb565b90505b613a11816144f9565b73ffffffffffffffffffffffffffffffffffffffff84166000908152603b6020526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055613a7e826144f9565b73ffffffffffffffffffffffffffffffffffffffff84166000908152603b602052604090208054601090613ad990849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16615cba565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050505080613b1c90615c6f565b90506138fa565b50505b60005b8251811015613bbf57603b6000848381518110613b4857613b48615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205482516fffffffffffffffffffffffffffffffff90911690839083908110613ba257613ba2615ae4565b602090810291909101015280613bb781615c6f565b915050613b29565b509091565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526129ed9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526146a7565b6000613caa61564a565b8281613cb5866147b3565b60028110613cc557613cc5615ae4565b60200201526040517f0b4c7e4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000dcef968d416a41cdac0ed8702fac8128a64241a21690630b4c7e4d90613d3f908490600090600401615ce3565b6020604051808303816000875af1158015613d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d829190615b13565b949350505050565b613d92613491565b610e648383614445565b60007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115613dca57600080fd5b5090565b60385460ff16611506576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610cf5565b60007f000000000000000000000000dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff16631a4d01d283613e8a613e85876147b3565b6147f9565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252600f0b6024820152600060448201526064016020604051808303816000875af1158015613eef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc9190615b13565b80600003613f2057505050565b73ffffffffffffffffffffffffffffffffffffffff83166140055760008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114613f95576040519150601f19603f3d011682016040523d82523d6000602084013e613f9a565b606091505b50509050806129ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6574682073656e64206661696c656400000000000000000000000000000000006044820152606401610cf5565b610e6473ffffffffffffffffffffffffffffffffffffffff8416838361480c565b6000611ccc8383614862565b60007f000000000000000000000000dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff1663cc2b27d78361407d613e85876147b3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252600f0b6024820152604401602060405180830381865afa158015613eef573d6000803e3d6000fd5b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561411057506000905060036141e8565b8460ff16601b1415801561412857508460ff16601c14155b1561413957506000905060046141e8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561418d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166141e1576000600192509250506141e8565b9150600090505b94509492505050565b600081600481111561420557614205615955565b0361420d5750565b600181600481111561422157614221615955565b03614288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610cf5565b600281600481111561429c5761429c615955565b03614303576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610cf5565b600381600481111561431757614317615955565b036143a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b60048160048111156143b8576143b8615955565b03613509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610cf5565b600080614450613876565b9150915081516000036144635750505050565b73ffffffffffffffffffffffffffffffffffffffff84161580159061449e575073ffffffffffffffffffffffffffffffffffffffff84163014155b156144ae576144ae848383614c1f565b73ffffffffffffffffffffffffffffffffffffffff8316158015906144e9575073ffffffffffffffffffffffffffffffffffffffff83163014155b156129ed576129ed838383614c1f565b60006fffffffffffffffffffffffffffffffff821115613dca57600080fd5b60006113e76002547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7f0000000000000000000000007e880867363a7e321f5d260cade2b0bb2f717b0273ffffffffffffffffffffffffffffffffffffffff16633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156145ac57600080fd5b505af11580156129ed573d6000803e3d6000fd5b600073ffffffffffffffffffffffffffffffffffffffff821615614671576040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015614648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061466c9190615b13565b610e7d565b4792915050565b60008061468d670de0b6b3a764000085615d1b565b905082818161469e5761469e615d32565b04949350505050565b6000614709826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614f8a9092919063ffffffff16565b805190915015610e6457808060200190518101906147279190615b77565b610e64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610cf5565b600073ffffffffffffffffffffffffffffffffffffffff821673853d955acef822db058eb8505911ed77f175b99e146147ed5760016147f0565b60005b60ff1692915050565b6000610e7d61480783614f99565b614fc8565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610e649084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401613c1e565b60008073dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff166376a2f0f06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156148c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148e89190615b13565b905060006148f68585615013565b90506000614902615076565b905061490c61564a565b61491681836151a2565b600061492283866151ec565b90506000733175df0976dfa876431c2e9ee6bc45b65d3473cc73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149a99190615b13565b905060005b6002811015614a04578581600281106149c9576149c9615ae4565b60200201518482600281106149e0576149e0615ae4565b602002018181516149f19190615bfb565b9052506149fd81615c6f565b90506149ae565b506000614a1184886151ec565b9050828111614a2257614a22615d61565b614a2a61564a565b6000614a3860016002615ca7565b614a43906004615d1b565b600273dcef968d416a41cdac0ed8702fac8128a64241a273ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015614aa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ac89190615b13565b614ad29190615d1b565b614adc9190615d90565b905060005b6002811015614be057600086898360028110614aff57614aff615ae4565b6020020151614b0e9087615d1b565b614b189190615d90565b9050600080898460028110614b2f57614b2f615ae4565b6020020151905080831115614b4f57614b488184615ca7565b9150614b5c565b614b598382615ca7565b91505b6402540be400614b6c8387615d1b565b614b769190615d90565b868560028110614b8857614b88615ae4565b6020020152858460028110614b9f57614b9f615ae4565b60200201518a8560028110614bb657614bb6615ae4565b60200201818151614bc79190615ca7565b905250614bd99250839150615c6f9050565b9050614ae1565b506000614bed878b6151ec565b905085614bfa8183615ca7565b614c049087615d1b565b614c0e9190615d90565b9d9c50505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff831615801590614c5a575073ffffffffffffffffffffffffffffffffffffffff83163014155b614c6657614c66615d61565b6000614c7184615257565b905060005b8351811015614f83576000848281518110614c9357614c93615ae4565b602002602001015190506000848381518110614cb157614cb1615ae4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff8085166000908152603984526040808220928c168252919093528220549092506fffffffffffffffffffffffffffffffff1690819003614d9157614d15826144f9565b73ffffffffffffffffffffffffffffffffffffffff9384166000908152603960209081526040808320968c1683529590529390932080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9094169390931790925550614f739050565b818103614da057505050614f73565b6000614dac8284615ca7565b90506000614dba8783615282565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152603960209081526040808320938f1683529290529081205491925090614e2490839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16615bfb565b90506040518060400160405280614e3a876144f9565b6fffffffffffffffffffffffffffffffff168152602001614e5a836144f9565b6fffffffffffffffffffffffffffffffff16815250603960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050505050505050505b614f7c81615c6f565b9050614c76565b5050505050565b6060613d8284846000856152a0565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115613dca57600080fd5b60007fffffffffffffffffffffffffffffffff80000000000000000000000000000000821280159061500a57506f7fffffffffffffffffffffffffffffff8213155b613dca57600080fd5b61501b61564a565b818173ffffffffffffffffffffffffffffffffffffffff851673853d955acef822db058eb8505911ed77f175b99e14615055576001615058565b60005b60ff166002811061506b5761506b615ae4565b602002015292915050565b61507e61564a565b6040517f4903b0d10000000000000000000000000000000000000000000000000000000081526000600482015273dcef968d416a41cdac0ed8702fac8128a64241a290634903b0d190602401602060405180830381865afa1580156150e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061510b9190615b13565b81526040517f4903b0d10000000000000000000000000000000000000000000000000000000081526001600482015273dcef968d416a41cdac0ed8702fac8128a64241a290634903b0d190602401602060405180830381865afa158015615176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061519a9190615b13565b602082015290565b60005b6002811015610e64578181600281106151c0576151c0615ae4565b60200201518382600281106151d7576151d7615ae4565b60200201526151e581615c6f565b90506151a5565b60006151f661564a565b8351670de0b6b3a76400009061520c9082615d1b565b6152169190615d90565b81526020840151670de0b6b3a76400009061523e906c0c9f2c9cd04674edea40000000615d1b565b6152489190615d90565b6020820152613d828184615436565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812054610e7d565b60008061528f8385615d1b565b9050670de0b6b3a76400008161469e565b606082471015615332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610cf5565b73ffffffffffffffffffffffffffffffffffffffff85163b6153b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610cf5565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516153d99190615dcb565b60006040518083038185875af1925050503d8060008114615416576040519150601f19603f3d011682016040523d82523d6000602084013e61541b565b606091505b509150915061542b8282866155f7565b979650505050505050565b60008080805b60028110156154785785816002811061545757615457615ae4565b60200201516154669084615bfb565b925061547181615c6f565b905061543c565b508160000361548c57600092505050610e7d565b81600061549a600287615d1b565b905060005b60ff8110156155e4578260005b60028110156154fe5760028a82600281106154c9576154c9615ae4565b60200201516154d89190615d1b565b6154e28684615d1b565b6154ec9190615d90565b91506154f781615c6f565b90506154ac565b5083945080600260016155119190615bfb565b61551b9190615d1b565b6064856155288287615ca7565b6155329190615d1b565b61553c9190615d90565b6155469190615bfb565b84615552600284615d1b565b606461555e8a88615d1b565b6155689190615d90565b6155729190615bfb565b61557c9190615d1b565b6155869190615d90565b9350848411156155b457600161559c8686615ca7565b116155af57839650505050505050610e7d565b6155d3565b60016155c08587615ca7565b116155d357839650505050505050610e7d565b506155dd81615c6f565b905061549f565b506155ed615d61565b5050505092915050565b60608315615606575081611ccc565b8251156156165782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf5919061568c565b60405180604001604052806002906020820280368337509192915050565b60005b8381101561568357818101518382015260200161566b565b50506000910152565b60208152600082518060208401526156ab816040850160208701615668565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600081518084526020808501945080840160005b8381101561572357815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016156f1565b509495945050505050565b602081526000611ccc60208301846156dd565b803573ffffffffffffffffffffffffffffffffffffffff8116811461576557600080fd5b919050565b801515811461350957600080fd5b60008060006060848603121561578d57600080fd5b61579684615741565b925060208401356157a68161576a565b915060408401356157b68161576a565b809150509250925092565b600080604083850312156157d457600080fd5b6157dd83615741565b946020939093013593505050565b6000602082840312156157fd57600080fd5b611ccc82615741565b600081518084526020808501945080840160005b838110156157235781518752958201959082019060010161581a565b602081526000611ccc6020830184615806565b6000806000806080858703121561585f57600080fd5b61586885615741565b935061587660208601615741565b93969395505050506040820135916060013590565b6000806000606084860312156158a057600080fd5b6158a984615741565b92506158b760208501615741565b9150604084013590509250925092565b600080604083850312156158da57600080fd5b6158e383615741565b91506158f160208401615741565b90509250929050565b600080600080600060a0868803121561591257600080fd5b61591b86615741565b94506020860135935061593060408701615741565b92506060860135915060808601356159478161576a565b809150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60608101600285106159bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b93815273ffffffffffffffffffffffffffffffffffffffff92909216602083015260ff1660409091015290565b60ff8116811461350957600080fd5b600080600080600080600060e0888a031215615a1657600080fd5b615a1f88615741565b9650615a2d60208901615741565b955060408801359450606088013593506080880135615a4b816159ec565b9699959850939692959460a0840135945060c09093013592915050565b600181811c90821680615a7c57607f821691505b6020821081036133fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215615b2557600080fd5b5051919050565b600060208284031215615b3e57600080fd5b8151611ccc816159ec565b604081526000615b5c60408301856156dd565b8281036020840152615b6e8185615806565b95945050505050565b600060208284031215615b8957600080fd5b8151611ccc8161576a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81811683821601908082111561275757612757615b94565b80820180821115610e7d57610e7d615b94565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82811682821603908082111561275757612757615b94565b6fffffffffffffffffffffffffffffffff82811682821603908082111561275757612757615b94565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615ca057615ca0615b94565b5060010190565b81810381811115610e7d57610e7d615b94565b6fffffffffffffffffffffffffffffffff81811683821601908082111561275757612757615b94565b60608101818460005b6002811015615d0b578151835260209283019290910190600101615cec565b5050508260408301529392505050565b8082028115828204841417610e7d57610e7d615b94565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600082615dc6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251615ddd818460208701615668565b919091019291505056fea2646970667358221220bf6c5df3fad3bd43053f11c967647b2c0fe2730c5050277da9c764a5dd3ac15364736f6c63430008110033

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

00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001a53592046524158555344435f43757276654c5020436f6e766578000000000000000000000000000000000000000000000000000000000000000000000000001a53592d46524158555344435f43757276654c5020436f6e766578000000000000

-----Decoded View---------------
Arg [0] : _name (string): SY FRAXUSDC_CurveLP Convex
Arg [1] : _symbol (string): SY-FRAXUSDC_CurveLP Convex

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 000000000000000000000000000000000000000000000000000000000000001a
Arg [3] : 53592046524158555344435f43757276654c5020436f6e766578000000000000
Arg [4] : 000000000000000000000000000000000000000000000000000000000000001a
Arg [5] : 53592d46524158555344435f43757276654c5020436f6e766578000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

Pendle is essentially a protocol for tokenizing yield and an AMM for trading tokenized yield and other time-decaying assets.

Validator Index Block Amount
View All Withdrawals

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

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