ETH Price: $3,669.77 (+0.82%)

Token

YT GLP 28MAR2024 (YT-GLP-28MAR2024)

Overview

Max Total Supply

4,945,732.605803786324503282 YT-GLP-28MAR2024

Holders

887 (0.00%)

Total Transfers

-

Market

Price

$0.00 @ 0.000000 ETH

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Loading...
Loading
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.

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x23231848...5A697b594
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PendleYieldTokenV2

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

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

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "../../interfaces/IStandardizedYield.sol";
import "../../interfaces/IPYieldTokenV2.sol";
import "../../interfaces/IPPrincipalToken.sol";

import "../libraries/math/Math.sol";
import "../libraries/ArrayLib.sol";
import "../../interfaces/IPYieldContractFactory.sol";
import "../StandardizedYield/SYUtils.sol";
import "../libraries/Errors.sol";
import "../libraries/MiniHelpers.sol";

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

/**
Invariance to maintain:
- address(0) & address(this) should never have any rewards & activeBalance accounting done. This is
    guaranteed by address(0) & address(this) check in each updateForTwo function
*/
contract PendleYieldTokenV2 is
    IPYieldTokenV2,
    PendleERC20Permit,
    RewardManager,
    InterestManagerYTV2
{
    using Math for uint256;
    using SafeERC20 for IERC20;
    using ArrayLib for uint256[];

    struct PostExpiryData {
        uint256 firstPYIndex;
    }

    address public immutable SY;
    address public immutable PT;
    address public immutable factory;
    uint256 public immutable expiry;

    bool public immutable doCacheIndexSameBlock;

    uint256 public syReserve;

    uint128 public pyIndexLastUpdatedBlock;
    uint128 internal _pyIndexStored;

    PostExpiryData public postExpiry;

    uint256 internal _lastCollectedInterestIndex;

    modifier updateData() {
        if (isExpired()) _setPostExpiryData();
        _;
        _updateSyReserve();
    }

    modifier notExpired() {
        if (isExpired()) revert Errors.YCExpired();
        _;
    }

    /**
     * @param _doCacheIndexSameBlock if true, the PY index is cached for each block, and thus is
     * constant for all txs within the same block. Otherwise, the PY index is recalculated for
     * every tx.
     */
    constructor(
        address _SY,
        address _PT,
        string memory _name,
        string memory _symbol,
        uint8 __decimals,
        uint256 _expiry,
        bool _doCacheIndexSameBlock
    ) PendleERC20Permit(_name, _symbol, __decimals) {
        SY = _SY;
        PT = _PT;
        expiry = _expiry;
        factory = msg.sender;
        doCacheIndexSameBlock = _doCacheIndexSameBlock;
    }

    /**
     * @notice Tokenize SY into PT + YT of equal qty. Every unit of asset of SY will create 1 PT + 1 YT
     * @dev SY must be transferred to this contract prior to calling
     */
    function mintPY(address receiverPT, address receiverYT)
        external
        nonReentrant
        notExpired
        updateData
        returns (uint256 amountPYOut)
    {
        address[] memory receiverPTs = new address[](1);
        address[] memory receiverYTs = new address[](1);
        uint256[] memory amountSyToMints = new uint256[](1);

        (receiverPTs[0], receiverYTs[0], amountSyToMints[0]) = (
            receiverPT,
            receiverYT,
            _getFloatingSyAmount()
        );

        uint256[] memory amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountSyToMints);
        amountPYOut = amountPYOuts[0];
    }

    /// @notice Tokenize SY into PT + YT for multiple receivers. See `mintPY()` for more details
    function mintPYMulti(
        address[] calldata receiverPTs,
        address[] calldata receiverYTs,
        uint256[] calldata amountSyToMints
    ) external nonReentrant notExpired updateData returns (uint256[] memory amountPYOuts) {
        uint256 length = receiverPTs.length;

        if (length == 0) revert Errors.ArrayEmpty();
        if (receiverYTs.length != length || amountSyToMints.length != length)
            revert Errors.ArrayLengthMismatch();

        uint256 totalSyToMint = amountSyToMints.sum();
        if (totalSyToMint > _getFloatingSyAmount())
            revert Errors.YieldContractInsufficientSy(totalSyToMint, _getFloatingSyAmount());

        amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountSyToMints);
    }

    /**
     * @notice converts PT(+YT) tokens into SY, but interests & rewards are not redeemed at the
     * same time
     * @dev PT/YT must be transferred to this contract prior to calling
     */
    function redeemPY(address receiver)
        external
        nonReentrant
        updateData
        returns (uint256 amountSyOut)
    {
        address[] memory receivers = new address[](1);
        uint256[] memory amounts = new uint256[](1);
        (receivers[0], amounts[0]) = (receiver, _getAmountPYToRedeem());

        uint256[] memory amountSyOuts;
        amountSyOuts = _redeemPY(receivers, amounts);

        amountSyOut = amountSyOuts[0];
    }

    /**
     * @notice redeems PT(+YT) for multiple users. See `redeemPY()`
     * @dev PT/YT must be transferred to this contract prior to calling
     * @dev fails if unable to redeem the total PY amount in `amountPYToRedeems`
     */
    function redeemPYMulti(address[] calldata receivers, uint256[] calldata amountPYToRedeems)
        external
        nonReentrant
        updateData
        returns (uint256[] memory amountSyOuts)
    {
        if (receivers.length != amountPYToRedeems.length) revert Errors.ArrayLengthMismatch();
        if (receivers.length == 0) revert Errors.ArrayEmpty();
        amountSyOuts = _redeemPY(receivers, amountPYToRedeems);
    }

    /**
     * @notice Redeems interests and rewards for `user`
     * @param redeemInterest will only transfer out interest for user if true
     * @param redeemRewards will only transfer out rewards for user if true
     * @dev With YT yielding interest in the form of SY, which is redeemable by users, the reward
     * distribution should be based on the amount of SYs that their YT currently represent, plus
     * their dueInterest. It has been proven and tested that _rewardSharesUser will not change over
     * time, unless users redeem their dueInterest or redeemPY. Due to this, it is required to
     * update users' accruedReward STRICTLY BEFORE transferring out their interest.
     */
    function redeemDueInterestAndRewards(
        address user,
        bool redeemInterest,
        bool redeemRewards
    ) external nonReentrant updateData returns (uint256 interestOut, uint256[] memory rewardsOut) {
        if (!redeemInterest && !redeemRewards) revert Errors.YCNothingToRedeem();

        // if redeemRewards == true, this line must be here for obvious reason
        // if redeemInterest == true, this line must be here because of the reason above
        _updateAndDistributeRewards(user);

        if (redeemRewards) {
            rewardsOut = _doTransferOutRewards(user, user);
            emit RedeemRewards(user, rewardsOut);
        } else {
            address[] memory tokens = getRewardTokens();
            rewardsOut = new uint256[](tokens.length);
        }

        if (redeemInterest) {
            _updateAndDistributeInterest(user);
            interestOut = _doTransferOutInterest(user, SY);
            emit RedeemInterest(user, interestOut);
        } else {
            interestOut = 0;
        }
    }

    /**
     * @dev All rewards and interests accrued post-expiry goes to the treasury.
     * Reverts if called pre-expiry.
     */
    function redeemInterestAndRewardsPostExpiryForTreasury() external nonReentrant updateData {
        if (!isExpired()) revert Errors.YCNotExpired();

        _collectInterest();
        _redeemExternalReward();
    }

    /// @notice updates and returns the reward indexes
    function rewardIndexesCurrent() external override nonReentrant returns (uint256[] memory) {
        return IStandardizedYield(SY).rewardIndexesCurrent();
    }

    /**
     * @notice updates and returns the current PY index
     * @dev this function maximizes the current PY index with the previous index, guaranteeing
     * non-decreasing PY index
     * @dev if `doCacheIndexSameBlock` is true, PY index only updates at most once per block,
     * and has no state changes on the second call onwards (within the same block).
     * @dev see `pyIndexStored()` for view function for cached value.
     */
    function pyIndexCurrent() public nonReentrant returns (uint256 currentIndex) {
        currentIndex = _pyIndexCurrent();
    }

    /// @notice returns the last-updated PY index
    function pyIndexStored() public view returns (uint256) {
        return _pyIndexStored;
    }

    /**
     * @notice do a final rewards redeeming, and sets post-expiry data
     * @dev has no effect if called pre-expiry
     */
    function setPostExpiryData() external nonReentrant {
        if (isExpired()) {
            _setPostExpiryData();
        }
    }

    /**
     * @notice returns the current data post-expiry, if exists
     * @dev reverts if post-expiry data not set (see `setPostExpiryData()`)
     * @return firstPYIndex the earliest PY index post-expiry
     */
    function getPostExpiryData() external view returns (uint256 firstPYIndex) {
        if (postExpiry.firstPYIndex == 0) revert Errors.YCPostExpiryDataNotSet();
        firstPYIndex = postExpiry.firstPYIndex;
    }

    function _mintPY(
        address[] memory receiverPTs,
        address[] memory receiverYTs,
        uint256[] memory amountSyToMints
    ) internal returns (uint256[] memory amountPYOuts) {
        amountPYOuts = new uint256[](amountSyToMints.length);

        uint256 index = _pyIndexCurrent();

        for (uint256 i = 0; i < amountSyToMints.length; i++) {
            amountPYOuts[i] = _calcPYToMint(amountSyToMints[i], index);

            _mint(receiverYTs[i], amountPYOuts[i]);
            IPPrincipalToken(PT).mintByYT(receiverPTs[i], amountPYOuts[i]);

            emit Mint(
                msg.sender,
                receiverPTs[i],
                receiverYTs[i],
                amountSyToMints[i],
                amountPYOuts[i]
            );
        }
    }

    function isExpired() public view returns (bool) {
        return MiniHelpers.isCurrentlyExpired(expiry);
    }

    function isDistributingInterestAndRewards() public view returns (bool) {
        return postExpiry.firstPYIndex == 0;
    }

    function _redeemPY(address[] memory receivers, uint256[] memory amountPYToRedeems)
        internal
        returns (uint256[] memory amountSyOuts)
    {
        uint256 totalAmountPYToRedeem = amountPYToRedeems.sum();
        IPPrincipalToken(PT).burnByYT(address(this), totalAmountPYToRedeem);
        if (!isExpired()) _burn(address(this), totalAmountPYToRedeem);

        uint256 index = _pyIndexCurrent();
        uint256 totalSyInterestPostExpiry;
        amountSyOuts = new uint256[](receivers.length);

        for (uint256 i = 0; i < receivers.length; i++) {
            uint256 syInterestPostExpiry;
            (amountSyOuts[i], syInterestPostExpiry) = _calcSyRedeemableFromPY(
                amountPYToRedeems[i],
                index
            );
            _transferOut(SY, receivers[i], amountSyOuts[i]);
            totalSyInterestPostExpiry += syInterestPostExpiry;

            emit Burn(msg.sender, receivers[i], amountPYToRedeems[i], amountSyOuts[i]);
        }

        address treasury = IPYieldContractFactory(factory).treasury();
        _transferOut(SY, treasury, totalSyInterestPostExpiry);
    }

    function _calcPYToMint(uint256 amountSy, uint256 indexCurrent)
        internal
        pure
        returns (uint256 amountPY)
    {
        // doesn't matter before or after expiry, since mintPY is only allowed before expiry
        return SYUtils.syToAsset(indexCurrent, amountSy);
    }

    function _calcSyRedeemableFromPY(uint256 amountPY, uint256 indexCurrent)
        internal
        view
        returns (uint256 syToUser, uint256 syInterestPostExpiry)
    {
        syToUser = SYUtils.assetToSy(indexCurrent, amountPY);
        if (isExpired()) {
            uint256 totalSyRedeemable = SYUtils.assetToSy(postExpiry.firstPYIndex, amountPY);
            syInterestPostExpiry = totalSyRedeemable - syToUser;
        }
    }

    function _getAmountPYToRedeem() internal view returns (uint256) {
        if (!isExpired()) return Math.min(_selfBalance(PT), balanceOf(address(this)));
        else return _selfBalance(PT);
    }

    function _updateSyReserve() internal virtual {
        syReserve = _selfBalance(SY);
    }

    function _getFloatingSyAmount() internal view returns (uint256 amount) {
        amount = _selfBalance(SY) - syReserve;
        if (amount == 0) revert Errors.YCNoFloatingSy();
    }

    function _setPostExpiryData() internal {
        PostExpiryData storage local = postExpiry;
        if (local.firstPYIndex != 0) return; // already set

        _updateInterestIndex();
        _updateRewardIndex();

        // by setting this, we have finished setting postExpiry data, all income will go to treasury
        local.firstPYIndex = _pyIndexCurrent().Uint128();
    }

    /*///////////////////////////////////////////////////////////////
                               INTEREST-RELATED
    //////////////////////////////////////////////////////////////*/

    function _pyIndexCurrent() internal returns (uint256 currentIndex) {
        if (doCacheIndexSameBlock && pyIndexLastUpdatedBlock == block.number)
            return _pyIndexStored;

        uint128 index128 = Math
            .max(IStandardizedYield(SY).exchangeRate(), _pyIndexStored)
            .Uint128();

        currentIndex = index128;
        _pyIndexStored = index128;
        pyIndexLastUpdatedBlock = uint128(block.number);
    }

    function _collectInterest()
        internal
        override
        returns (uint256 accuredAmount, uint256 currentIndex)
    {
        uint256 prevIndex = _lastCollectedInterestIndex;
        currentIndex = _pyIndexCurrent();

        if (prevIndex != 0 && prevIndex != currentIndex) {
            // guaranteed feeAmount != 0
            address treasury = IPYieldContractFactory(factory).treasury();
            uint256 interestFeeRate = isDistributingInterestAndRewards()
                ? IPYieldContractFactory(factory).interestFeeRate()
                : Math.ONE;

            uint256 totalInterest = _calcInterest(totalSupply(), prevIndex, currentIndex);
            uint256 feeAmount = totalInterest.mulDown(interestFeeRate);
            accuredAmount = totalInterest - feeAmount;

            _transferOut(SY, treasury, feeAmount);
            _updateSyReserve();
            emit CollectInterestFee(feeAmount);
        }

        _lastCollectedInterestIndex = currentIndex;
    }

    function _calcInterest(
        uint256 principal,
        uint256 prevIndex,
        uint256 currentIndex
    ) internal pure returns (uint256) {
        return (principal * (currentIndex - prevIndex)).divDown(prevIndex * currentIndex);
    }

    function _YTbalance(address user) internal view override returns (uint256) {
        return balanceOf(user);
    }

    function _YTSupply() internal view override returns (uint256) {
        return totalSupply();
    }

    function _getGlobalPYIndex() internal view virtual override returns (uint256) {
        return _pyIndexStored;
    }

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

    function getRewardTokens() public view returns (address[] memory) {
        return IStandardizedYield(SY).getRewardTokens();
    }

    function _redeemExternalReward() internal virtual override {
        IStandardizedYield(SY).claimRewards(address(this));

        address treasury = IPYieldContractFactory(factory).treasury();
        uint256 rewardFeeRate = isDistributingInterestAndRewards()
            ? IPYieldContractFactory(factory).rewardFeeRate()
            : Math.ONE;

        address[] memory rewardTokens = getRewardTokens();

        for (uint256 i = 0; i < rewardTokens.length; ++i) {
            address token = rewardTokens[i];
            uint256 accruedReward = _selfBalance(token) - rewardState[token].lastBalance;

            uint256 amountRewardFee = accruedReward.mulDown(rewardFeeRate);

            _transferOut(token, treasury, amountRewardFee);
            emit CollectRewardFee(token, amountRewardFee);
        }
    }

    /// @dev effectively returning the amount of SY generating rewards for this user
    function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
        uint256 index = userInterest[user].pyIndex;
        if (index == 0) return 0;
        return SYUtils.assetToSy(index, balanceOf(user)) + userInterest[user].accrued;
    }

    function _rewardSharesTotal() internal view virtual override returns (uint256) {
        return syReserve;
    }

    function _getRewardTokens() internal view virtual override returns (address[] memory) {
        return IStandardizedYield(SY).getRewardTokens();
    }

    //solhint-disable-next-line ordering
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256
    ) internal override {
        if (isExpired()) _setPostExpiryData();
        _updateAndDistributeRewardsForTwo(from, to);
        _updateAndDistributeInterestForTwo(from, to);
    }
}

File 2 of 33 : 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 3 of 33 : 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 4 of 33 : 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 5 of 33 : 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 6 of 33 : 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 7 of 33 : 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 8 of 33 : 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 9 of 33 : 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 10 of 33 : 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 11 of 33 : 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 12 of 33 : 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 13 of 33 : 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 14 of 33 : 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 15 of 33 : 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 16 of 33 : 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;
    }

    /// @notice return index of the element if found, else return uint256.max
    function find(address[] memory array, address element) internal pure returns (uint256 index) {
        uint256 length = array.length;
        for (uint256 i = 0; i < length; ) {
            if (array[i] == element) return i;
            unchecked {
                i++;
            }
        }
        return type(uint256).max;
    }

    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 17 of 33 : 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 RouterInvalidFacet(address facet);

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

    error SYApeDepositAmountTooSmall(uint256 amountDeposited);
    error SYBalancerInvalidPid();
    error SYInvalidRewardToken(address token);

    // 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 FDTotalAmountFundedNotMatch(uint256 actualTotalAmount, uint256 expectedTotalAmount);
    error FDEpochLengthMismatch();
    error FDInvalidPool(address pool);
    error FDPoolAlreadyExists(address pool);
    error FDInvalidNewFinishedEpoch(uint256 oldFinishedEpoch, uint256 newFinishedEpoch);
    error FDInvalidStartEpoch(uint256 startEpoch);
    error FDInvalidWTimeFund(uint256 lastFunded, uint256 wTime);
    error FDFutureFunding(uint256 lastFunded, uint256 currentWTime);

    error BDInvalidEpoch(uint256 epoch, uint256 startTime);

    // 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 FailedToSendEther();

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

    // Swap Aggregator
    error SAInsufficientTokenIn(address tokenIn, uint256 amountExpected, uint256 amountActual);
    error UnsupportedSelector(uint256 aggregatorType, bytes4 selector);
}

File 18 of 33 : 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 19 of 33 : MiniHelpers.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

library MiniHelpers {
    function isCurrentlyExpired(uint256 expiry) internal view returns (bool) {
        return (expiry <= block.timestamp);
    }

    function isExpired(uint256 expiry, uint256 blockTime) internal pure returns (bool) {
        return (expiry <= blockTime);
    }

    function isTimeInThePast(uint256 timestamp) internal view returns (bool) {
        return (timestamp <= block.timestamp); // same definition as isCurrentlyExpired
    }
}

File 20 of 33 : 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";
import "../../interfaces/IWETH.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);
        }
    }

    function _wrap_unwrap_ETH(
        address tokenIn,
        address tokenOut,
        uint256 netTokenIn
    ) internal {
        if (tokenIn == NATIVE) IWETH(tokenOut).deposit{ value: netTokenIn }();
        else IWETH(tokenIn).withdraw(netTokenIn);
    }
}

File 21 of 33 : 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 22 of 33 : 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 23 of 33 : SYUtils.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

library SYUtils {
    uint256 internal constant ONE = 1e18;

    function syToAsset(uint256 exchangeRate, uint256 syAmount) internal pure returns (uint256) {
        return (syAmount * exchangeRate) / ONE;
    }

    function syToAssetUp(uint256 exchangeRate, uint256 syAmount) internal pure returns (uint256) {
        return (syAmount * exchangeRate + ONE - 1) / ONE;
    }

    function assetToSy(uint256 exchangeRate, uint256 assetAmount) internal pure returns (uint256) {
        return (assetAmount * ONE) / exchangeRate;
    }

    function assetToSyUp(uint256 exchangeRate, uint256 assetAmount)
        internal
        pure
        returns (uint256)
    {
        return (assetAmount * ONE + exchangeRate - 1) / exchangeRate;
    }
}

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

import "../../interfaces/IPYieldToken.sol";
import "../../interfaces/IPPrincipalToken.sol";
import "../../interfaces/IPInterestManagerYTV2.sol";
import "../../interfaces/IPYieldContractFactory.sol";

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "../libraries/math/Math.sol";
import "../libraries/TokenHelper.sol";
import "../StandardizedYield/SYUtils.sol";

/*
With YT yielding more SYs overtime, which is allowed to be redeemed by users, the reward distribution should
be based on the amount of SYs that their YT currently represent, plus with their dueInterest.

It has been proven and tested that totalSyRedeemable will not change over time, unless users redeem their interest or redeemPY.

Due to this, it is required to update users' accruedReward STRICTLY BEFORE redeeming their interest.
*/
abstract contract InterestManagerYTV2 is TokenHelper, IPInterestManagerYTV2 {
    using Math for uint256;

    struct UserInterest {
        uint128 index;
        uint128 accrued;
        uint256 pyIndex;
    }

    uint256 public lastInterestBlock;

    uint256 public globalInterestIndex;

    mapping(address => UserInterest) public userInterest;

    uint256 internal constant INITIAL_INTEREST_INDEX = 1;

    function _updateAndDistributeInterest(address user) internal virtual {
        _updateAndDistributeInterestForTwo(user, address(0));
    }

    function _updateAndDistributeInterestForTwo(address user1, address user2) internal virtual {
        (uint256 index, uint256 pyIndex) = _updateInterestIndex();

        if (user1 != address(0) && user1 != address(this))
            _distributeInterestPrivate(user1, index, pyIndex);
        if (user2 != address(0) && user2 != address(this))
            _distributeInterestPrivate(user2, index, pyIndex);
    }

    function _doTransferOutInterest(address user, address SY)
        internal
        returns (uint256 interestAmount)
    {
        interestAmount = userInterest[user].accrued;
        userInterest[user].accrued = 0;
        _transferOut(SY, user, interestAmount);
    }

    // should only be callable from `_distributeInterestForTwo` & make sure user != address(0) && user != address(this)
    function _distributeInterestPrivate(
        address user,
        uint256 currentIndex,
        uint256 pyIndex
    ) private {
        assert(user != address(0) && user != address(this));

        uint256 prevIndex = userInterest[user].index;
        // uint256 interestFeeRate = _getInterestFeeRate();

        if (prevIndex == currentIndex) return;

        if (prevIndex == 0) {
            userInterest[user].index = currentIndex.Uint128();
            userInterest[user].pyIndex = pyIndex;
            return;
        }

        userInterest[user].accrued += _YTbalance(user).mulDown(currentIndex - prevIndex).Uint128();
        userInterest[user].index = currentIndex.Uint128();
        userInterest[user].pyIndex = pyIndex;
    }

    function _updateInterestIndex() internal returns (uint256 index, uint256 pyIndex) {
        if (lastInterestBlock != block.number) {
            // if we have not yet update the index for this block
            lastInterestBlock = block.number;

            uint256 totalShares = _YTSupply();
            uint256 accrued;

            (accrued, pyIndex) = _collectInterest();
            index = globalInterestIndex;

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

            globalInterestIndex = index;
        } else {
            index = globalInterestIndex;
            pyIndex = _getGlobalPYIndex();
        }
    }

    function _getGlobalPYIndex() internal view virtual returns (uint256);

    function _collectInterest() internal virtual returns (uint256, uint256);

    function _YTbalance(address user) internal view virtual returns (uint256);

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

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

interface IPInterestManagerYT {
    function userInterest(address user)
        external
        view
        returns (uint128 lastPYIndex, uint128 accruedInterest);
}

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

interface IPInterestManagerYTV2 {
    function userInterest(address user)
        external
        view
        returns (
            uint128 lastInterestIndex,
            uint128 accruedInterest,
            uint256 lastPYIndex
        );
}

File 27 of 33 : IPPrincipalToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface IPPrincipalToken is IERC20Metadata {
    function burnByYT(address user, uint256 amount) external;

    function mintByYT(address user, uint256 amount) external;

    function initialize(address _YT) external;

    function SY() external view returns (address);

    function YT() external view returns (address);

    function factory() external view returns (address);

    function expiry() external view returns (uint256);

    function isExpired() external view returns (bool);
}

File 28 of 33 : IPYieldContractFactory.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;

interface IPYieldContractFactory {
    event CreateYieldContract(address indexed SY, uint256 indexed expiry, address PT, address YT);

    event SetExpiryDivisor(uint256 newExpiryDivisor);

    event SetInterestFeeRate(uint256 newInterestFeeRate);

    event SetRewardFeeRate(uint256 newRewardFeeRate);

    event SetTreasury(address indexed treasury);

    function getPT(address SY, uint256 expiry) external view returns (address);

    function getYT(address SY, uint256 expiry) external view returns (address);

    function expiryDivisor() external view returns (uint96);

    function interestFeeRate() external view returns (uint128);

    function rewardFeeRate() external view returns (uint128);

    function treasury() external view returns (address);

    function isPT(address) external view returns (bool);

    function isYT(address) external view returns (bool);
}

File 29 of 33 : IPYieldToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./IRewardManager.sol";
import "./IPInterestManagerYT.sol";

interface IPYieldToken is IERC20Metadata, IRewardManager, IPInterestManagerYT {
    event NewInterestIndex(uint256 indexed newIndex);

    event Mint(
        address indexed caller,
        address indexed receiverPT,
        address indexed receiverYT,
        uint256 amountSyToMint,
        uint256 amountPYOut
    );

    event Burn(
        address indexed caller,
        address indexed receiver,
        uint256 amountPYToRedeem,
        uint256 amountSyOut
    );

    event RedeemRewards(address indexed user, uint256[] amountRewardsOut);

    event RedeemInterest(address indexed user, uint256 interestOut);

    event WithdrawFeeToTreasury(uint256[] amountRewardsOut, uint256 syOut);

    function mintPY(address receiverPT, address receiverYT) external returns (uint256 amountPYOut);

    function redeemPY(address receiver) external returns (uint256 amountSyOut);

    function redeemPYMulti(address[] calldata receivers, uint256[] calldata amountPYToRedeems)
        external
        returns (uint256[] memory amountSyOuts);

    function redeemDueInterestAndRewards(
        address user,
        bool redeemInterest,
        bool redeemRewards
    ) external returns (uint256 interestOut, uint256[] memory rewardsOut);

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

    function pyIndexCurrent() external returns (uint256);

    function pyIndexStored() external view returns (uint256);

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

    function SY() external view returns (address);

    function PT() external view returns (address);

    function factory() external view returns (address);

    function expiry() external view returns (uint256);

    function isExpired() external view returns (bool);

    function doCacheIndexSameBlock() external view returns (bool);
}

File 30 of 33 : IPYieldTokenV2.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./IRewardManager.sol";
import "./IPInterestManagerYTV2.sol";

interface IPYieldTokenV2 is IERC20Metadata, IRewardManager, IPInterestManagerYTV2 {
    event Mint(
        address indexed caller,
        address indexed receiverPT,
        address indexed receiverYT,
        uint256 amountSyToMint,
        uint256 amountPYOut
    );

    event Burn(
        address indexed caller,
        address indexed receiver,
        uint256 amountPYToRedeem,
        uint256 amountSyOut
    );

    event RedeemRewards(address indexed user, uint256[] amountRewardsOut);

    event RedeemInterest(address indexed user, uint256 interestOut);

    event WithdrawFeeToTreasury(uint256[] amountRewardsOut, uint256 syOut);

    event CollectInterestFee(uint256 amountInterestFee);

    event CollectRewardFee(address indexed rewardToken, uint256 amountRewardFee);

    function mintPY(address receiverPT, address receiverYT) external returns (uint256 amountPYOut);

    function redeemPY(address receiver) external returns (uint256 amountSyOut);

    function redeemPYMulti(address[] calldata receivers, uint256[] calldata amountPYToRedeems)
        external
        returns (uint256[] memory amountSyOuts);

    function redeemDueInterestAndRewards(
        address user,
        bool redeemInterest,
        bool redeemRewards
    ) external returns (uint256 interestOut, uint256[] memory rewardsOut);

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

    function pyIndexCurrent() external returns (uint256);

    function pyIndexStored() external view returns (uint256);

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

    function SY() external view returns (address);

    function PT() external view returns (address);

    function factory() external view returns (address);

    function expiry() external view returns (uint256);

    function isExpired() external view returns (bool);

    function doCacheIndexSameBlock() external view returns (bool);
}

File 31 of 33 : 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 32 of 33 : 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
        );
}

File 33 of 33 : IWETH.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/IERC20.sol";

interface IWETH is IERC20 {
    event Deposit(address indexed dst, uint256 wad);
    event Withdrawal(address indexed src, uint256 wad);

    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_SY","type":"address"},{"internalType":"address","name":"_PT","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"__decimals","type":"uint8"},{"internalType":"uint256","name":"_expiry","type":"uint256"},{"internalType":"bool","name":"_doCacheIndexSameBlock","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayEmpty","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"YCExpired","type":"error"},{"inputs":[],"name":"YCNoFloatingSy","type":"error"},{"inputs":[],"name":"YCNotExpired","type":"error"},{"inputs":[],"name":"YCNothingToRedeem","type":"error"},{"inputs":[],"name":"YCPostExpiryDataNotSet","type":"error"},{"inputs":[{"internalType":"uint256","name":"actualSy","type":"uint256"},{"internalType":"uint256","name":"requiredSy","type":"uint256"}],"name":"YieldContractInsufficientSy","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":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountPYToRedeem","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountSyOut","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountInterestFee","type":"uint256"}],"name":"CollectInterestFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountRewardFee","type":"uint256"}],"name":"CollectRewardFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiverPT","type":"address"},{"indexed":true,"internalType":"address","name":"receiverYT","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSyToMint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountPYOut","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"interestOut","type":"uint256"}],"name":"RedeemInterest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"amountRewardsOut","type":"uint256[]"}],"name":"RedeemRewards","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":"uint256[]","name":"amountRewardsOut","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"syOut","type":"uint256"}],"name":"WithdrawFeeToTreasury","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SY","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"doCacheIndexSameBlock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"expiry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPostExpiryData","outputs":[{"internalType":"uint256","name":"firstPYIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalInterestIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDistributingInterestAndRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isExpired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastInterestBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiverPT","type":"address"},{"internalType":"address","name":"receiverYT","type":"address"}],"name":"mintPY","outputs":[{"internalType":"uint256","name":"amountPYOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"receiverPTs","type":"address[]"},{"internalType":"address[]","name":"receiverYTs","type":"address[]"},{"internalType":"uint256[]","name":"amountSyToMints","type":"uint256[]"}],"name":"mintPYMulti","outputs":[{"internalType":"uint256[]","name":"amountPYOuts","type":"uint256[]"}],"stateMutability":"nonpayable","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":[{"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":[],"name":"postExpiry","outputs":[{"internalType":"uint256","name":"firstPYIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pyIndexCurrent","outputs":[{"internalType":"uint256","name":"currentIndex","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pyIndexLastUpdatedBlock","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pyIndexStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"redeemInterest","type":"bool"},{"internalType":"bool","name":"redeemRewards","type":"bool"}],"name":"redeemDueInterestAndRewards","outputs":[{"internalType":"uint256","name":"interestOut","type":"uint256"},{"internalType":"uint256[]","name":"rewardsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemInterestAndRewardsPostExpiryForTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"redeemPY","outputs":[{"internalType":"uint256","name":"amountSyOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"amountPYToRedeems","type":"uint256[]"}],"name":"redeemPYMulti","outputs":[{"internalType":"uint256[]","name":"amountSyOuts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardIndexesCurrent","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","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":"setPostExpiryData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"syReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"","type":"address"}],"name":"userInterest","outputs":[{"internalType":"uint128","name":"index","type":"uint128"},{"internalType":"uint128","name":"accrued","type":"uint128"},{"internalType":"uint256","name":"pyIndex","type":"uint256"}],"stateMutability":"view","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"}]

610200604081815234620005f957620056178038038091620000228286620005fe565b8439820160e083820312620005f9576200003c8362000622565b926200004b6020820162000622565b818401519093906001600160401b038111620005f957836200006f91840162000637565b606083015190936001600160401b038211620005f9576200009291840162000637565b9360808301519560ff87168703620005f95760c060a0850151940151948515158603620005f9578351978885016001600160401b0381118a821017620004c757855260018952603160f81b60208a015281516001600160401b038111620004c757600354600181811c91168015620005ee575b6020821014620005d857601f811162000572575b50806020601f8211600114620004e957600091620004dd575b508160011b916000199060031b1c1916176003555b87516001600160401b038111620004c7576004988954600181811c91168015620004bc575b6020821014620004a7579081601f8493116200044f575b50602090601f8311600114620003e457600092620003d8575b50508160011b916000199060031b1c19161788555b608052600160f81b60018060f81b0360025416176002556020815191012096602081519101209661010097818952610120948186524660c05280519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f948585528284015260608301524660808301523060a083015260a0825260c0820199828b1060018060401b038c1117620003c3575089905251902060a0523060e0526101409081526101609182526101809283526101c09485526101a0933385526101e0968752614f689889620006af8a3960805189611dfc015260a05189614a18015260c05189614ae4015260e051896149e901525188614a6701525187614a8d01525186614a440152518581816102a60152818161069301528181610f520152818161103d01528181611155015281816117e80152818161183c01528181613475015281816139db01528181613aeb01528181613daf01528181613ee6015261400e01525184818161073d01528181613015015281816133920152818161396401526139af015251838181610c89015281816135bc01528181613c5f015261403f015251828181610475015281816105ad01528181610b7201528181610d7001528181610ed2015281816110f00152818161153801528181611b5001528181611e5701528181613039015281816134310152818161393a01526142b6015251818181611cea0152613a7f0152f35b604190634e487b7160e01b6000525260246000fd5b0151905038806200019c565b60008c8152602081209350601f198516905b8181106200043657509084600195949392106200041c575b505050811b018855620001b1565b015160001960f88460031b161c191690553880806200040e565b92936020600181928786015181550195019301620003f6565b9091508a6000526020600020601f840160051c810191602085106200049c575b90601f859493920160051c01905b8181106200048c575062000183565b600081558493506001016200047d565b90915081906200046f565b60228b634e487b7160e01b6000525260246000fd5b90607f16906200016c565b634e487b7160e01b600052604160045260246000fd5b90508301513862000132565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9250601f198416905b81811062000559575090836001949392106200053f575b5050811b0160035562000147565b85015160001960f88460031b161c19169055388062000531565b9192602060018192868a0151815501940192016200051a565b60036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c810160208410620005d0575b601f830160051c82018110620005c357505062000119565b60008155600101620005ab565b5080620005ab565b634e487b7160e01b600052602260045260246000fd5b90607f169062000105565b600080fd5b601f909101601f19168101906001600160401b03821190821017620004c757604052565b51906001600160a01b0382168203620005f957565b919080601f84011215620005f9578251906001600160401b038211620004c7576040519160209162000673601f8301601f1916840185620005fe565b818452828287010111620005f95760005b8181106200069a57508260009394955001015290565b85810183015184820184015282016200068456fe608060408181526004908136101561001657600080fd5b600092833560e01c90816306fdde03146122a857508063095ea7b3146122595780630a2b83a71461221c5780630b49fcef146121af57806318160ddd146121515780631d52edc41461208a5780631d6e45a11461204c57806323b872dd14611e7c5780632f13b60c14611e20578063313ce56714611dc45780633644e51514611d895780633d8df49214611d4c5780634ba6dcd714611d0f578063516399df14611cb45780635333581914611a6a5780635cbadbe4146119ca57806360e0a9e11461197b57806370a082311461190e5780637d24da4d146114825780637ecebe001461142057806395d89b41146112cb578063a9059cbb146111f7578063a9f8d181146111ba578063acc5da4c14611061578063afd27bf514610ff2578063b0d8898114610e07578063bcb7ea5d14610cad578063c45a015514610c3e578063c4f59f9b14610bb0578063cdbb036114610ac4578063d2a3584e14610a84578063d505accf146107ea578063d68076c314610761578063d94073d4146106f2578063db74aa151461050c578063dd62ed3e14610498578063e184c9be1461043f578063e767b9e514610402578063ea64a820146103725763f8b2f991146101dc57600080fd5b3461036e57827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e5760025461021d60028260f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8092161760025583825180947ff8b2f991000000000000000000000000000000000000000000000000000000008252818373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af19283156103645784610318959461031c575b50507f0100000000000000000000000000000000000000000000000000000000000000906002541617600255519182916020835260208301906124d4565b0390f35b7f01000000000000000000000000000000000000000000000000000000000000009294509061035c913d8091833e61035481836125b8565b810190612f6a565b9290386102da565b82513d86823e3d90fd5b8280fd5b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57806103189273ffffffffffffffffffffffffffffffffffffffff6103c5612458565b168152600860209081529190205491516fffffffffffffffffffffffffffffffff8316815260809290921c908201529081906040820190565b5080fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906009549051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57806020926104d4612458565b6104dc612480565b73ffffffffffffffffffffffffffffffffffffffff91821683526001865283832091168252845220549051908152f35b5091346106ef57827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef5750610545612458565b9161054e612480565b6002549261056260028560f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80951617600255427f000000000000000000000000000000000000000000000000000000000000000011156106c8575061068c6106877f0100000000000000000000000000000000000000000000000000000000000000928451966106078861256d565b600188526020978836818301378651916106208361256d565b600183528936818501378751936106368561256d565b600185528a36818701376106486139d3565b61065186612660565b5261065b84612660565b73ffffffffffffffffffffffffffffffffffffffff809216905261067e83612660565b91169052612fe4565b612660565b51926106b77f0000000000000000000000000000000000000000000000000000000000000000614e89565b600c55600254161760025551908152f35b82517f5b15a6da000000000000000000000000000000000000000000000000000000008152fd5b80fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe578060609273ffffffffffffffffffffffffffffffffffffffff6107b3612458565b168152600b602052209060018254920154908051926fffffffffffffffffffffffffffffffff8116845260801c6020840152820152f35b509190346103fe5760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57610824612458565b61082c612480565b90604435926064356084359060ff82168203610a8057804211610a235773ffffffffffffffffffffffffffffffffffffffff908185169283895260056020528989208054906001820190558a519260208401917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98352868d860152858a1660608601528a608086015260a085015260c084015260c0835260e083019267ffffffffffffffff93818110858211176109f7578c52519020906108eb6149d2565b928b519260208401947f1901000000000000000000000000000000000000000000000000000000000000865260228501526042840152604283526080830190838210908211176109cb57916109599391610951938d5260c4359260a4359251902061491d565b9190916146f8565b160361096e575061096b939450614583565b80f35b60649060208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b60248b6041897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60248c60418a7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60648360208a51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152fd5b8680fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600d5460801c9051908152f35b83346106ef57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef577f0100000000000000000000000000000000000000000000000000000000000000600254610b2760028260f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80921617600255427f00000000000000000000000000000000000000000000000000000000000000001115610ba3575b600254161760025580f35b610bab613a3b565b610b98565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57610be8613ea2565b815192839260208080860192818752855180945286019401925b828110610c1157505050500390f35b835173ffffffffffffffffffffffffffffffffffffffff1685528695509381019392810192600101610c02565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b8382346103fe57602091827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef5750610ce9612458565b907f010000000000000000000000000000000000000000000000000000000000000061068c61068760025494610d2560028760f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80971617600255427f00000000000000000000000000000000000000000000000000000000000000001115610dfa575b8451610da18161256d565b60018152873681830137855191610db78361256d565b60018352883681850137610dc9613937565b610dd284612660565b5273ffffffffffffffffffffffffffffffffffffffff610df183612660565b9116905261336e565b610e02613a3b565b610d96565b503461036e57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e5767ffffffffffffffff8235818111610fee57610e5590369085016124a3565b9190946024359182116106ef5750610e7090369085016124a3565b94909160025494610e8760028760f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80971617600255427f00000000000000000000000000000000000000000000000000000000000000001115610fe1575b868203610fba578115610f93575094610f467f010000000000000000000000000000000000000000000000000000000000000093610f3e610f4c946103189936916126fe565b9236916126b0565b9061336e565b92610f767f0000000000000000000000000000000000000000000000000000000000000000614e89565b600c556002541617600255519182916020835260208301906124d4565b84517ff1364a74000000000000000000000000000000000000000000000000000000008152fd5b84517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b610fe9613a3b565b610ef8565b8480fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50903461036e57827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e57600254916110a560028460f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80941617600255427f00000000000000000000000000000000000000000000000000000000000000001180156111ad575b61118757837f010000000000000000000000000000000000000000000000000000000000000084611146613c0c565b5050611150613fbe565b6111797f0000000000000000000000000000000000000000000000000000000000000000614e89565b600c55600254161760025580f35b517fcd81a636000000000000000000000000000000000000000000000000000000008152fd5b6111b5613a3b565b611117565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906007549051908152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020907f0100000000000000000000000000000000000000000000000000000000000000611253612458565b6112bc6002549161126a60028460f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff809416176002556024359033614282565b60025416176002555160018152f35b508290346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57805191809380549160019083821c92828516948515611416575b60209586861081146113ea578589529081156113a85750600114611350575b6103188787611346828c03836125b8565b51918291826123f2565b81529295507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b82841061139557505050826103189461134692820101948680611335565b8054868501880152928601928101611377565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168887015250505050151560051b8301019250611346826103188680611335565b6024846022857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b93607f1693611316565b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe578060209273ffffffffffffffffffffffffffffffffffffffff611472612458565b1681526005845220549051908152f35b503461036e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e576114ba612458565b90602480359182159283158103610a80576044358015948515820361190a57600254956114ed60028860f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80981617600255427f000000000000000000000000000000000000000000000000000000000000000011156118fd575b816118f5575b506118cd57611572866127c5565b156118ae5794611580613ea2565b9261158b8451612611565b97809273ffffffffffffffffffffffffffffffffffffffff96878916945b875181101561172257886115bd828a61269c565b51168452600660208181528886208887528152888620548e92608091821c6115e5868661269c565b528c8c6115f2878761269c565b5161160c575b50505050505061160790612769565b6115a9565b866116169161269c565b5116885282528987208988528252611649848b8920946fffffffffffffffffffffffffffffffff9586815416905561269c565b519183831161171e576008908d611660878f61269c565b5116895252828a88209216908254901c039182116116f3578d8c6116df858e6116d78f98611607996116d2829a6116e69a906fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b61269c565b51169361269c565b5191614b9b565b90508b3880808c8c6115f8565b86866011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8780fd5b50989392505092979450879593507f78d61a0c27b13f43911095f9f356f14daa3cd8b125eea1aa22421245e90e813d6117688688519182916020835260208301906124d4565b0390a25b1561188057938161180c61031895966117a57f010000000000000000000000000000000000000000000000000000000000000095612d34565b73ffffffffffffffffffffffffffffffffffffffff831692838252600b6020528882205460801c988992206fffffffffffffffffffffffffffffffff81541690557f0000000000000000000000000000000000000000000000000000000000000000614b9b565b7f83a945bd12c713615b59a6e48a3467c05d1a7442350600d6f7fce6af9f7190e96020878951908152a25b6118607f0000000000000000000000000000000000000000000000000000000000000000614e89565b600c556002541617600255835193849384528060208501528301906124d4565b61031893507f0100000000000000000000000000000000000000000000000000000000000000915093611837565b92945094859391506118c76118c1613ea2565b51612611565b9261176c565b8683517f68146f1d000000000000000000000000000000000000000000000000000000008152fd5b905038611564565b611905613a3b565b61155e565b8880fd5b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe5760209061197461194d612458565b73ffffffffffffffffffffffffffffffffffffffff16600052600060205260406000205490565b9051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906fffffffffffffffffffffffffffffffff600d54169051908152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe578061031892611a07612458565b611a0f612480565b73ffffffffffffffffffffffffffffffffffffffff91821683526006602090815284842091909216835281529190205491516fffffffffffffffffffffffffffffffff8316815260809290921c908201529081906040820190565b503461036e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e5767ffffffffffffffff9282358481116103fe57611aba90369085016124a3565b90916024358681116103fe57611ad390369087016124a3565b9690916044359182116106ef5750611aee90369087016124a3565b93909260025496611b0560028960f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80991617600255427f00000000000000000000000000000000000000000000000000000000000000001115611c8d578115611c6657818914801590611c5c575b611c3557611b9d611b983688886126b0565b614b0a565b611ba56139d3565b8111611bf8575050610f4c93610f3e6103189994611bea7f01000000000000000000000000000000000000000000000000000000000000009895611bf29536916126fe565b9536916126fe565b91612fe4565b9087604492611c056139d3565b9151927fa2cb08190000000000000000000000000000000000000000000000000000000084528301526024820152fd5b86517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b5081861415611b86565b86517ff1364a74000000000000000000000000000000000000000000000000000000008152fd5b86517f5b15a6da000000000000000000000000000000000000000000000000000000008152fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090517f000000000000000000000000000000000000000000000000000000000000000015158152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600c549051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600a549051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906119746149d2565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905160ff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe5760209051427f000000000000000000000000000000000000000000000000000000000000000011158152f35b509190346103fe5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57611eb6612458565b611ebe612480565b90604435928560025495611ed860028860f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8098161760025573ffffffffffffffffffffffffffffffffffffffff8416815260016020528181203382526020522054907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611fa2575b6020877f0100000000000000000000000000000000000000000000000000000000000000886112bc898989614282565b848210611fef57509260209594926112bc92611fe2837f010000000000000000000000000000000000000000000000000000000000000097033383614583565b9250929495819450611f72565b60649060208851917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600e54159051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600254906120d160028360f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff809316176002557f0100000000000000000000000000000000000000000000000000000000000000612142613a7d565b92600254161760025551908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600254169051908152f35b5082346106ef57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef5750600e549081156121f4576020925051908152f35b9050517fd2509633000000000000000000000000000000000000000000000000000000008152fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600e549051908152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906122a1612297612458565b6024359033614583565b5160018152f35b929050346123ee57837ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126123ee57600354600181811c91869082811680156123e4575b60209586861082146123b85750848852908115612378575060011461231f575b6103188686611346828b03836125b8565b929550600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b82841061236557505050826103189461134692820101943861230e565b8054868501880152928601928101612348565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001687860152505050151560051b8301019250611346826103183861230e565b8360226024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b93607f16936122ee565b8380fd5b60208082528251818301819052939260005b858110612444575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006040809697860101520116010190565b818101830151848201604001528201612404565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361247b57565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361247b57565b9181601f8401121561247b5782359167ffffffffffffffff831161247b576020808501948460051b01011161247b57565b90815180825260208080930193019160005b8281106124f4575050505090565b8351855293810193928101926001016124e6565b1561250f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b6040810190811067ffffffffffffffff82111761258957604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761258957604052565b67ffffffffffffffff81116125895760051b60200190565b9061261b826125f9565b61262860405191826125b8565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061265682946125f9565b0190602036910137565b80511561266d5760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805182101561266d5760209160051b010190565b92916126bb826125f9565b916126c960405193846125b8565b829481845260208094019160051b810192831161247b57905b8282106126ef5750505050565b813581529083019083016126e2565b9291612709826125f9565b9161271760405193846125b8565b829481845260208094019160051b810192831161247b57905b82821061273d5750505050565b813573ffffffffffffffffffffffffffffffffffffffff8116810361247b578152908301908301612730565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146127965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6127cd6128ce565b908051156128165773ffffffffffffffffffffffffffffffffffffffff8316801515908161280b575b5061280057505050565b61280992612b22565b565b9050301415386127f6565b505050565b6128236128ce565b9181511561288a5773ffffffffffffffffffffffffffffffffffffffff908383838316801515908161287f575b5061286e575b5050508316801515908161280b575061280057505050565b61287792612b22565b388383612856565b905030141538612850565b50505050565b9190820391821161279657565b9190820180921161279657565b9190916fffffffffffffffffffffffffffffffff8080941691160191821161279657565b6128d6613ea2565b906128e18251612611565b80835115612ae75750600754430361295e575b6000805b8451811015612959578073ffffffffffffffffffffffffffffffffffffffff612924612954938861269c565b5116835260086020526fffffffffffffffffffffffffffffffff60408420541661294e828661269c565b52612769565b6128f8565b505090565b909143600755600c5490612970613fbe565b8115159360005b8251811015612adc5773ffffffffffffffffffffffffffffffffffffffff906129b8826129a4838761269c565b5116926129b1838761269c565b5116614e89565b918060005260086020918183526040906129dc826000205496608097881c90612890565b92816000528085526fffffffffffffffffffffffffffffffff9485846000205416928d8415612ad3575b612ab0575b86841161247b5760005252838260002091167fffffffffffffffffffffffffffffffff0000000000000000000000000000000082541617905582821161247b57612aab94612aa693612a66926000209316908354901c6128aa565b6fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b612769565b612977565b92612acd90612ac78d612ac2896138a8565b6138d8565b9061289d565b92612a0b565b60019450612a06565b5092915092506128f4565b919050565b15612af357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b9092919273ffffffffffffffffffffffffffffffffffffffff612b598184169384151580612d2a575b612b5490612aec565b614228565b9160005b8151811015612d215782612b71828461269c565b511690612b7e818961269c565b51826000526006906020908282526040806000208a60005283526fffffffffffffffffffffffffffffffff91828260002054168015612cd057818114612cc057670de0b6b3a7640000612bdd612bd7612bfc9385612890565b8d6138c5565b0488600052868652836000208d6000528652836000205460801c61289d565b9183821161247b5783831161247b578051948186019686881067ffffffffffffffff89111761258957612cbb99868095612aa69a86521688528483890196168652600052815281600020908d600052526000209351167fffffffffffffffffffffffffffffffff0000000000000000000000000000000084541617835551166fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b612b5d565b505050505050612cbb9150612769565b50938285949293941161247b57612cbb96600052815281600020908a6000525260002091167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055612769565b50505050509050565b5030851415612b4b565b612d3c612ee4565b9073ffffffffffffffffffffffffffffffffffffffff83168015159081612d71575b50612d6857505050565b61280992612d7c565b905030141538612d5e565b73ffffffffffffffffffffffffffffffffffffffff811693929184151580612eda575b612da890612aec565b600090858252600b6020526fffffffffffffffffffffffffffffffff60409381858520541690838214612ecf578115612e8e57670de0b6b3a764000091612e1d612e16612e239373ffffffffffffffffffffffffffffffffffffffff16600052600060205260406000205490565b9186612890565b906138c5565b048181116123ee57612e4a90888552600b602052612a66838787209216825460801c6128aa565b80821161036e5760019495968352600b60205283832091167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055200155565b505080965081116103fe57600193949583832091167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055200155565b505050505050509050565b5030851415612d9f565b6009544314612f5d57436009557effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60025416612f1d613c0c565b92909291600a54938415612f54575b81612f3a575b505082600a55565b612f4c929491612ac2612ac7926138a8565b913880612f32565b60019450612f2c565b600a5490600d5460801c90565b602090818184031261247b5780519067ffffffffffffffff821161247b57019180601f8401121561247b578251612fa0816125f9565b93612fae60405195866125b8565b818552838086019260051b82010192831161247b578301905b828210612fd5575050505090565b81518152908301908301612fc7565b929190612ff18251612611565b612ff9613a7d565b60009573ffffffffffffffffffffffffffffffffffffffff90817f00000000000000000000000000000000000000000000000000000000000000001692427f00000000000000000000000000000000000000000000000000000000000000001115985b875181101561334257670de0b6b3a76400006130828361307c848c61269c565b516138c5565b0461308d828861269c565b5283613099828961269c565b51166130a5828861269c565b519080156132e4578b6132d7575b6130bc816127c5565b6130c581612d34565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80831161247b576002908154908085168183160190808211612796577fff0000000000000000000000000000000000000000000000000000000000000091169116179055806000526020906000825260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360409586842061316982825461289d565b90558651908152a38561317c848761269c565b5116613188848a61269c565b5190883b1561247b5783517f12a31dcc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91909116600480830191909152602482019290925290600082604481838d5af180156132cc57938c93888d948d948c999861326f575b50509061325887613251818b6132498261326a9e613241827fc0025304673122449dd60b9b0093874b0e2fd6fe57af1c7c2fbfee0ccf5ead589c9b61269c565b51169b61269c565b51169961269c565b519561269c565b519082519485528401523392a4612769565b61305c565b9450945050935093945067ffffffffffffffff821161329e575082528592918a918a918a918861325887613201565b6041907f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b84513d6000823e3d90fd5b6132df613a3b565b6130b3565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152fd5b505050505093505050565b519073ffffffffffffffffffffffffffffffffffffffff8216820361247b57565b919061337981614b0a565b9273ffffffffffffffffffffffffffffffffffffffff807f00000000000000000000000000000000000000000000000000000000000000001691823b1561247b576040958651937fb64761f9000000000000000000000000000000000000000000000000000000008552600094858160049381838161341e89308a84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1801561389e57613857575b50427f00000000000000000000000000000000000000000000000000000000000000001191821592613643575b5095613464613a7d565b90856134708551612611565b9680927f0000000000000000000000000000000000000000000000000000000000000000925b875185101561358157848d818c8e8d8d84978d8f8c6134c46134b88a8961269c565b519193612ac2836138a8565b91613562575b506134d5888861269c565b528c846134e2898661269c565b51166134ee898961269c565b51906134f992614b9b565b6135029161289d565b9b61350c9161269c565b5116946135189161269c565b51916135239161269c565b518251918252602082015233917f5d624aa9c148153ab3446c1b154f660ee7701e549fe9b62dab7171b1c80e6fa291a361355c90612769565b93613496565b8192509061357561357a92600e54613911565b612890565b90386134ca565b989b97935099945097509350602091508451928380927f61d027b30000000000000000000000000000000000000000000000000000000082527f0000000000000000000000000000000000000000000000000000000000000000165afa92831561363a575084926135f8575b506128099350614b9b565b915091926020823d8211613632575b81613614602093836125b8565b810103126106ef57509061362b612809939261334d565b90386135ed565b3d9150613607565b513d86823e3d90fd5b30156137d457826137c7575b613658306127c5565b61366130612d34565b30865285602052888620548181106137445781903088528760205203898720557effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80821161247b57600254908083168183160381811161371857889392917fff00000000000000000000000000000000000000000000000000000000000000911691161760025589519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203092a33861345a565b6024896011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60848360208c51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152fd5b6137cf613a3b565b61364f565b60848260208b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152fd5b67ffffffffffffffff8196929611613872578852933861342d565b6024826041887f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b89513d88823e3d90fd5b90670de0b6b3a76400009182810292818404149015171561279657565b8181029291811591840414171561279657565b81156138e2570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b670de0b6b3a76400009182810292818404149015171561279657613934916138d8565b90565b427f000000000000000000000000000000000000000000000000000000000000000011156139aa576139887f0000000000000000000000000000000000000000000000000000000000000000614e89565b3060005260006020526040600020548082106000146139a5575090565b905090565b6139347f0000000000000000000000000000000000000000000000000000000000000000614e89565b613a086139ff7f0000000000000000000000000000000000000000000000000000000000000000614e89565b600c5490612890565b908115613a1157565b60046040517f22826619000000000000000000000000000000000000000000000000000000008152fd5b600e5461280957613a4a612ee4565b5050613a546128ce565b5050613a5e613a7d565b6fffffffffffffffffffffffffffffffff9081811161247b5716600e55565b7f000000000000000000000000000000000000000000000000000000000000000080613bc7575b613bbe576040517f3ba0b9a900000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa908115613bb257600091613b81575b50600d5460801c80821115613b795750905b6fffffffffffffffffffffffffffffffff9182811161247b577fffffffffffffffffffffffffffffffff000000000000000000000000000000008382169343169160801b1617600d55565b905090613b2e565b906020823d8211613baa575b81613b9a602093836125b8565b810103126106ef57505138613b1c565b3d9150613b8d565b6040513d6000823e3d90fd5b600d5460801c90565b506fffffffffffffffffffffffffffffffff600d54164314613aa4565b9081602091031261247b57516fffffffffffffffffffffffffffffffff8116810361247b5790565b600f5460009182613c1b613a7d565b9280151580613e98575b613c32575b505081600f55565b6040517f61d027b300000000000000000000000000000000000000000000000000000000815294506020917f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168387600481845afa968715613e45578297613e61575b5083600e5415600014613e5057600491604051928380927fdd86fea10000000000000000000000000000000000000000000000000000000082525afa908115613e4557906fffffffffffffffffffffffffffffffff918391613e18575b5016915b613d4686613d407effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60025416612e1d8584612890565b926138c5565b90670de0b6b3a76400009283820291808304851490151715613deb57507e4e8d79e4b41c5fad7561dc7c07786ee4e52292da7a3f5dc7ab90e32cc30423949392613da0613d99613dda94613da8946138d8565b94856138c5565b048093612890565b96613dd5837f00000000000000000000000000000000000000000000000000000000000000009283614b9b565b614e89565b600c55604051908152a13880613c2a565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b613e389150853d8711613e3e575b613e3081836125b8565b810190613be4565b38613d07565b503d613e26565b6040513d84823e3d90fd5b5050670de0b6b3a764000091613d0b565b9096508381813d8311613e91575b613e7981836125b8565b810103126103fe57613e8a9061334d565b9538613caa565b503d613e6f565b5083811415613c25565b6040517fc4f59f9b0000000000000000000000000000000000000000000000000000000081526000808260048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa918215613fb1578192613f1a57505090565b9091503d8083833e613f2c81836125b8565b810160209182818303126123ee5780519067ffffffffffffffff8211610fee570181601f820112156123ee57805190613f64826125f9565b94613f7260405196876125b8565b828652848087019360051b8301019384116106ef57508301905b828210613f9a575050505090565b838091613fa68461334d565b815201910190613f8c565b50604051903d90823e3d90fd5b60409081517fef5cfb8c00000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff90828160248183867f0000000000000000000000000000000000000000000000000000000000000000165af1801561421e57614204575b50807f000000000000000000000000000000000000000000000000000000000000000016938051917f61d027b30000000000000000000000000000000000000000000000000000000083526020958684600481845afa9384156141b25785946141cd575b5086600e54156000146141bc576004918451928380927ff5de2d1f0000000000000000000000000000000000000000000000000000000082525afa9081156141b257906fffffffffffffffffffffffffffffffff918691614195575b5016905b614107613ea2565b855b8151811015612ecf5780877f880a48d40a6133941abdcfabd5c5f9a791b1e6c8afd23138c5a36e3d950392228b670de0b6b3a7640000614179896141748a6141546141909a8c61269c565b5116968d61416189614e89565b9189815260088852205460801c90612890565b6138c5565b04614185818c86614b9b565b8951908152a2612769565b614109565b6141ac9150883d8a11613e3e57613e3081836125b8565b386140fb565b83513d87823e3d90fd5b5050670de0b6b3a7640000906140ff565b9093508681813d83116141fd575b6141e581836125b8565b81010312610fee576141f69061334d565b923861409f565b503d6141db565b614217903d8085833e61035481836125b8565b503861403b565b85513d85823e3d90fd5b73ffffffffffffffffffffffffffffffffffffffff16600090808252600b60205260016040832001548015612959578261426f604092613934956020528383205490613911565b928152600b602052205460801c9061289d565b9173ffffffffffffffffffffffffffffffffffffffff918284169283156144ff57811693841561447b5784841461441d57427f00000000000000000000000000000000000000000000000000000000000000001115614410575b6142e6828261281b565b6142ee612ee4565b9182823088036143ff575b5050503086036143ee575b50505060008281528060205260408120549180831061436a57604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef95876020965282865203828220558681522061435f82825461289d565b9055604051908152a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b6143f792612d7c565b388080614304565b61440892612d7c565b3882826142f9565b614418613a3b565b6142dc565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f45524332303a207472616e7366657220746f2073656c660000000000000000006044820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff80911691821561467557169182156145f15760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b60058110156148ee57806147095750565b6001810361476f5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b600281036147d55760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b600381036148615760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b60041461486a57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116149c65760ff16601b811415806149bb575b6149af579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15613fb157815173ffffffffffffffffffffffffffffffffffffffff8116156149a9579190565b50600190565b50505050600090600490565b50601c811415614955565b50505050600090600390565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016301480614ae1575b15614a3a577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f000000000000000000000000000000000000000000000000000000000000000082527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176125895760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614614a11565b600090815b8151831015614b3757614b2f600191614b28858561269c565b519061289d565b920191614b0f565b91505090565b3d15614b96573d9067ffffffffffffffff82116125895760405191614b8a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601846125b8565b82523d6000602084013e565b606090565b82156128165773ffffffffffffffffffffffffffffffffffffffff1680614c345750600080809381935af1614bce614b3d565b5015614bd657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6574682073656e64206661696c656400000000000000000000000000000000006044820152fd5b9060405190614cc282614c96602096878301947fa9059cbb000000000000000000000000000000000000000000000000000000008652602484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018452836125b8565b60405191614ccf8361256d565b8483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485840152833b15614dd55790614d1e9291600094859283809351925af1614d18614b3d565b90614e33565b805180614d2b5750505050565b818491810103126103fe57820151908115918215036106ef5750614d515780808061288a565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b606485604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b90919015614e3f575090565b815115614e4f5750805190602001fd5b614e85906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016123f2565b0390fd5b60009073ffffffffffffffffffffffffffffffffffffffff1680614ead5750504790565b6020602491604051928380927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa918215614f26578092614ef657505090565b9091506020823d8211614f1e575b81614f11602093836125b8565b810103126106ef57505190565b3d9150614f04565b604051903d90823e3d90fdfea26469706673582212206df613283749d426d78b7f4e63ff73aa6205343218f0a54fd3b646a264c585be64736f6c63430008110033000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311000000000000000000000000a9dc6ac72f219d805d620437878af4e3845f9ebd00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000006604b30000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000010595420474c502032384d41523230323400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001059542d474c502d32384d41523230323400000000000000000000000000000000

Deployed Bytecode

0x608060408181526004908136101561001657600080fd5b600092833560e01c90816306fdde03146122a857508063095ea7b3146122595780630a2b83a71461221c5780630b49fcef146121af57806318160ddd146121515780631d52edc41461208a5780631d6e45a11461204c57806323b872dd14611e7c5780632f13b60c14611e20578063313ce56714611dc45780633644e51514611d895780633d8df49214611d4c5780634ba6dcd714611d0f578063516399df14611cb45780635333581914611a6a5780635cbadbe4146119ca57806360e0a9e11461197b57806370a082311461190e5780637d24da4d146114825780637ecebe001461142057806395d89b41146112cb578063a9059cbb146111f7578063a9f8d181146111ba578063acc5da4c14611061578063afd27bf514610ff2578063b0d8898114610e07578063bcb7ea5d14610cad578063c45a015514610c3e578063c4f59f9b14610bb0578063cdbb036114610ac4578063d2a3584e14610a84578063d505accf146107ea578063d68076c314610761578063d94073d4146106f2578063db74aa151461050c578063dd62ed3e14610498578063e184c9be1461043f578063e767b9e514610402578063ea64a820146103725763f8b2f991146101dc57600080fd5b3461036e57827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e5760025461021d60028260f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8092161760025583825180947ff8b2f991000000000000000000000000000000000000000000000000000000008252818373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311165af19283156103645784610318959461031c575b50507f0100000000000000000000000000000000000000000000000000000000000000906002541617600255519182916020835260208301906124d4565b0390f35b7f01000000000000000000000000000000000000000000000000000000000000009294509061035c913d8091833e61035481836125b8565b810190612f6a565b9290386102da565b82513d86823e3d90fd5b8280fd5b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57806103189273ffffffffffffffffffffffffffffffffffffffff6103c5612458565b168152600860209081529190205491516fffffffffffffffffffffffffffffffff8316815260809290921c908201529081906040820190565b5080fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906009549051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090517f000000000000000000000000000000000000000000000000000000006604b3008152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57806020926104d4612458565b6104dc612480565b73ffffffffffffffffffffffffffffffffffffffff91821683526001865283832091168252845220549051908152f35b5091346106ef57827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef5750610545612458565b9161054e612480565b6002549261056260028560f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80951617600255427f000000000000000000000000000000000000000000000000000000006604b30011156106c8575061068c6106877f0100000000000000000000000000000000000000000000000000000000000000928451966106078861256d565b600188526020978836818301378651916106208361256d565b600183528936818501378751936106368561256d565b600185528a36818701376106486139d3565b61065186612660565b5261065b84612660565b73ffffffffffffffffffffffffffffffffffffffff809216905261067e83612660565b91169052612fe4565b612660565b51926106b77f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311614e89565b600c55600254161760025551908152f35b82517f5b15a6da000000000000000000000000000000000000000000000000000000008152fd5b80fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000a9dc6ac72f219d805d620437878af4e3845f9ebd168152f35b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe578060609273ffffffffffffffffffffffffffffffffffffffff6107b3612458565b168152600b602052209060018254920154908051926fffffffffffffffffffffffffffffffff8116845260801c6020840152820152f35b509190346103fe5760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57610824612458565b61082c612480565b90604435926064356084359060ff82168203610a8057804211610a235773ffffffffffffffffffffffffffffffffffffffff908185169283895260056020528989208054906001820190558a519260208401917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98352868d860152858a1660608601528a608086015260a085015260c084015260c0835260e083019267ffffffffffffffff93818110858211176109f7578c52519020906108eb6149d2565b928b519260208401947f1901000000000000000000000000000000000000000000000000000000000000865260228501526042840152604283526080830190838210908211176109cb57916109599391610951938d5260c4359260a4359251902061491d565b9190916146f8565b160361096e575061096b939450614583565b80f35b60649060208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b60248b6041897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60248c60418a7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60648360208a51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152fd5b8680fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600d5460801c9051908152f35b83346106ef57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef577f0100000000000000000000000000000000000000000000000000000000000000600254610b2760028260f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80921617600255427f000000000000000000000000000000000000000000000000000000006604b3001115610ba3575b600254161760025580f35b610bab613a3b565b610b98565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57610be8613ea2565b815192839260208080860192818752855180945286019401925b828110610c1157505050500390f35b835173ffffffffffffffffffffffffffffffffffffffff1685528695509381019392810192600101610c02565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000028de02ac3c3f5ef427e55c321f73fdc7f192e8e4168152f35b8382346103fe57602091827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef5750610ce9612458565b907f010000000000000000000000000000000000000000000000000000000000000061068c61068760025494610d2560028760f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80971617600255427f000000000000000000000000000000000000000000000000000000006604b3001115610dfa575b8451610da18161256d565b60018152873681830137855191610db78361256d565b60018352883681850137610dc9613937565b610dd284612660565b5273ffffffffffffffffffffffffffffffffffffffff610df183612660565b9116905261336e565b610e02613a3b565b610d96565b503461036e57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e5767ffffffffffffffff8235818111610fee57610e5590369085016124a3565b9190946024359182116106ef5750610e7090369085016124a3565b94909160025494610e8760028760f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80971617600255427f000000000000000000000000000000000000000000000000000000006604b3001115610fe1575b868203610fba578115610f93575094610f467f010000000000000000000000000000000000000000000000000000000000000093610f3e610f4c946103189936916126fe565b9236916126b0565b9061336e565b92610f767f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311614e89565b600c556002541617600255519182916020835260208301906124d4565b84517ff1364a74000000000000000000000000000000000000000000000000000000008152fd5b84517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b610fe9613a3b565b610ef8565b8480fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311168152f35b50903461036e57827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e57600254916110a560028460f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80941617600255427f000000000000000000000000000000000000000000000000000000006604b3001180156111ad575b61118757837f010000000000000000000000000000000000000000000000000000000000000084611146613c0c565b5050611150613fbe565b6111797f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311614e89565b600c55600254161760025580f35b517fcd81a636000000000000000000000000000000000000000000000000000000008152fd5b6111b5613a3b565b611117565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906007549051908152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020907f0100000000000000000000000000000000000000000000000000000000000000611253612458565b6112bc6002549161126a60028460f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff809416176002556024359033614282565b60025416176002555160018152f35b508290346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57805191809380549160019083821c92828516948515611416575b60209586861081146113ea578589529081156113a85750600114611350575b6103188787611346828c03836125b8565b51918291826123f2565b81529295507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b82841061139557505050826103189461134692820101948680611335565b8054868501880152928601928101611377565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168887015250505050151560051b8301019250611346826103188680611335565b6024846022857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b93607f1693611316565b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe578060209273ffffffffffffffffffffffffffffffffffffffff611472612458565b1681526005845220549051908152f35b503461036e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e576114ba612458565b90602480359182159283158103610a80576044358015948515820361190a57600254956114ed60028860f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80981617600255427f000000000000000000000000000000000000000000000000000000006604b30011156118fd575b816118f5575b506118cd57611572866127c5565b156118ae5794611580613ea2565b9261158b8451612611565b97809273ffffffffffffffffffffffffffffffffffffffff96878916945b875181101561172257886115bd828a61269c565b51168452600660208181528886208887528152888620548e92608091821c6115e5868661269c565b528c8c6115f2878761269c565b5161160c575b50505050505061160790612769565b6115a9565b866116169161269c565b5116885282528987208988528252611649848b8920946fffffffffffffffffffffffffffffffff9586815416905561269c565b519183831161171e576008908d611660878f61269c565b5116895252828a88209216908254901c039182116116f3578d8c6116df858e6116d78f98611607996116d2829a6116e69a906fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b61269c565b51169361269c565b5191614b9b565b90508b3880808c8c6115f8565b86866011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8780fd5b50989392505092979450879593507f78d61a0c27b13f43911095f9f356f14daa3cd8b125eea1aa22421245e90e813d6117688688519182916020835260208301906124d4565b0390a25b1561188057938161180c61031895966117a57f010000000000000000000000000000000000000000000000000000000000000095612d34565b73ffffffffffffffffffffffffffffffffffffffff831692838252600b6020528882205460801c988992206fffffffffffffffffffffffffffffffff81541690557f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311614b9b565b7f83a945bd12c713615b59a6e48a3467c05d1a7442350600d6f7fce6af9f7190e96020878951908152a25b6118607f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311614e89565b600c556002541617600255835193849384528060208501528301906124d4565b61031893507f0100000000000000000000000000000000000000000000000000000000000000915093611837565b92945094859391506118c76118c1613ea2565b51612611565b9261176c565b8683517f68146f1d000000000000000000000000000000000000000000000000000000008152fd5b905038611564565b611905613a3b565b61155e565b8880fd5b8382346103fe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe5760209061197461194d612458565b73ffffffffffffffffffffffffffffffffffffffff16600052600060205260406000205490565b9051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906fffffffffffffffffffffffffffffffff600d54169051908152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe578061031892611a07612458565b611a0f612480565b73ffffffffffffffffffffffffffffffffffffffff91821683526006602090815284842091909216835281529190205491516fffffffffffffffffffffffffffffffff8316815260809290921c908201529081906040820190565b503461036e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261036e5767ffffffffffffffff9282358481116103fe57611aba90369085016124a3565b90916024358681116103fe57611ad390369087016124a3565b9690916044359182116106ef5750611aee90369087016124a3565b93909260025496611b0560028960f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80991617600255427f000000000000000000000000000000000000000000000000000000006604b3001115611c8d578115611c6657818914801590611c5c575b611c3557611b9d611b983688886126b0565b614b0a565b611ba56139d3565b8111611bf8575050610f4c93610f3e6103189994611bea7f01000000000000000000000000000000000000000000000000000000000000009895611bf29536916126fe565b9536916126fe565b91612fe4565b9087604492611c056139d3565b9151927fa2cb08190000000000000000000000000000000000000000000000000000000084528301526024820152fd5b86517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b5081861415611b86565b86517ff1364a74000000000000000000000000000000000000000000000000000000008152fd5b86517f5b15a6da000000000000000000000000000000000000000000000000000000008152fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090517f000000000000000000000000000000000000000000000000000000000000000115158152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600c549051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600a549051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906119746149d2565b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020905160ff7f0000000000000000000000000000000000000000000000000000000000000012168152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe5760209051427f000000000000000000000000000000000000000000000000000000006604b30011158152f35b509190346103fe5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57611eb6612458565b611ebe612480565b90604435928560025495611ed860028860f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8098161760025573ffffffffffffffffffffffffffffffffffffffff8416815260016020528181203382526020522054907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611fa2575b6020877f0100000000000000000000000000000000000000000000000000000000000000886112bc898989614282565b848210611fef57509260209594926112bc92611fe2837f010000000000000000000000000000000000000000000000000000000000000097033383614583565b9250929495819450611f72565b60649060208851917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600e54159051908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600254906120d160028360f81c1415612508565b7f02000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff809316176002557f0100000000000000000000000000000000000000000000000000000000000000612142613a7d565b92600254161760025551908152f35b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600254169051908152f35b5082346106ef57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ef5750600e549081156121f4576020925051908152f35b9050517fd2509633000000000000000000000000000000000000000000000000000000008152fd5b8382346103fe57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe57602090600e549051908152f35b8382346103fe57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103fe576020906122a1612297612458565b6024359033614583565b5160018152f35b929050346123ee57837ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126123ee57600354600181811c91869082811680156123e4575b60209586861082146123b85750848852908115612378575060011461231f575b6103188686611346828b03836125b8565b929550600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b82841061236557505050826103189461134692820101943861230e565b8054868501880152928601928101612348565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001687860152505050151560051b8301019250611346826103183861230e565b8360226024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b93607f16936122ee565b8380fd5b60208082528251818301819052939260005b858110612444575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006040809697860101520116010190565b818101830151848201604001528201612404565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361247b57565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361247b57565b9181601f8401121561247b5782359167ffffffffffffffff831161247b576020808501948460051b01011161247b57565b90815180825260208080930193019160005b8281106124f4575050505090565b8351855293810193928101926001016124e6565b1561250f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b6040810190811067ffffffffffffffff82111761258957604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761258957604052565b67ffffffffffffffff81116125895760051b60200190565b9061261b826125f9565b61262860405191826125b8565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061265682946125f9565b0190602036910137565b80511561266d5760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805182101561266d5760209160051b010190565b92916126bb826125f9565b916126c960405193846125b8565b829481845260208094019160051b810192831161247b57905b8282106126ef5750505050565b813581529083019083016126e2565b9291612709826125f9565b9161271760405193846125b8565b829481845260208094019160051b810192831161247b57905b82821061273d5750505050565b813573ffffffffffffffffffffffffffffffffffffffff8116810361247b578152908301908301612730565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146127965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6127cd6128ce565b908051156128165773ffffffffffffffffffffffffffffffffffffffff8316801515908161280b575b5061280057505050565b61280992612b22565b565b9050301415386127f6565b505050565b6128236128ce565b9181511561288a5773ffffffffffffffffffffffffffffffffffffffff908383838316801515908161287f575b5061286e575b5050508316801515908161280b575061280057505050565b61287792612b22565b388383612856565b905030141538612850565b50505050565b9190820391821161279657565b9190820180921161279657565b9190916fffffffffffffffffffffffffffffffff8080941691160191821161279657565b6128d6613ea2565b906128e18251612611565b80835115612ae75750600754430361295e575b6000805b8451811015612959578073ffffffffffffffffffffffffffffffffffffffff612924612954938861269c565b5116835260086020526fffffffffffffffffffffffffffffffff60408420541661294e828661269c565b52612769565b6128f8565b505090565b909143600755600c5490612970613fbe565b8115159360005b8251811015612adc5773ffffffffffffffffffffffffffffffffffffffff906129b8826129a4838761269c565b5116926129b1838761269c565b5116614e89565b918060005260086020918183526040906129dc826000205496608097881c90612890565b92816000528085526fffffffffffffffffffffffffffffffff9485846000205416928d8415612ad3575b612ab0575b86841161247b5760005252838260002091167fffffffffffffffffffffffffffffffff0000000000000000000000000000000082541617905582821161247b57612aab94612aa693612a66926000209316908354901c6128aa565b6fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b612769565b612977565b92612acd90612ac78d612ac2896138a8565b6138d8565b9061289d565b92612a0b565b60019450612a06565b5092915092506128f4565b919050565b15612af357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b9092919273ffffffffffffffffffffffffffffffffffffffff612b598184169384151580612d2a575b612b5490612aec565b614228565b9160005b8151811015612d215782612b71828461269c565b511690612b7e818961269c565b51826000526006906020908282526040806000208a60005283526fffffffffffffffffffffffffffffffff91828260002054168015612cd057818114612cc057670de0b6b3a7640000612bdd612bd7612bfc9385612890565b8d6138c5565b0488600052868652836000208d6000528652836000205460801c61289d565b9183821161247b5783831161247b578051948186019686881067ffffffffffffffff89111761258957612cbb99868095612aa69a86521688528483890196168652600052815281600020908d600052526000209351167fffffffffffffffffffffffffffffffff0000000000000000000000000000000084541617835551166fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b612b5d565b505050505050612cbb9150612769565b50938285949293941161247b57612cbb96600052815281600020908a6000525260002091167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055612769565b50505050509050565b5030851415612b4b565b612d3c612ee4565b9073ffffffffffffffffffffffffffffffffffffffff83168015159081612d71575b50612d6857505050565b61280992612d7c565b905030141538612d5e565b73ffffffffffffffffffffffffffffffffffffffff811693929184151580612eda575b612da890612aec565b600090858252600b6020526fffffffffffffffffffffffffffffffff60409381858520541690838214612ecf578115612e8e57670de0b6b3a764000091612e1d612e16612e239373ffffffffffffffffffffffffffffffffffffffff16600052600060205260406000205490565b9186612890565b906138c5565b048181116123ee57612e4a90888552600b602052612a66838787209216825460801c6128aa565b80821161036e5760019495968352600b60205283832091167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055200155565b505080965081116103fe57600193949583832091167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055200155565b505050505050509050565b5030851415612d9f565b6009544314612f5d57436009557effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60025416612f1d613c0c565b92909291600a54938415612f54575b81612f3a575b505082600a55565b612f4c929491612ac2612ac7926138a8565b913880612f32565b60019450612f2c565b600a5490600d5460801c90565b602090818184031261247b5780519067ffffffffffffffff821161247b57019180601f8401121561247b578251612fa0816125f9565b93612fae60405195866125b8565b818552838086019260051b82010192831161247b578301905b828210612fd5575050505090565b81518152908301908301612fc7565b929190612ff18251612611565b612ff9613a7d565b60009573ffffffffffffffffffffffffffffffffffffffff90817f000000000000000000000000a9dc6ac72f219d805d620437878af4e3845f9ebd1692427f000000000000000000000000000000000000000000000000000000006604b3001115985b875181101561334257670de0b6b3a76400006130828361307c848c61269c565b516138c5565b0461308d828861269c565b5283613099828961269c565b51166130a5828861269c565b519080156132e4578b6132d7575b6130bc816127c5565b6130c581612d34565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80831161247b576002908154908085168183160190808211612796577fff0000000000000000000000000000000000000000000000000000000000000091169116179055806000526020906000825260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360409586842061316982825461289d565b90558651908152a38561317c848761269c565b5116613188848a61269c565b5190883b1561247b5783517f12a31dcc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91909116600480830191909152602482019290925290600082604481838d5af180156132cc57938c93888d948d948c999861326f575b50509061325887613251818b6132498261326a9e613241827fc0025304673122449dd60b9b0093874b0e2fd6fe57af1c7c2fbfee0ccf5ead589c9b61269c565b51169b61269c565b51169961269c565b519561269c565b519082519485528401523392a4612769565b61305c565b9450945050935093945067ffffffffffffffff821161329e575082528592918a918a918a918861325887613201565b6041907f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b84513d6000823e3d90fd5b6132df613a3b565b6130b3565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152fd5b505050505093505050565b519073ffffffffffffffffffffffffffffffffffffffff8216820361247b57565b919061337981614b0a565b9273ffffffffffffffffffffffffffffffffffffffff807f000000000000000000000000a9dc6ac72f219d805d620437878af4e3845f9ebd1691823b1561247b576040958651937fb64761f9000000000000000000000000000000000000000000000000000000008552600094858160049381838161341e89308a84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1801561389e57613857575b50427f000000000000000000000000000000000000000000000000000000006604b3001191821592613643575b5095613464613a7d565b90856134708551612611565b9680927f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311925b875185101561358157848d818c8e8d8d84978d8f8c6134c46134b88a8961269c565b519193612ac2836138a8565b91613562575b506134d5888861269c565b528c846134e2898661269c565b51166134ee898961269c565b51906134f992614b9b565b6135029161289d565b9b61350c9161269c565b5116946135189161269c565b51916135239161269c565b518251918252602082015233917f5d624aa9c148153ab3446c1b154f660ee7701e549fe9b62dab7171b1c80e6fa291a361355c90612769565b93613496565b8192509061357561357a92600e54613911565b612890565b90386134ca565b989b97935099945097509350602091508451928380927f61d027b30000000000000000000000000000000000000000000000000000000082527f00000000000000000000000028de02ac3c3f5ef427e55c321f73fdc7f192e8e4165afa92831561363a575084926135f8575b506128099350614b9b565b915091926020823d8211613632575b81613614602093836125b8565b810103126106ef57509061362b612809939261334d565b90386135ed565b3d9150613607565b513d86823e3d90fd5b30156137d457826137c7575b613658306127c5565b61366130612d34565b30865285602052888620548181106137445781903088528760205203898720557effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80821161247b57600254908083168183160381811161371857889392917fff00000000000000000000000000000000000000000000000000000000000000911691161760025589519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203092a33861345a565b6024896011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60848360208c51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152fd5b6137cf613a3b565b61364f565b60848260208b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152fd5b67ffffffffffffffff8196929611613872578852933861342d565b6024826041887f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b89513d88823e3d90fd5b90670de0b6b3a76400009182810292818404149015171561279657565b8181029291811591840414171561279657565b81156138e2570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b670de0b6b3a76400009182810292818404149015171561279657613934916138d8565b90565b427f000000000000000000000000000000000000000000000000000000006604b30011156139aa576139887f000000000000000000000000a9dc6ac72f219d805d620437878af4e3845f9ebd614e89565b3060005260006020526040600020548082106000146139a5575090565b905090565b6139347f000000000000000000000000a9dc6ac72f219d805d620437878af4e3845f9ebd614e89565b613a086139ff7f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311614e89565b600c5490612890565b908115613a1157565b60046040517f22826619000000000000000000000000000000000000000000000000000000008152fd5b600e5461280957613a4a612ee4565b5050613a546128ce565b5050613a5e613a7d565b6fffffffffffffffffffffffffffffffff9081811161247b5716600e55565b7f000000000000000000000000000000000000000000000000000000000000000180613bc7575b613bbe576040517f3ba0b9a900000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311165afa908115613bb257600091613b81575b50600d5460801c80821115613b795750905b6fffffffffffffffffffffffffffffffff9182811161247b577fffffffffffffffffffffffffffffffff000000000000000000000000000000008382169343169160801b1617600d55565b905090613b2e565b906020823d8211613baa575b81613b9a602093836125b8565b810103126106ef57505138613b1c565b3d9150613b8d565b6040513d6000823e3d90fd5b600d5460801c90565b506fffffffffffffffffffffffffffffffff600d54164314613aa4565b9081602091031261247b57516fffffffffffffffffffffffffffffffff8116810361247b5790565b600f5460009182613c1b613a7d565b9280151580613e98575b613c32575b505081600f55565b6040517f61d027b300000000000000000000000000000000000000000000000000000000815294506020917f00000000000000000000000028de02ac3c3f5ef427e55c321f73fdc7f192e8e473ffffffffffffffffffffffffffffffffffffffff168387600481845afa968715613e45578297613e61575b5083600e5415600014613e5057600491604051928380927fdd86fea10000000000000000000000000000000000000000000000000000000082525afa908115613e4557906fffffffffffffffffffffffffffffffff918391613e18575b5016915b613d4686613d407effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60025416612e1d8584612890565b926138c5565b90670de0b6b3a76400009283820291808304851490151715613deb57507e4e8d79e4b41c5fad7561dc7c07786ee4e52292da7a3f5dc7ab90e32cc30423949392613da0613d99613dda94613da8946138d8565b94856138c5565b048093612890565b96613dd5837f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e43119283614b9b565b614e89565b600c55604051908152a13880613c2a565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b613e389150853d8711613e3e575b613e3081836125b8565b810190613be4565b38613d07565b503d613e26565b6040513d84823e3d90fd5b5050670de0b6b3a764000091613d0b565b9096508381813d8311613e91575b613e7981836125b8565b810103126103fe57613e8a9061334d565b9538613caa565b503d613e6f565b5083811415613c25565b6040517fc4f59f9b0000000000000000000000000000000000000000000000000000000081526000808260048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311165afa918215613fb1578192613f1a57505090565b9091503d8083833e613f2c81836125b8565b810160209182818303126123ee5780519067ffffffffffffffff8211610fee570181601f820112156123ee57805190613f64826125f9565b94613f7260405196876125b8565b828652848087019360051b8301019384116106ef57508301905b828210613f9a575050505090565b838091613fa68461334d565b815201910190613f8c565b50604051903d90823e3d90fd5b60409081517fef5cfb8c00000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff90828160248183867f000000000000000000000000ed0dc8c074255c277bc704d6b096167d7a6e4311165af1801561421e57614204575b50807f00000000000000000000000028de02ac3c3f5ef427e55c321f73fdc7f192e8e416938051917f61d027b30000000000000000000000000000000000000000000000000000000083526020958684600481845afa9384156141b25785946141cd575b5086600e54156000146141bc576004918451928380927ff5de2d1f0000000000000000000000000000000000000000000000000000000082525afa9081156141b257906fffffffffffffffffffffffffffffffff918691614195575b5016905b614107613ea2565b855b8151811015612ecf5780877f880a48d40a6133941abdcfabd5c5f9a791b1e6c8afd23138c5a36e3d950392228b670de0b6b3a7640000614179896141748a6141546141909a8c61269c565b5116968d61416189614e89565b9189815260088852205460801c90612890565b6138c5565b04614185818c86614b9b565b8951908152a2612769565b614109565b6141ac9150883d8a11613e3e57613e3081836125b8565b386140fb565b83513d87823e3d90fd5b5050670de0b6b3a7640000906140ff565b9093508681813d83116141fd575b6141e581836125b8565b81010312610fee576141f69061334d565b923861409f565b503d6141db565b614217903d8085833e61035481836125b8565b503861403b565b85513d85823e3d90fd5b73ffffffffffffffffffffffffffffffffffffffff16600090808252600b60205260016040832001548015612959578261426f604092613934956020528383205490613911565b928152600b602052205460801c9061289d565b9173ffffffffffffffffffffffffffffffffffffffff918284169283156144ff57811693841561447b5784841461441d57427f000000000000000000000000000000000000000000000000000000006604b3001115614410575b6142e6828261281b565b6142ee612ee4565b9182823088036143ff575b5050503086036143ee575b50505060008281528060205260408120549180831061436a57604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef95876020965282865203828220558681522061435f82825461289d565b9055604051908152a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b6143f792612d7c565b388080614304565b61440892612d7c565b3882826142f9565b614418613a3b565b6142dc565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f45524332303a207472616e7366657220746f2073656c660000000000000000006044820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff80911691821561467557169182156145f15760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b60058110156148ee57806147095750565b6001810361476f5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b600281036147d55760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b600381036148615760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b60041461486a57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116149c65760ff16601b811415806149bb575b6149af579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15613fb157815173ffffffffffffffffffffffffffffffffffffffff8116156149a9579190565b50600190565b50505050600090600490565b50601c811415614955565b50505050600090600390565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000023231848ec8acd3a108c6a61049fbc25a697b59416301480614ae1575b15614a3a577f68848cc38b561c3a1e7c243a289e4cbe782ee3031474850af5ead1b6e5e8fd3c90565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f7fc49357b889d343c208ca7340fdcbb0739f7e12c876b60dba55dc28d7128e3060408201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176125895760405251902090565b507f000000000000000000000000000000000000000000000000000000000000a4b14614614a11565b600090815b8151831015614b3757614b2f600191614b28858561269c565b519061289d565b920191614b0f565b91505090565b3d15614b96573d9067ffffffffffffffff82116125895760405191614b8a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601846125b8565b82523d6000602084013e565b606090565b82156128165773ffffffffffffffffffffffffffffffffffffffff1680614c345750600080809381935af1614bce614b3d565b5015614bd657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6574682073656e64206661696c656400000000000000000000000000000000006044820152fd5b9060405190614cc282614c96602096878301947fa9059cbb000000000000000000000000000000000000000000000000000000008652602484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018452836125b8565b60405191614ccf8361256d565b8483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485840152833b15614dd55790614d1e9291600094859283809351925af1614d18614b3d565b90614e33565b805180614d2b5750505050565b818491810103126103fe57820151908115918215036106ef5750614d515780808061288a565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b606485604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b90919015614e3f575090565b815115614e4f5750805190602001fd5b614e85906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016123f2565b0390fd5b60009073ffffffffffffffffffffffffffffffffffffffff1680614ead5750504790565b6020602491604051928380927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa918215614f26578092614ef657505090565b9091506020823d8211614f1e575b81614f11602093836125b8565b810103126106ef57505190565b3d9150614f04565b604051903d90823e3d90fdfea26469706673582212206df613283749d426d78b7f4e63ff73aa6205343218f0a54fd3b646a264c585be64736f6c63430008110033

[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.