{"file_path":"src/TokenizedStrategy.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: AGPL-3.0\npragma solidity >=0.8.18;\n\n/**$$$$$$$$$$$$$$$$$$$$$$$$$$$&Mr/|1+~>>iiiiiiiiiii>~+{|tuMW$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$B#j]->iiiiiiiiiiiiiiiiiiiiiiiiiiii>-?f*B$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$@zj}~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii~}fv@$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$@z(+iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii+)zB$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$Mf~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii~t#@$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$@u[iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii?n@$$$$$$$$$$$$$\n$$$$$$$$$$$@z]iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii?u@$$$$$$$$$$$\n$$$$$$$$$$v]iiiiiiiiiiiiiiii,.';iiiiiiiiiiiiiiiiiiiiiiiiii;'.\"iiiiiiiiiiiiiiii?u$$$$$$$$$$\n$$$$$$$$%)>iiiiiiiiiiiiiii,.    ';iiiiiiiiiiiiiiiiiiiiii;'    .\"iiiiiiiiiiiiiiii1%$$$$$$$$\n$$$$$$$c~iiiiiiiiiiiiiii,.        ';iiiiiiiiiiiiiiiiii;'        .\"iiiiiiiiiiiiiii~u$$$$$$$\n$$$$$B/>iiiiiiiiiiiiii!'            `IiiiiiiiiiiiiiiI`            .Iiiiiiiiiiiiiii>|%$$$$$\n$$$$@)iiiiiiiiiiiiiiiii;'             `Iiiiiiiiiiil`             ';iiiiiiiiiiiiiiiii}@$$$$\n$$$B|iiiiiiiiiiiiiiiiiiii;'             `Iiiiiiil`             ';iiiiiiiiiiiiiiiiiiii1B$$$\n$$@)iiiiiiiiiiiiiiiiiiiiiii:'             `;iiI`             ':iiiiiiiiiiiiiiiiiiiiiii{B$$\n$$|iiiiiiiiiiiiiiiiiiiiiiiiii;'             ``             ':iiiiiiiiiiiiiiiiiiiiiiiiii1$$\n$v>iiiiiiiiiiiiiiiiiiiiiiiiiiii:'                        ':iiiiiiiiiiiiiiiiiiiiiiiiiiii>x$\n&?iiiiiiiiiiiiiiiiiiiiiiiiiiiiiii:'                    .,iiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-W\nziiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii:'                .,iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiv\n-iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii:'            .,iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-\n<iiiiiiiiiiiiiiiiiiii!.':iiiiiiiiiiiiii,          \"iiiiiiiiiiiiii;'.Iiiiiiiiiiiiiiiiiiiii<\niiiiiiiiiiiiiiiiiiiii'   ';iiiiiiiiiiiii          Iiiiiiiiiiiii;'   .iiiiiiiiiiiiiiiiiiiii\niiiiiiiiiiiiiiiiiiii,      ';iiiiiiiiiii          IiiiiiiiiiiI`      `iiiiiiiiiiiiiiiiiiii\niiiiiiiiiiiiiiiiiiii.        `Iiiiiiiiii          Iiiiiiiii!`         !iiiiiiiiiiiiiiiiiii\niiiiiiiiiiiiiiiiiii;          :iiiiiiiii          Iiiiiiiii!          ,iiiiiiiiiiiiiiiiiii\niiiiiiiiiiiiiiiiiii,          iiiiiiiiii          Iiiiiiiiii.         ^iiiiiiiiiiiiiiiiiii\n<iiiiiiiiiiiiiiiiii,          iiiiiiiiii          Iiiiiiiiii'         ^iiiiiiiiiiiiiiiiii<\n-iiiiiiiiiiiiiiiiii;          Iiiiiiiiii          Iiiiiiiiii.         \"iiiiiiiiiiiiiiiiii-\nziiiiiiiiiiiiiiiiiii.         'iiiiiiiii''''''''''liiiiiiii^          liiiiiiiiiiiiiiiiiiv\n&?iiiiiiiiiiiiiiiiii^          ^iiiiiiiiiiiiiiiiiiiiiiiiii,          `iiiiiiiiiiiiiiiiii_W\n$u>iiiiiiiiiiiiiiiiii.          `!iiiiiiiiiiiiiiiiiiiiiii^          .liiiiiiiiiiiiiiiiiir$\n$$(iiiiiiiiiiiiiiiiii;.          .\"iiiiiiiiiiiiiiiiiiii,.           :iiiiiiiiiiiiiiiiii}$$\n$$@{iiiiiiiiiiiiiiiiii;.           .`:iiiiiiiiiiiiii;^.            :iiiiiiiiiiiiiiiiii}B$$\n$$$B)iiiiiiiiiiiiiiiiii!'              '`\",::::,\"`'.             .Iiiiiiiiiiiiiiiiiii{%$$$\n$$$$@1iiiiiiiiiiiiiiiiiii,.                                     ^iiiiiiiiiiiiiiiiiii[@$$$$\n$$$$$B|>iiiiiiiiiiiiiiiiii!^.                                 `liiiiiiiiiiiiiiiiii>)%$$$$$\n$$$$$$$c~iiiiiiiiiiiiiiiiiiii\"'                            .\"!iiiiiiiiiiiiiiiiiii~n$$$$$$$\n$$$$$$$$B)iiiiiiiiiiiiiiiiiiiii!,`.                    .'\"liiiiiiiiiiiiiiiiiiiii1%$$$$$$$$\n$$$$$$$$$@u]iiiiiiiiiiiiiiiiiiiiiiil,^`'..      ..''^,liiiiiiiiiiiiiiiiiiiiiii-x@$$$$$$$$$\n$$$$$$$$$$$@v?iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-x$$$$$$$$$$$$\n$$$$$$$$$$$$$@n?iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-rB$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$/~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii<\\*@$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$Bc1~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii~{v%$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$Bvf]<iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii<]tuB$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$%zt-+>iiiiiiiiiiiiiiiiiiiiiiiiiiiii+_tc%$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$W#u/|{+~>iiiiiiiiiiii><+{|/n#W$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/\n\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport {IFactory} from \"./interfaces/IFactory.sol\";\nimport {IBaseStrategy} from \"./interfaces/IBaseStrategy.sol\";\n\n/**\n * @title Yearn Tokenized Strategy\n * @author yearn.finance\n * @notice\n *  This TokenizedStrategy can be used by anyone wishing to easily build\n *  and deploy their own custom ERC4626 compliant single strategy Vault.\n *\n *  The TokenizedStrategy contract is meant to be used as the proxy\n *  implementation contract that will handle all logic, storage and\n *  management for a custom strategy that inherits the `BaseStrategy`.\n *  Any function calls to the strategy that are not defined within that\n *  strategy will be forwarded through a delegateCall to this contract.\n\n *  A strategist only needs to override a few simple functions that are\n *  focused entirely on the strategy specific needs to easily and cheaply\n *  deploy their own permissionless 4626 compliant vault.\n */\ncontract TokenizedStrategy {\n    using Math for uint256;\n    using SafeERC20 for ERC20;\n\n    /*//////////////////////////////////////////////////////////////\n                                 EVENTS\n    //////////////////////////////////////////////////////////////*/\n    /**\n     * @notice Emitted when a strategy is shutdown.\n     */\n    event StrategyShutdown();\n\n    /**\n     * @notice Emitted on the initialization of any new `strategy` that uses `asset`\n     * with this specific `apiVersion`.\n     */\n    event NewTokenizedStrategy(\n        address indexed strategy,\n        address indexed asset,\n        string apiVersion\n    );\n\n    /**\n     * @notice Emitted when the strategy reports `profit` or `loss` and\n     * `performanceFees` and `protocolFees` are paid out.\n     */\n    event Reported(\n        uint256 profit,\n        uint256 loss,\n        uint256 protocolFees,\n        uint256 performanceFees\n    );\n\n    /**\n     * @notice Emitted when the 'performanceFeeRecipient' address is\n     * updated to 'newPerformanceFeeRecipient'.\n     */\n    event UpdatePerformanceFeeRecipient(\n        address indexed newPerformanceFeeRecipient\n    );\n\n    /**\n     * @notice Emitted when the 'keeper' address is updated to 'newKeeper'.\n     */\n    event UpdateKeeper(address indexed newKeeper);\n\n    /**\n     * @notice Emitted when the 'performanceFee' is updated to 'newPerformanceFee'.\n     */\n    event UpdatePerformanceFee(uint16 newPerformanceFee);\n\n    /**\n     * @notice Emitted when the 'management' address is updated to 'newManagement'.\n     */\n    event UpdateManagement(address indexed newManagement);\n\n    /**\n     * @notice Emitted when the 'emergencyAdmin' address is updated to 'newEmergencyAdmin'.\n     */\n    event UpdateEmergencyAdmin(address indexed newEmergencyAdmin);\n\n    /**\n     * @notice Emitted when the 'profitMaxUnlockTime' is updated to 'newProfitMaxUnlockTime'.\n     */\n    event UpdateProfitMaxUnlockTime(uint256 newProfitMaxUnlockTime);\n\n    /**\n     * @notice Emitted when the 'pendingManagement' address is updated to 'newPendingManagement'.\n     */\n    event UpdatePendingManagement(address indexed newPendingManagement);\n\n    /**\n     * @notice Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(\n        address indexed owner,\n        address indexed spender,\n        uint256 value\n    );\n\n    /**\n     * @notice Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @notice Emitted when the `caller` has exchanged `assets` for `shares`,\n     * and transferred those `shares` to `owner`.\n     */\n    event Deposit(\n        address indexed caller,\n        address indexed owner,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /**\n     * @notice Emitted when the `caller` has exchanged `owner`s `shares` for `assets`,\n     * and transferred those `assets` to `receiver`.\n     */\n    event Withdraw(\n        address indexed caller,\n        address indexed receiver,\n        address indexed owner,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /*//////////////////////////////////////////////////////////////\n                        STORAGE STRUCT\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @dev The struct that will hold all the storage data for each strategy\n     * that uses this implementation.\n     *\n     * This replaces all state variables for a traditional contract. This\n     * full struct will be initialized on the creation of the strategy\n     * and continually updated and read from for the life of the contract.\n     *\n     * We combine all the variables into one struct to limit the amount of\n     * times the custom storage slots need to be loaded during complex functions.\n     *\n     * Loading the corresponding storage slot for the struct does not\n     * load any of the contents of the struct into memory. So the size\n     * will not increase memory related gas usage.\n     */\n    // prettier-ignore\n    struct StrategyData {\n        // The ERC20 compliant underlying asset that will be\n        // used by the Strategy\n        ERC20 asset;\n\n\n        // These are the corresponding ERC20 variables needed for the\n        // strategies token that is issued and burned on each deposit or withdraw.\n        uint8 decimals; // The amount of decimals that `asset` and strategy use.\n        string name; // The name of the token for the strategy.\n        uint256 totalSupply; // The total amount of shares currently issued.\n        mapping(address => uint256) nonces; // Mapping of nonces used for permit functions.\n        mapping(address => uint256) balances; // Mapping to track current balances for each account that holds shares.\n        mapping(address => mapping(address => uint256)) allowances; // Mapping to track the allowances for the strategies shares.\n\n\n        // We manually track `totalAssets` to prevent PPS manipulation through airdrops.\n        uint256 totalAssets;\n\n\n        // Variables for profit reporting and locking.\n        // We use uint96 for timestamps to fit in the same slot as an address. That overflows in 2.5e+21 years.\n        // I know Yearn moves slowly but surely V4 will be out by then.\n        // If the timestamps ever overflow tell the cyborgs still using this code I'm sorry for being cheap.\n        uint256 profitUnlockingRate; // The rate at which locked profit is unlocking.\n        uint96 fullProfitUnlockDate; // The timestamp at which all locked shares will unlock.\n        address keeper; // Address given permission to call {report} and {tend}.\n        uint32 profitMaxUnlockTime; // The amount of seconds that the reported profit unlocks over.\n        uint16 performanceFee; // The percent in basis points of profit that is charged as a fee.\n        address performanceFeeRecipient; // The address to pay the `performanceFee` to.\n        uint96 lastReport; // The last time a {report} was called.\n\n\n        // Access management variables.\n        address management; // Main address that can set all configurable variables.\n        address pendingManagement; // Address that is pending to take over `management`.\n        address emergencyAdmin; // Address to act in emergencies as well as `management`.\n\n        // Strategy Status\n        uint8 entered; // To prevent reentrancy. Use uint8 for gas savings.\n        bool shutdown; // Bool that can be used to stop deposits into the strategy.\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            MODIFIERS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @dev Require that the call is coming from the strategies management.\n     */\n    modifier onlyManagement() {\n        requireManagement(msg.sender);\n        _;\n    }\n\n    /**\n     * @dev Require that the call is coming from either the strategies\n     * management or the keeper.\n     */\n    modifier onlyKeepers() {\n        requireKeeperOrManagement(msg.sender);\n        _;\n    }\n\n    /**\n     * @dev Require that the call is coming from either the strategies\n     * management or the emergencyAdmin.\n     */\n    modifier onlyEmergencyAuthorized() {\n        requireEmergencyAuthorized(msg.sender);\n        _;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Placed over all state changing functions for increased safety.\n     */\n    modifier nonReentrant() {\n        StrategyData storage S = _strategyStorage();\n        // On the first call to nonReentrant, `entered` will be false (2)\n        require(S.entered != ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        S.entered = ENTERED;\n\n        _;\n\n        // Reset to false (1) once call has finished.\n        S.entered = NOT_ENTERED;\n    }\n\n    /**\n     * @notice Require a caller is `management`.\n     * @dev Is left public so that it can be used by the Strategy.\n     *\n     * When the Strategy calls this the msg.sender would be the\n     * address of the strategy so we need to specify the sender.\n     *\n     * @param _sender The original msg.sender.\n     */\n    function requireManagement(address _sender) public view {\n        require(_sender == _strategyStorage().management, \"!management\");\n    }\n\n    /**\n     * @notice Require a caller is the `keeper` or `management`.\n     * @dev Is left public so that it can be used by the Strategy.\n     *\n     * When the Strategy calls this the msg.sender would be the\n     * address of the strategy so we need to specify the sender.\n     *\n     * @param _sender The original msg.sender.\n     */\n    function requireKeeperOrManagement(address _sender) public view {\n        StrategyData storage S = _strategyStorage();\n        require(_sender == S.keeper || _sender == S.management, \"!keeper\");\n    }\n\n    /**\n     * @notice Require a caller is the `management` or `emergencyAdmin`.\n     * @dev Is left public so that it can be used by the Strategy.\n     *\n     * When the Strategy calls this the msg.sender would be the\n     * address of the strategy so we need to specify the sender.\n     *\n     * @param _sender The original msg.sender.\n     */\n    function requireEmergencyAuthorized(address _sender) public view {\n        StrategyData storage S = _strategyStorage();\n        require(\n            _sender == S.emergencyAdmin || _sender == S.management,\n            \"!emergency authorized\"\n        );\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               CONSTANTS\n    //////////////////////////////////////////////////////////////*/\n\n    /// @notice API version this TokenizedStrategy implements.\n    string internal constant API_VERSION = \"3.0.4\";\n\n    /// @notice Value to set the `entered` flag to during a call.\n    uint8 internal constant ENTERED = 2;\n    /// @notice Value to set the `entered` flag to at the end of the call.\n    uint8 internal constant NOT_ENTERED = 1;\n\n    /// @notice Maximum in Basis Points the Performance Fee can be set to.\n    uint16 public constant MAX_FEE = 5_000; // 50%\n\n    /// @notice Used for fee calculations.\n    uint256 internal constant MAX_BPS = 10_000;\n    /// @notice Used for profit unlocking rate calculations.\n    uint256 internal constant MAX_BPS_EXTENDED = 1_000_000_000_000;\n\n    /// @notice Seconds per year for max profit unlocking time.\n    uint256 internal constant SECONDS_PER_YEAR = 31_556_952; // 365.2425 days\n\n    /**\n     * @dev Custom storage slot that will be used to store the\n     * `StrategyData` struct that holds each strategies\n     * specific storage variables.\n     *\n     * Any storage updates done by the TokenizedStrategy actually update\n     * the storage of the calling contract. This variable points\n     * to the specific location that will be used to store the\n     * struct that holds all that data.\n     *\n     * We use a custom string in order to get a random\n     * storage slot that will allow for strategists to use any\n     * amount of storage in their strategy without worrying\n     * about collisions.\n     */\n    bytes32 internal constant BASE_STRATEGY_STORAGE =\n        bytes32(uint256(keccak256(\"yearn.base.strategy.storage\")) - 1);\n\n    /*//////////////////////////////////////////////////////////////\n                               IMMUTABLE\n    //////////////////////////////////////////////////////////////*/\n\n    /// @notice Address of the previously deployed Vault factory that the\n    // protocol fee config is retrieved from.\n    address public immutable FACTORY;\n\n    /*//////////////////////////////////////////////////////////////\n                            STORAGE GETTER\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @dev will return the actual storage slot where the strategy\n     * specific `StrategyData` struct is stored for both read\n     * and write operations.\n     *\n     * This loads just the slot location, not the full struct\n     * so it can be used in a gas efficient manner.\n     */\n    function _strategyStorage() internal pure returns (StrategyData storage S) {\n        // Since STORAGE_SLOT is a constant, we have to put a variable\n        // on the stack to access it from an inline assembly block.\n        bytes32 slot = BASE_STRATEGY_STORAGE;\n        assembly {\n            S.slot := slot\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                          INITIALIZATION\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Used to initialize storage for a newly deployed strategy.\n     * @dev This should be called atomically whenever a new strategy is\n     * deployed and can only be called once for each strategy.\n     *\n     * This will set all the default storage that must be set for a\n     * strategy to function. Any changes can be made post deployment\n     * through external calls from `management`.\n     *\n     * The function will also emit an event that off chain indexers can\n     * look for to track any new deployments using this TokenizedStrategy.\n     *\n     * @param _asset Address of the underlying asset.\n     * @param _name Name the strategy will use.\n     * @param _management Address to set as the strategies `management`.\n     * @param _performanceFeeRecipient Address to receive performance fees.\n     * @param _keeper Address to set as strategies `keeper`.\n     */\n    function initialize(\n        address _asset,\n        string memory _name,\n        address _management,\n        address _performanceFeeRecipient,\n        address _keeper\n    ) external {\n        // Cache storage pointer.\n        StrategyData storage S = _strategyStorage();\n\n        // Make sure we aren't initialized.\n        require(address(S.asset) == address(0), \"initialized\");\n\n        // Set the strategy's underlying asset.\n        S.asset = ERC20(_asset);\n        // Set the Strategy Tokens name.\n        S.name = _name;\n        // Set decimals based off the `asset`.\n        S.decimals = ERC20(_asset).decimals();\n\n        // Default to a 10 day profit unlock period.\n        S.profitMaxUnlockTime = 10 days;\n        // Set address to receive performance fees.\n        // Can't be address(0) or we will be burning fees.\n        require(_performanceFeeRecipient != address(0), \"ZERO ADDRESS\");\n        // Can't mint shares to its self because of profit locking.\n        require(_performanceFeeRecipient != address(this), \"self\");\n        S.performanceFeeRecipient = _performanceFeeRecipient;\n        // Default to a 10% performance fee.\n        S.performanceFee = 1_000;\n        // Set last report to this block.\n        S.lastReport = uint96(block.timestamp);\n\n        // Set the default management address. Can't be 0.\n        require(_management != address(0), \"ZERO ADDRESS\");\n        S.management = _management;\n        // Set the keeper address\n        S.keeper = _keeper;\n\n        // Emit event to signal a new strategy has been initialized.\n        emit NewTokenizedStrategy(address(this), _asset, API_VERSION);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                      ERC4626 WRITE METHODS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Mints `shares` of strategy shares to `receiver` by\n     * depositing exactly `assets` of underlying tokens.\n     * @param assets The amount of underlying to deposit in.\n     * @param receiver The address to receive the `shares`.\n     * @return shares The actual amount of shares issued.\n     */\n    function deposit(\n        uint256 assets,\n        address receiver\n    ) external nonReentrant returns (uint256 shares) {\n        // Get the storage slot for all following calls.\n        StrategyData storage S = _strategyStorage();\n\n        // Deposit full balance if using max uint.\n        if (assets == type(uint256).max) {\n            assets = S.asset.balanceOf(msg.sender);\n        }\n\n        // Checking max deposit will also check if shutdown.\n        require(\n            assets <= _maxDeposit(S, receiver),\n            \"ERC4626: deposit more than max\"\n        );\n        // Check for rounding error.\n        require(\n            (shares = _convertToShares(S, assets, Math.Rounding.Down)) != 0,\n            \"ZERO_SHARES\"\n        );\n\n        _deposit(S, receiver, assets, shares);\n    }\n\n    /**\n     * @notice Mints exactly `shares` of strategy shares to\n     * `receiver` by depositing `assets` of underlying tokens.\n     * @param shares The amount of strategy shares mint.\n     * @param receiver The address to receive the `shares`.\n     * @return assets The actual amount of asset deposited.\n     */\n    function mint(\n        uint256 shares,\n        address receiver\n    ) external nonReentrant returns (uint256 assets) {\n        // Get the storage slot for all following calls.\n        StrategyData storage S = _strategyStorage();\n\n        // Checking max mint will also check if shutdown.\n        require(shares <= _maxMint(S, receiver), \"ERC4626: mint more than max\");\n        // Check for rounding error.\n        require(\n            (assets = _convertToAssets(S, shares, Math.Rounding.Up)) != 0,\n            \"ZERO_ASSETS\"\n        );\n\n        _deposit(S, receiver, assets, shares);\n    }\n\n    /**\n     * @notice Withdraws exactly `assets` from `owners` shares and sends\n     * the underlying tokens to `receiver`.\n     * @dev This will default to not allowing any loss to be taken.\n     * @param assets The amount of underlying to withdraw.\n     * @param receiver The address to receive `assets`.\n     * @param owner The address whose shares are burnt.\n     * @return shares The actual amount of shares burnt.\n     */\n    function withdraw(\n        uint256 assets,\n        address receiver,\n        address owner\n    ) external returns (uint256 shares) {\n        return withdraw(assets, receiver, owner, 0);\n    }\n\n    /**\n     * @notice Withdraws `assets` from `owners` shares and sends\n     * the underlying tokens to `receiver`.\n     * @dev This includes an added parameter to allow for losses.\n     * @param assets The amount of underlying to withdraw.\n     * @param receiver The address to receive `assets`.\n     * @param owner The address whose shares are burnt.\n     * @param maxLoss The amount of acceptable loss in Basis points.\n     * @return shares The actual amount of shares burnt.\n     */\n    function withdraw(\n        uint256 assets,\n        address receiver,\n        address owner,\n        uint256 maxLoss\n    ) public nonReentrant returns (uint256 shares) {\n        // Get the storage slot for all following calls.\n        StrategyData storage S = _strategyStorage();\n        require(\n            assets <= _maxWithdraw(S, owner),\n            \"ERC4626: withdraw more than max\"\n        );\n        // Check for rounding error or 0 value.\n        require(\n            (shares = _convertToShares(S, assets, Math.Rounding.Up)) != 0,\n            \"ZERO_SHARES\"\n        );\n\n        // Withdraw and track the actual amount withdrawn for loss check.\n        _withdraw(S, receiver, owner, assets, shares, maxLoss);\n    }\n\n    /**\n     * @notice Redeems exactly `shares` from `owner` and\n     * sends `assets` of underlying tokens to `receiver`.\n     * @dev This will default to allowing any loss passed to be realized.\n     * @param shares The amount of shares burnt.\n     * @param receiver The address to receive `assets`.\n     * @param owner The address whose shares are burnt.\n     * @return assets The actual amount of underlying withdrawn.\n     */\n    function redeem(\n        uint256 shares,\n        address receiver,\n        address owner\n    ) external returns (uint256) {\n        // We default to not limiting a potential loss.\n        return redeem(shares, receiver, owner, MAX_BPS);\n    }\n\n    /**\n     * @notice Redeems exactly `shares` from `owner` and\n     * sends `assets` of underlying tokens to `receiver`.\n     * @dev This includes an added parameter to allow for losses.\n     * @param shares The amount of shares burnt.\n     * @param receiver The address to receive `assets`.\n     * @param owner The address whose shares are burnt.\n     * @param maxLoss The amount of acceptable loss in Basis points.\n     * @return . The actual amount of underlying withdrawn.\n     */\n    function redeem(\n        uint256 shares,\n        address receiver,\n        address owner,\n        uint256 maxLoss\n    ) public nonReentrant returns (uint256) {\n        // Get the storage slot for all following calls.\n        StrategyData storage S = _strategyStorage();\n        require(\n            shares <= _maxRedeem(S, owner),\n            \"ERC4626: redeem more than max\"\n        );\n        uint256 assets;\n        // Check for rounding error or 0 value.\n        require(\n            (assets = _convertToAssets(S, shares, Math.Rounding.Down)) != 0,\n            \"ZERO_ASSETS\"\n        );\n\n        // We need to return the actual amount withdrawn in case of a loss.\n        return _withdraw(S, receiver, owner, assets, shares, maxLoss);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                    EXTERNAL 4626 VIEW METHODS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Get the total amount of assets this strategy holds\n     * as of the last report.\n     *\n     * We manually track `totalAssets` to avoid any PPS manipulation.\n     *\n     * @return . Total assets the strategy holds.\n     */\n    function totalAssets() external view returns (uint256) {\n        return _totalAssets(_strategyStorage());\n    }\n\n    /**\n     * @notice Get the current supply of the strategies shares.\n     *\n     * Locked shares issued to the strategy from profits are not\n     * counted towards the full supply until they are unlocked.\n     *\n     * As more shares slowly unlock the totalSupply will decrease\n     * causing the PPS of the strategy to increase.\n     *\n     * @return . Total amount of shares outstanding.\n     */\n    function totalSupply() external view returns (uint256) {\n        return _totalSupply(_strategyStorage());\n    }\n\n    /**\n     * @notice The amount of shares that the strategy would\n     *  exchange for the amount of assets provided, in an\n     * ideal scenario where all the conditions are met.\n     *\n     * @param assets The amount of underlying.\n     * @return . Expected shares that `assets` represents.\n     */\n    function convertToShares(uint256 assets) external view returns (uint256) {\n        return _convertToShares(_strategyStorage(), assets, Math.Rounding.Down);\n    }\n\n    /**\n     * @notice The amount of assets that the strategy would\n     * exchange for the amount of shares provided, in an\n     * ideal scenario where all the conditions are met.\n     *\n     * @param shares The amount of the strategies shares.\n     * @return . Expected amount of `asset` the shares represents.\n     */\n    function convertToAssets(uint256 shares) external view returns (uint256) {\n        return _convertToAssets(_strategyStorage(), shares, Math.Rounding.Down);\n    }\n\n    /**\n     * @notice Allows an on-chain or off-chain user to simulate\n     * the effects of their deposit at the current block, given\n     * current on-chain conditions.\n     * @dev This will round down.\n     *\n     * @param assets The amount of `asset` to deposits.\n     * @return . Expected shares that would be issued.\n     */\n    function previewDeposit(uint256 assets) external view returns (uint256) {\n        return _convertToShares(_strategyStorage(), assets, Math.Rounding.Down);\n    }\n\n    /**\n     * @notice Allows an on-chain or off-chain user to simulate\n     * the effects of their mint at the current block, given\n     * current on-chain conditions.\n     * @dev This is used instead of convertToAssets so that it can\n     * round up for safer mints.\n     *\n     * @param shares The amount of shares to mint.\n     * @return . The needed amount of `asset` for the mint.\n     */\n    function previewMint(uint256 shares) external view returns (uint256) {\n        return _convertToAssets(_strategyStorage(), shares, Math.Rounding.Up);\n    }\n\n    /**\n     * @notice Allows an on-chain or off-chain user to simulate\n     * the effects of their withdrawal at the current block,\n     * given current on-chain conditions.\n     * @dev This is used instead of convertToShares so that it can\n     * round up for safer withdraws.\n     *\n     * @param assets The amount of `asset` that would be withdrawn.\n     * @return . The amount of shares that would be burnt.\n     */\n    function previewWithdraw(uint256 assets) external view returns (uint256) {\n        return _convertToShares(_strategyStorage(), assets, Math.Rounding.Up);\n    }\n\n    /**\n     * @notice Allows an on-chain or off-chain user to simulate\n     * the effects of their redemption at the current block,\n     * given current on-chain conditions.\n     * @dev This will round down.\n     *\n     * @param shares The amount of shares that would be redeemed.\n     * @return . The amount of `asset` that would be returned.\n     */\n    function previewRedeem(uint256 shares) external view returns (uint256) {\n        return _convertToAssets(_strategyStorage(), shares, Math.Rounding.Down);\n    }\n\n    /**\n     * @notice Total number of underlying assets that can\n     * be deposited into the strategy, where `receiver`\n     * corresponds to the receiver of the shares of a {deposit} call.\n     *\n     * @param receiver The address receiving the shares.\n     * @return . The max that `receiver` can deposit in `asset`.\n     */\n    function maxDeposit(address receiver) external view returns (uint256) {\n        return _maxDeposit(_strategyStorage(), receiver);\n    }\n\n    /**\n     * @notice Total number of shares that can be minted to `receiver`\n     * of a {mint} call.\n     *\n     * @param receiver The address receiving the shares.\n     * @return _maxMint The max that `receiver` can mint in shares.\n     */\n    function maxMint(address receiver) external view returns (uint256) {\n        return _maxMint(_strategyStorage(), receiver);\n    }\n\n    /**\n     * @notice Total number of underlying assets that can be\n     * withdrawn from the strategy by `owner`, where `owner`\n     * corresponds to the msg.sender of a {redeem} call.\n     *\n     * @param owner The owner of the shares.\n     * @return _maxWithdraw Max amount of `asset` that can be withdrawn.\n     */\n    function maxWithdraw(address owner) external view returns (uint256) {\n        return _maxWithdraw(_strategyStorage(), owner);\n    }\n\n    /**\n     * @notice Variable `maxLoss` is ignored.\n     * @dev Accepts a `maxLoss` variable in order to match the multi\n     * strategy vaults ABI.\n     */\n    function maxWithdraw(\n        address owner,\n        uint256 /*maxLoss*/\n    ) external view returns (uint256) {\n        return _maxWithdraw(_strategyStorage(), owner);\n    }\n\n    /**\n     * @notice Total number of strategy shares that can be\n     * redeemed from the strategy by `owner`, where `owner`\n     * corresponds to the msg.sender of a {redeem} call.\n     *\n     * @param owner The owner of the shares.\n     * @return _maxRedeem Max amount of shares that can be redeemed.\n     */\n    function maxRedeem(address owner) external view returns (uint256) {\n        return _maxRedeem(_strategyStorage(), owner);\n    }\n\n    /**\n     * @notice Variable `maxLoss` is ignored.\n     * @dev Accepts a `maxLoss` variable in order to match the multi\n     * strategy vaults ABI.\n     */\n    function maxRedeem(\n        address owner,\n        uint256 /*maxLoss*/\n    ) external view returns (uint256) {\n        return _maxRedeem(_strategyStorage(), owner);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                    INTERNAL 4626 VIEW METHODS\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Internal implementation of {totalAssets}.\n    function _totalAssets(\n        StrategyData storage S\n    ) internal view returns (uint256) {\n        return S.totalAssets;\n    }\n\n    /// @dev Internal implementation of {totalSupply}.\n    function _totalSupply(\n        StrategyData storage S\n    ) internal view returns (uint256) {\n        return S.totalSupply - _unlockedShares(S);\n    }\n\n    /// @dev Internal implementation of {convertToShares}.\n    function _convertToShares(\n        StrategyData storage S,\n        uint256 assets,\n        Math.Rounding _rounding\n    ) internal view returns (uint256) {\n        // Saves an extra SLOAD if values are non-zero.\n        uint256 totalSupply_ = _totalSupply(S);\n        // If supply is 0, PPS = 1.\n        if (totalSupply_ == 0) return assets;\n\n        uint256 totalAssets_ = _totalAssets(S);\n        // If assets are 0 but supply is not PPS = 0.\n        if (totalAssets_ == 0) return 0;\n\n        return assets.mulDiv(totalSupply_, totalAssets_, _rounding);\n    }\n\n    /// @dev Internal implementation of {convertToAssets}.\n    function _convertToAssets(\n        StrategyData storage S,\n        uint256 shares,\n        Math.Rounding _rounding\n    ) internal view returns (uint256) {\n        // Saves an extra SLOAD if totalSupply() is non-zero.\n        uint256 supply = _totalSupply(S);\n\n        return\n            supply == 0\n                ? shares\n                : shares.mulDiv(_totalAssets(S), supply, _rounding);\n    }\n\n    /// @dev Internal implementation of {maxDeposit}.\n    function _maxDeposit(\n        StrategyData storage S,\n        address receiver\n    ) internal view returns (uint256) {\n        // Cannot deposit when shutdown or to the strategy.\n        if (S.shutdown || receiver == address(this)) return 0;\n\n        return IBaseStrategy(address(this)).availableDepositLimit(receiver);\n    }\n\n    /// @dev Internal implementation of {maxMint}.\n    function _maxMint(\n        StrategyData storage S,\n        address receiver\n    ) internal view returns (uint256 maxMint_) {\n        // Cannot mint when shutdown or to the strategy.\n        if (S.shutdown || receiver == address(this)) return 0;\n\n        maxMint_ = IBaseStrategy(address(this)).availableDepositLimit(receiver);\n        if (maxMint_ != type(uint256).max) {\n            maxMint_ = _convertToShares(S, maxMint_, Math.Rounding.Down);\n        }\n    }\n\n    /// @dev Internal implementation of {maxWithdraw}.\n    function _maxWithdraw(\n        StrategyData storage S,\n        address owner\n    ) internal view returns (uint256 maxWithdraw_) {\n        // Get the max the owner could withdraw currently.\n        maxWithdraw_ = IBaseStrategy(address(this)).availableWithdrawLimit(\n            owner\n        );\n\n        // If there is no limit enforced.\n        if (maxWithdraw_ == type(uint256).max) {\n            // Saves a min check if there is no withdrawal limit.\n            maxWithdraw_ = _convertToAssets(\n                S,\n                _balanceOf(S, owner),\n                Math.Rounding.Down\n            );\n        } else {\n            maxWithdraw_ = Math.min(\n                _convertToAssets(S, _balanceOf(S, owner), Math.Rounding.Down),\n                maxWithdraw_\n            );\n        }\n    }\n\n    /// @dev Internal implementation of {maxRedeem}.\n    function _maxRedeem(\n        StrategyData storage S,\n        address owner\n    ) internal view returns (uint256 maxRedeem_) {\n        // Get the max the owner could withdraw currently.\n        maxRedeem_ = IBaseStrategy(address(this)).availableWithdrawLimit(owner);\n\n        // Conversion would overflow and saves a min check if there is no withdrawal limit.\n        if (maxRedeem_ == type(uint256).max) {\n            maxRedeem_ = _balanceOf(S, owner);\n        } else {\n            maxRedeem_ = Math.min(\n                // Can't redeem more than the balance.\n                _convertToShares(S, maxRedeem_, Math.Rounding.Down),\n                _balanceOf(S, owner)\n            );\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                    INTERNAL 4626 WRITE METHODS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @dev Function to be called during {deposit} and {mint}.\n     *\n     * This function handles all logic including transfers,\n     * minting and accounting.\n     *\n     * We do all external calls before updating any internal\n     * values to prevent view reentrancy issues from the token\n     * transfers or the _deployFunds() calls.\n     */\n    function _deposit(\n        StrategyData storage S,\n        address receiver,\n        uint256 assets,\n        uint256 shares\n    ) internal {\n        // Cache storage variables used more than once.\n        ERC20 _asset = S.asset;\n\n        // Need to transfer before minting or ERC777s could reenter.\n        _asset.safeTransferFrom(msg.sender, address(this), assets);\n\n        // We can deploy the full loose balance currently held.\n        IBaseStrategy(address(this)).deployFunds(\n            _asset.balanceOf(address(this))\n        );\n\n        // Adjust total Assets.\n        S.totalAssets += assets;\n\n        // mint shares\n        _mint(S, receiver, shares);\n\n        emit Deposit(msg.sender, receiver, assets, shares);\n    }\n\n    /**\n     * @dev To be called during {redeem} and {withdraw}.\n     *\n     * This will handle all logic, transfers and accounting\n     * in order to service the withdraw request.\n     *\n     * If we are not able to withdraw the full amount needed, it will\n     * be counted as a loss and passed on to the user.\n     */\n    function _withdraw(\n        StrategyData storage S,\n        address receiver,\n        address owner,\n        uint256 assets,\n        uint256 shares,\n        uint256 maxLoss\n    ) internal returns (uint256) {\n        require(receiver != address(0), \"ZERO ADDRESS\");\n        require(maxLoss <= MAX_BPS, \"exceeds MAX_BPS\");\n\n        // Spend allowance if applicable.\n        if (msg.sender != owner) {\n            _spendAllowance(S, owner, msg.sender, shares);\n        }\n\n        // Cache `asset` since it is used multiple times..\n        ERC20 _asset = S.asset;\n\n        uint256 idle = _asset.balanceOf(address(this));\n        uint256 loss;\n        // Check if we need to withdraw funds.\n        if (idle < assets) {\n            // Tell Strategy to free what we need.\n            unchecked {\n                IBaseStrategy(address(this)).freeFunds(assets - idle);\n            }\n\n            // Return the actual amount withdrawn. Adjust for potential under withdraws.\n            idle = _asset.balanceOf(address(this));\n\n            // If we didn't get enough out then we have a loss.\n            if (idle < assets) {\n                unchecked {\n                    loss = assets - idle;\n                }\n                // If a non-default max loss parameter was set.\n                if (maxLoss < MAX_BPS) {\n                    // Make sure we are within the acceptable range.\n                    require(\n                        loss <= (assets * maxLoss) / MAX_BPS,\n                        \"too much loss\"\n                    );\n                }\n                // Lower the amount to be withdrawn.\n                assets = idle;\n            }\n        }\n\n        // Update assets based on how much we took.\n        S.totalAssets -= (assets + loss);\n\n        _burn(S, owner, shares);\n\n        // Transfer the amount of underlying to the receiver.\n        _asset.safeTransfer(receiver, assets);\n\n        emit Withdraw(msg.sender, receiver, owner, assets, shares);\n\n        // Return the actual amount of assets withdrawn.\n        return assets;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        PROFIT REPORTING\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Function for keepers to call to harvest and record all\n     * profits accrued.\n     *\n     * @dev This will account for any gains/losses since the last report\n     * and charge fees accordingly.\n     *\n     * Any profit over the fees charged will be immediately locked\n     * so there is no change in PricePerShare. Then slowly unlocked\n     * over the `maxProfitUnlockTime` each second based on the\n     * calculated `profitUnlockingRate`.\n     *\n     * In case of a loss it will first attempt to offset the loss\n     * with any remaining locked shares from the last report in\n     * order to reduce any negative impact to PPS.\n     *\n     * Will then recalculate the new time to unlock profits over and the\n     * rate based on a weighted average of any remaining time from the\n     * last report and the new amount of shares to be locked.\n     *\n     * @return profit The notional amount of gain if any since the last\n     * report in terms of `asset`.\n     * @return loss The notional amount of loss if any since the last\n     * report in terms of `asset`.\n     */\n    function report()\n        external\n        nonReentrant\n        onlyKeepers\n        returns (uint256 profit, uint256 loss)\n    {\n        // Cache storage pointer since its used repeatedly.\n        StrategyData storage S = _strategyStorage();\n\n        // Tell the strategy to report the real total assets it has.\n        // It should do all reward selling and redepositing now and\n        // account for deployed and loose `asset` so we can accurately\n        // account for all funds including those potentially airdropped\n        // and then have any profits immediately locked.\n        uint256 newTotalAssets = IBaseStrategy(address(this))\n            .harvestAndReport();\n\n        uint256 oldTotalAssets = _totalAssets(S);\n\n        // Get the amount of shares we need to burn from previous reports.\n        uint256 sharesToBurn = _unlockedShares(S);\n\n        // Initialize variables needed throughout.\n        uint256 totalFees;\n        uint256 protocolFees;\n        uint256 sharesToLock;\n        uint256 _profitMaxUnlockTime = S.profitMaxUnlockTime;\n        // Calculate profit/loss.\n        if (newTotalAssets > oldTotalAssets) {\n            // We have a profit.\n            unchecked {\n                profit = newTotalAssets - oldTotalAssets;\n            }\n\n            // We need to get the equivalent amount of shares\n            // at the current PPS before any minting or burning.\n            sharesToLock = _convertToShares(S, profit, Math.Rounding.Down);\n\n            // Cache the performance fee.\n            uint16 fee = S.performanceFee;\n            uint256 totalFeeShares;\n            // If we are charging a performance fee\n            if (fee != 0) {\n                // Asses performance fees.\n                unchecked {\n                    // Get in `asset` for the event.\n                    totalFees = (profit * fee) / MAX_BPS;\n                    // And in shares for the payment.\n                    totalFeeShares = (sharesToLock * fee) / MAX_BPS;\n                }\n\n                // Get the protocol fee config from the factory.\n                (\n                    uint16 protocolFeeBps,\n                    address protocolFeesRecipient\n                ) = IFactory(FACTORY).protocol_fee_config();\n\n                uint256 protocolFeeShares;\n                // Check if there is a protocol fee to charge.\n                if (protocolFeeBps != 0) {\n                    unchecked {\n                        // Calculate protocol fees based on the performance Fees.\n                        protocolFeeShares =\n                            (totalFeeShares * protocolFeeBps) /\n                            MAX_BPS;\n                        // Need amount in underlying for event.\n                        protocolFees = (totalFees * protocolFeeBps) / MAX_BPS;\n                    }\n\n                    // Mint the protocol fees to the recipient.\n                    _mint(S, protocolFeesRecipient, protocolFeeShares);\n                }\n\n                // Mint the difference to the strategy fee recipient.\n                unchecked {\n                    _mint(\n                        S,\n                        S.performanceFeeRecipient,\n                        totalFeeShares - protocolFeeShares\n                    );\n                }\n            }\n\n            // Check if we are locking profit.\n            if (_profitMaxUnlockTime != 0) {\n                // lock (profit - fees)\n                unchecked {\n                    sharesToLock -= totalFeeShares;\n                }\n\n                // If we are burning more than re-locking.\n                if (sharesToBurn > sharesToLock) {\n                    // Burn the difference\n                    unchecked {\n                        _burn(S, address(this), sharesToBurn - sharesToLock);\n                    }\n                } else if (sharesToLock > sharesToBurn) {\n                    // Mint the shares to lock the strategy.\n                    unchecked {\n                        _mint(S, address(this), sharesToLock - sharesToBurn);\n                    }\n                }\n            }\n        } else {\n            // Expect we have a loss.\n            unchecked {\n                loss = oldTotalAssets - newTotalAssets;\n            }\n\n            // Check in case `else` was due to being equal.\n            if (loss != 0) {\n                // We will try and burn the unlocked shares and as much from any\n                // pending profit still unlocking to offset the loss to prevent any PPS decline post report.\n                sharesToBurn = Math.min(\n                    // Cannot burn more than we have.\n                    S.balances[address(this)],\n                    // Try and burn both the shares already unlocked and the amount for the loss.\n                    _convertToShares(S, loss, Math.Rounding.Down) + sharesToBurn\n                );\n            }\n\n            // Check if there is anything to burn.\n            if (sharesToBurn != 0) {\n                _burn(S, address(this), sharesToBurn);\n            }\n        }\n\n        // Update unlocking rate and time to fully unlocked.\n        uint256 totalLockedShares = S.balances[address(this)];\n        if (totalLockedShares != 0) {\n            uint256 previouslyLockedTime;\n            uint96 _fullProfitUnlockDate = S.fullProfitUnlockDate;\n            // Check if we need to account for shares still unlocking.\n            if (_fullProfitUnlockDate > block.timestamp) {\n                unchecked {\n                    // There will only be previously locked shares if time remains.\n                    // We calculate this here since it should be rare.\n                    previouslyLockedTime =\n                        (_fullProfitUnlockDate - block.timestamp) *\n                        (totalLockedShares - sharesToLock);\n                }\n            }\n\n            // newProfitLockingPeriod is a weighted average between the remaining\n            // time of the previously locked shares and the profitMaxUnlockTime.\n            uint256 newProfitLockingPeriod = (previouslyLockedTime +\n                sharesToLock *\n                _profitMaxUnlockTime) / totalLockedShares;\n\n            // Calculate how many shares unlock per second.\n            S.profitUnlockingRate =\n                (totalLockedShares * MAX_BPS_EXTENDED) /\n                newProfitLockingPeriod;\n\n            // Calculate how long until the full amount of shares is unlocked.\n            S.fullProfitUnlockDate = uint96(\n                block.timestamp + newProfitLockingPeriod\n            );\n        } else {\n            // Only setting this to 0 will turn in the desired effect,\n            // no need to update profitUnlockingRate.\n            S.fullProfitUnlockDate = 0;\n        }\n\n        // Update the new total assets value.\n        S.totalAssets = newTotalAssets;\n        S.lastReport = uint96(block.timestamp);\n\n        // Emit event with info\n        emit Reported(\n            profit,\n            loss,\n            protocolFees, // Protocol fees\n            totalFees - protocolFees // Performance Fees\n        );\n    }\n\n    /**\n     * @notice Get how many shares have been unlocked since last report.\n     * @return . The amount of shares that have unlocked.\n     */\n    function unlockedShares() external view returns (uint256) {\n        return _unlockedShares(_strategyStorage());\n    }\n\n    /**\n     * @dev To determine how many of the shares that were locked during the last\n     * report have since unlocked.\n     *\n     * If the `fullProfitUnlockDate` has passed the full strategy's balance will\n     * count as unlocked.\n     *\n     * @return unlocked The amount of shares that have unlocked.\n     */\n    function _unlockedShares(\n        StrategyData storage S\n    ) internal view returns (uint256 unlocked) {\n        uint96 _fullProfitUnlockDate = S.fullProfitUnlockDate;\n        if (_fullProfitUnlockDate > block.timestamp) {\n            unchecked {\n                unlocked =\n                    (S.profitUnlockingRate * (block.timestamp - S.lastReport)) /\n                    MAX_BPS_EXTENDED;\n            }\n        } else if (_fullProfitUnlockDate != 0) {\n            // All shares have been unlocked.\n            unlocked = S.balances[address(this)];\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            TENDING\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice For a 'keeper' to 'tend' the strategy if a custom\n     * tendTrigger() is implemented.\n     *\n     * @dev Both 'tendTrigger' and '_tend' will need to be overridden\n     * for this to be used.\n     *\n     * This will callback the internal '_tend' call in the BaseStrategy\n     * with the total current amount available to the strategy to deploy.\n     *\n     * This is a permissioned function so if desired it could\n     * be used for illiquid or manipulatable strategies to compound\n     * rewards, perform maintenance or deposit/withdraw funds.\n     *\n     * This will not cause any change in PPS. Total assets will\n     * be the same before and after.\n     *\n     * A report() call will be needed to record any profits or losses.\n     */\n    function tend() external nonReentrant onlyKeepers {\n        // Tend the strategy with the current loose balance.\n        IBaseStrategy(address(this)).tendThis(\n            _strategyStorage().asset.balanceOf(address(this))\n        );\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        STRATEGY SHUTDOWN\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Used to shutdown the strategy preventing any further deposits.\n     * @dev Can only be called by the current `management` or `emergencyAdmin`.\n     *\n     * This will stop any new {deposit} or {mint} calls but will\n     * not prevent {withdraw} or {redeem}. It will also still allow for\n     * {tend} and {report} so that management can report any last losses\n     * in an emergency as well as provide any maintenance to allow for full\n     * withdraw.\n     *\n     * This is a one way switch and can never be set back once shutdown.\n     */\n    function shutdownStrategy() external onlyEmergencyAuthorized {\n        _strategyStorage().shutdown = true;\n\n        emit StrategyShutdown();\n    }\n\n    /**\n     * @notice To manually withdraw funds from the yield source after a\n     * strategy has been shutdown.\n     * @dev This can only be called post {shutdownStrategy}.\n     *\n     * This will never cause a change in PPS. Total assets will\n     * be the same before and after.\n     *\n     * A strategist will need to override the {_emergencyWithdraw} function\n     * in their strategy for this to work.\n     *\n     * @param amount The amount of asset to attempt to free.\n     */\n    function emergencyWithdraw(\n        uint256 amount\n    ) external nonReentrant onlyEmergencyAuthorized {\n        // Make sure the strategy has been shutdown.\n        require(_strategyStorage().shutdown, \"not shutdown\");\n\n        // Withdraw from the yield source.\n        IBaseStrategy(address(this)).shutdownWithdraw(amount);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        GETTER FUNCTIONS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Get the underlying asset for the strategy.\n     * @return . The underlying asset.\n     */\n    function asset() external view returns (address) {\n        return address(_strategyStorage().asset);\n    }\n\n    /**\n     * @notice Get the API version for this TokenizedStrategy.\n     * @return . The API version for this TokenizedStrategy\n     */\n    function apiVersion() external pure returns (string memory) {\n        return API_VERSION;\n    }\n\n    /**\n     * @notice Get the current address that controls the strategy.\n     * @return . Address of management\n     */\n    function management() external view returns (address) {\n        return _strategyStorage().management;\n    }\n\n    /**\n     * @notice Get the current pending management address if any.\n     * @return . Address of pendingManagement\n     */\n    function pendingManagement() external view returns (address) {\n        return _strategyStorage().pendingManagement;\n    }\n\n    /**\n     * @notice Get the current address that can call tend and report.\n     * @return . Address of the keeper\n     */\n    function keeper() external view returns (address) {\n        return _strategyStorage().keeper;\n    }\n\n    /**\n     * @notice Get the current address that can shutdown and emergency withdraw.\n     * @return . Address of the emergencyAdmin\n     */\n    function emergencyAdmin() external view returns (address) {\n        return _strategyStorage().emergencyAdmin;\n    }\n\n    /**\n     * @notice Get the current performance fee charged on profits.\n     * denominated in Basis Points where 10_000 == 100%\n     * @return . Current performance fee.\n     */\n    function performanceFee() external view returns (uint16) {\n        return _strategyStorage().performanceFee;\n    }\n\n    /**\n     * @notice Get the current address that receives the performance fees.\n     * @return . Address of performanceFeeRecipient\n     */\n    function performanceFeeRecipient() external view returns (address) {\n        return _strategyStorage().performanceFeeRecipient;\n    }\n\n    /**\n     * @notice Gets the timestamp at which all profits will be unlocked.\n     * @return . The full profit unlocking timestamp\n     */\n    function fullProfitUnlockDate() external view returns (uint256) {\n        return uint256(_strategyStorage().fullProfitUnlockDate);\n    }\n\n    /**\n     * @notice The per second rate at which profits are unlocking.\n     * @dev This is denominated in EXTENDED_BPS decimals.\n     * @return . The current profit unlocking rate.\n     */\n    function profitUnlockingRate() external view returns (uint256) {\n        return _strategyStorage().profitUnlockingRate;\n    }\n\n    /**\n     * @notice Gets the current time profits are set to unlock over.\n     * @return . The current profit max unlock time.\n     */\n    function profitMaxUnlockTime() external view returns (uint256) {\n        return _strategyStorage().profitMaxUnlockTime;\n    }\n\n    /**\n     * @notice The timestamp of the last time protocol fees were charged.\n     * @return . The last report.\n     */\n    function lastReport() external view returns (uint256) {\n        return uint256(_strategyStorage().lastReport);\n    }\n\n    /**\n     * @notice Get the price per share.\n     * @dev This value offers limited precision. Integrations that require\n     * exact precision should use convertToAssets or convertToShares instead.\n     *\n     * @return . The price per share.\n     */\n    function pricePerShare() external view returns (uint256) {\n        StrategyData storage S = _strategyStorage();\n        return _convertToAssets(S, 10 ** S.decimals, Math.Rounding.Down);\n    }\n\n    /**\n     * @notice To check if the strategy has been shutdown.\n     * @return . Whether or not the strategy is shutdown.\n     */\n    function isShutdown() external view returns (bool) {\n        return _strategyStorage().shutdown;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        SETTER FUNCTIONS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Step one of two to set a new address to be in charge of the strategy.\n     * @dev Can only be called by the current `management`. The address is\n     * set to pending management and will then have to call {acceptManagement}\n     * in order for the 'management' to officially change.\n     *\n     * Cannot set `management` to address(0).\n     *\n     * @param _management New address to set `pendingManagement` to.\n     */\n    function setPendingManagement(address _management) external onlyManagement {\n        require(_management != address(0), \"ZERO ADDRESS\");\n        _strategyStorage().pendingManagement = _management;\n\n        emit UpdatePendingManagement(_management);\n    }\n\n    /**\n     * @notice Step two of two to set a new 'management' of the strategy.\n     * @dev Can only be called by the current `pendingManagement`.\n     */\n    function acceptManagement() external {\n        StrategyData storage S = _strategyStorage();\n        require(msg.sender == S.pendingManagement, \"!pending\");\n        S.management = msg.sender;\n        S.pendingManagement = address(0);\n\n        emit UpdateManagement(msg.sender);\n    }\n\n    /**\n     * @notice Sets a new address to be in charge of tend and reports.\n     * @dev Can only be called by the current `management`.\n     *\n     * @param _keeper New address to set `keeper` to.\n     */\n    function setKeeper(address _keeper) external onlyManagement {\n        _strategyStorage().keeper = _keeper;\n\n        emit UpdateKeeper(_keeper);\n    }\n\n    /**\n     * @notice Sets a new address to be able to shutdown the strategy.\n     * @dev Can only be called by the current `management`.\n     *\n     * @param _emergencyAdmin New address to set `emergencyAdmin` to.\n     */\n    function setEmergencyAdmin(\n        address _emergencyAdmin\n    ) external onlyManagement {\n        _strategyStorage().emergencyAdmin = _emergencyAdmin;\n\n        emit UpdateEmergencyAdmin(_emergencyAdmin);\n    }\n\n    /**\n     * @notice Sets the performance fee to be charged on reported gains.\n     * @dev Can only be called by the current `management`.\n     *\n     * Denominated in Basis Points. So 100% == 10_000.\n     * Cannot set greater than to MAX_FEE.\n     *\n     * @param _performanceFee New performance fee.\n     */\n    function setPerformanceFee(uint16 _performanceFee) external onlyManagement {\n        require(_performanceFee <= MAX_FEE, \"MAX FEE\");\n        _strategyStorage().performanceFee = _performanceFee;\n\n        emit UpdatePerformanceFee(_performanceFee);\n    }\n\n    /**\n     * @notice Sets a new address to receive performance fees.\n     * @dev Can only be called by the current `management`.\n     *\n     * Cannot set to address(0).\n     *\n     * @param _performanceFeeRecipient New address to set `management` to.\n     */\n    function setPerformanceFeeRecipient(\n        address _performanceFeeRecipient\n    ) external onlyManagement {\n        require(_performanceFeeRecipient != address(0), \"ZERO ADDRESS\");\n        require(_performanceFeeRecipient != address(this), \"Cannot be self\");\n        _strategyStorage().performanceFeeRecipient = _performanceFeeRecipient;\n\n        emit UpdatePerformanceFeeRecipient(_performanceFeeRecipient);\n    }\n\n    /**\n     * @notice Sets the time for profits to be unlocked over.\n     * @dev Can only be called by the current `management`.\n     *\n     * Denominated in seconds and cannot be greater than 1 year.\n     *\n     * NOTE: Setting to 0 will cause all currently locked profit\n     * to be unlocked instantly and should be done with care.\n     *\n     * `profitMaxUnlockTime` is stored as a uint32 for packing but can\n     * be passed in as uint256 for simplicity.\n     *\n     * @param _profitMaxUnlockTime New `profitMaxUnlockTime`.\n     */\n    function setProfitMaxUnlockTime(\n        uint256 _profitMaxUnlockTime\n    ) external onlyManagement {\n        // Must be less than a year.\n        require(_profitMaxUnlockTime <= SECONDS_PER_YEAR, \"too long\");\n        StrategyData storage S = _strategyStorage();\n\n        // If we are setting to 0 we need to adjust amounts.\n        if (_profitMaxUnlockTime == 0) {\n            uint256 shares = S.balances[address(this)];\n            if (shares != 0) {\n                // Burn all shares if applicable.\n                _burn(S, address(this), shares);\n            }\n            // Reset unlocking variables\n            S.profitUnlockingRate = 0;\n            S.fullProfitUnlockDate = 0;\n        }\n\n        S.profitMaxUnlockTime = uint32(_profitMaxUnlockTime);\n\n        emit UpdateProfitMaxUnlockTime(_profitMaxUnlockTime);\n    }\n\n    /**\n     * @notice Updates the name for the strategy.\n     * @param _name The new name for the strategy.\n     */\n    function setName(string calldata _name) external onlyManagement {\n        _strategyStorage().name = _name;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        ERC20 METHODS\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Returns the name of the token.\n     * @return . The name the strategy is using for its token.\n     */\n    function name() external view returns (string memory) {\n        return _strategyStorage().name;\n    }\n\n    /**\n     * @notice Returns the symbol of the strategies token.\n     * @dev Will be 'ys + asset symbol'.\n     * @return . The symbol the strategy is using for its tokens.\n     */\n    function symbol() external view returns (string memory) {\n        return\n            string(abi.encodePacked(\"ys\", _strategyStorage().asset.symbol()));\n    }\n\n    /**\n     * @notice Returns the number of decimals used to get its user representation.\n     * @return . The decimals used for the strategy and `asset`.\n     */\n    function decimals() external view returns (uint8) {\n        return _strategyStorage().decimals;\n    }\n\n    /**\n     * @notice Returns the current balance for a given '_account'.\n     * @dev If the '_account` is the strategy then this will subtract\n     * the amount of shares that have been unlocked since the last profit first.\n     * @param account the address to return the balance for.\n     * @return . The current balance in y shares of the '_account'.\n     */\n    function balanceOf(address account) external view returns (uint256) {\n        return _balanceOf(_strategyStorage(), account);\n    }\n\n    /// @dev Internal implementation of {balanceOf}.\n    function _balanceOf(\n        StrategyData storage S,\n        address account\n    ) internal view returns (uint256) {\n        if (account == address(this)) {\n            return S.balances[account] - _unlockedShares(S);\n        }\n        return S.balances[account];\n    }\n\n    /**\n     * @notice Transfer '_amount` of shares from `msg.sender` to `to`.\n     * @dev\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - `to` cannot be the address of the strategy.\n     * - the caller must have a balance of at least `_amount`.\n     *\n     * @param to The address shares will be transferred to.\n     * @param amount The amount of shares to be transferred from sender.\n     * @return . a boolean value indicating whether the operation succeeded.\n     */\n    function transfer(address to, uint256 amount) external returns (bool) {\n        _transfer(_strategyStorage(), msg.sender, to, amount);\n        return true;\n    }\n\n    /**\n     * @notice Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     * @param owner The address who owns the shares.\n     * @param spender The address who would be moving the owners shares.\n     * @return . The remaining amount of shares of `owner` that could be moved by `spender`.\n     */\n    function allowance(\n        address owner,\n        address spender\n    ) external view returns (uint256) {\n        return _allowance(_strategyStorage(), owner, spender);\n    }\n\n    /// @dev Internal implementation of {allowance}.\n    function _allowance(\n        StrategyData storage S,\n        address owner,\n        address spender\n    ) internal view returns (uint256) {\n        return S.allowances[owner][spender];\n    }\n\n    /**\n     * @notice Sets `amount` as the allowance of `spender` over the caller's tokens.\n     * @dev\n     *\n     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     *\n     * @param spender the address to allow the shares to be moved by.\n     * @param amount the amount of shares to allow `spender` to move.\n     * @return . a boolean value indicating whether the operation succeeded.\n     */\n    function approve(address spender, uint256 amount) external returns (bool) {\n        _approve(_strategyStorage(), msg.sender, spender, amount);\n        return true;\n    }\n\n    /**\n     * @notice `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * @dev\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `to` cannot be the address of the strategy.\n     * - `from` must have a balance of at least `amount`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `amount`.\n     *\n     * Emits a {Transfer} event.\n     *\n     * @param from the address to be moving shares from.\n     * @param to the address to be moving shares to.\n     * @param amount the quantity of shares to move.\n     * @return . a boolean value indicating whether the operation succeeded.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool) {\n        StrategyData storage S = _strategyStorage();\n        _spendAllowance(S, from, msg.sender, amount);\n        _transfer(S, from, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev Moves `amount` of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `to` cannot be the strategies address\n     * - `from` must have a balance of at least `amount`.\n     *\n     */\n    function _transfer(\n        StrategyData storage S,\n        address from,\n        address to,\n        uint256 amount\n    ) internal {\n        require(from != address(0), \"ERC20: transfer from the zero address\");\n        require(to != address(0), \"ERC20: transfer to the zero address\");\n        require(to != address(this), \"ERC20 transfer to strategy\");\n\n        S.balances[from] -= amount;\n        unchecked {\n            S.balances[to] += amount;\n        }\n\n        emit Transfer(from, to, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     *\n     */\n    function _mint(\n        StrategyData storage S,\n        address account,\n        uint256 amount\n    ) internal {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        S.totalSupply += amount;\n        unchecked {\n            S.balances[account] += amount;\n        }\n        emit Transfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(\n        StrategyData storage S,\n        address account,\n        uint256 amount\n    ) internal {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        S.balances[account] -= amount;\n        unchecked {\n            S.totalSupply -= amount;\n        }\n        emit Transfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     */\n    function _approve(\n        StrategyData storage S,\n        address owner,\n        address spender,\n        uint256 amount\n    ) internal {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        S.allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n     *\n     * Does not update the allowance amount in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Might emit an {Approval} event.\n     */\n    function _spendAllowance(\n        StrategyData storage S,\n        address owner,\n        address spender,\n        uint256 amount\n    ) internal {\n        uint256 currentAllowance = _allowance(S, owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            require(\n                currentAllowance >= amount,\n                \"ERC20: insufficient allowance\"\n            );\n            unchecked {\n                _approve(S, owner, spender, currentAllowance - amount);\n            }\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            EIP-2612 LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * @dev Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     *\n     * @param _owner the address of the account to return the nonce for.\n     * @return . the current nonce for the account.\n     */\n    function nonces(address _owner) external view returns (uint256) {\n        return _strategyStorage().nonces[_owner];\n    }\n\n    /**\n     * @notice Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * @dev IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external {\n        require(deadline >= block.timestamp, \"ERC20: PERMIT_DEADLINE_EXPIRED\");\n\n        // Unchecked because the only math done is incrementing\n        // the owner's nonce which cannot realistically overflow.\n        unchecked {\n            address recoveredAddress = ecrecover(\n                keccak256(\n                    abi.encodePacked(\n                        \"\\x19\\x01\",\n                        DOMAIN_SEPARATOR(),\n                        keccak256(\n                            abi.encode(\n                                keccak256(\n                                    \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n                                ),\n                                owner,\n                                spender,\n                                value,\n                                _strategyStorage().nonces[owner]++,\n                                deadline\n                            )\n                        )\n                    )\n                ),\n                v,\n                r,\n                s\n            );\n\n            require(\n                recoveredAddress != address(0) && recoveredAddress == owner,\n                \"ERC20: INVALID_SIGNER\"\n            );\n\n            _approve(_strategyStorage(), recoveredAddress, spender, value);\n        }\n    }\n\n    /**\n     * @notice Returns the domain separator used in the encoding of the signature\n     * for {permit}, as defined by {EIP712}.\n     *\n     * @return . The domain separator that will be used for any {permit} calls.\n     */\n    function DOMAIN_SEPARATOR() public view returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    keccak256(\n                        \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n                    ),\n                    keccak256(\"Yearn Vault\"),\n                    keccak256(bytes(API_VERSION)),\n                    block.chainid,\n                    address(this)\n                )\n            );\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            DEPLOYMENT\n    //////////////////////////////////////////////////////////////*/\n\n    /**\n     * @dev On contract creation we set `asset` for this contract to address(1).\n     * This prevents it from ever being initialized in the future.\n     * @param _factory Address of the factory of the same version for protocol fees.\n     */\n    constructor(address _factory) {\n        FACTORY = _factory;\n        _strategyStorage().asset = ERC20(address(1));\n    }\n}\n","deployed_bytecode":"0x608060405234801561001057600080fd5b50600436106103d05760003560e01c806387788782116101ff578063bf86d6901161011a578063d505accf116100ad578063df69b22a1161007c578063df69b22a146107d5578063ed27f7c9146107e8578063ef8b30f714610753578063f629b790146107f057600080fd5b8063d505accf14610794578063d905777e146107a7578063d9a0e97a146107ba578063dd62ed3e146107c257600080fd5b8063c6e6f592116100e9578063c6e6f59214610753578063c8c2fe6c14610766578063ce96cb771461076e578063d43fdcf71461078157600080fd5b8063bf86d6901461071d578063c3535b5214610725578063c47f00271461072d578063c63d75b61461074057600080fd5b8063a9059cbb11610192578063b460af9411610161578063b460af94146106e6578063ba087652146106f9578063bc063e1a1461070c578063be8f16681461071557600080fd5b8063a9059cbb146106a5578063aa290e6d146106b8578063aced1661146106cb578063b3d7f6b9146106d357600080fd5b806397073ae6116101ce57806397073ae61461066457806399530b06146106775780639f40a7b31461067f578063a318c1a41461069257600080fd5b8063877887821461062657806388a8d6021461064157806394bf804d1461064957806395d89b411461065c57600080fd5b806338d52e0f116102ef5780636a5f1aa211610282578063748747e611610251578063748747e6146105da5780637ecebe00146105ed57806382e00a441461060057806385b687561461061357600080fd5b80636a5f1aa2146105995780636e553f65146105ac57806370905dce146105bf57806370a08231146105c757600080fd5b80634abe4137116102be5780634abe41371461056b5780634cdad506146104055780635141eebb1461057e5780635312ea8e1461058657600080fd5b806338d52e0f14610535578063402d267d1461053d578063440368a31461055057806348e4a6491461055857600080fd5b806323b872dd116103675780632dd31000116103365780632dd31000146104d7578063313ce567146104fe57806335da3394146105185780633644e5151461052d57600080fd5b806323b872dd1461047e57806325829410146104915780632606a10b146104b25780632d632692146104cf57600080fd5b8063095ea7b3116103a3578063095ea7b3146104205780630a28a477146104435780630b68f46f1461045657806318160ddd1461047657600080fd5b806301e1d114146103d557806306fdde03146103f057806307a2d13a146104055780630952864e14610418575b600080fd5b6103dd610803565b6040519081526020015b60405180910390f35b6103f861081c565b6040516103e79190613577565b6103dd6104133660046135aa565b6108b7565b6103dd6108d2565b61043361042e3660046135e8565b6108eb565b60405190151581526020016103e7565b6103dd6104513660046135aa565b610909565b61045e61091e565b6040516001600160a01b0390911681526020016103e7565b6103dd61093a565b61043361048c366004613614565b61094c565b6040805180820190915260058152640ccb8c0b8d60da1b60208201526103f8565b6104ba61097e565b604080519283526020830191909152016103e7565b6103dd610db1565b61045e7f000000000000000000000000770d0d1fb036483ed4abb6d53c1c88fb277d812f81565b610506610dcd565b60405160ff90911681526020016103e7565b61052b610526366004613655565b610de7565b005b6103dd610e46565b61045e610efe565b6103dd61054b366004613655565b610f17565b61052b610f2a565b61052b610566366004613655565b611065565b6103dd6105793660046135e8565b6110c3565b6103dd6110d6565b61052b6105943660046135aa565b6110e9565b61052b6105a7366004613655565b6111ff565b6103dd6105ba366004613672565b6112d9565b61045e61147b565b6103dd6105d5366004613655565b611497565b61052b6105e8366004613655565b6114aa565b6103dd6105fb366004613655565b61150e565b61052b61060e366004613655565b61153a565b6103dd6106213660046135e8565b6115c3565b61062e6115d6565b60405161ffff90911681526020016103e7565b61045e6115f5565b6103dd610657366004613672565b611618565b6103f8611728565b61052b610672366004613711565b6117c6565b6103dd611a50565b6103dd61068d3660046137d6565b611a88565b6103dd6106a03660046137d6565b611bbc565b6104336106b33660046135e8565b611cec565b61052b6106c636600461382e565b611d01565b61045e611da9565b6103dd6106e13660046135aa565b611dcc565b6103dd6106f436600461384b565b611de1565b6103dd61070736600461384b565b611df8565b61062e61138881565b61052b611e08565b610433611e63565b6103dd611e80565b61052b61073b36600461388d565b611e9c565b6103dd61074e366004613655565b611ec3565b6103dd6107613660046135aa565b611ed6565b61052b611eeb565b6103dd61077c366004613655565b611f9b565b61052b61078f366004613655565b611fae565b61052b6107a236600461390e565b61202c565b6103dd6107b5366004613655565b61223a565b6103dd61224d565b6103dd6107d036600461397f565b61225f565b61052b6107e33660046135aa565b61229a565b61045e612382565b61052b6107fe366004613655565b6123a5565b600061081761081061242a565b6006015490565b905090565b606061082661242a565b6001018054610834906139ad565b80601f0160208091040260200160405190810160405280929190818152602001828054610860906139ad565b80156108ad5780601f10610882576101008083540402835291602001916108ad565b820191906000526020600020905b81548152906001019060200180831161089057829003601f168201915b5050505050905090565b60006108cc6108c461242a565b836000612458565b92915050565b60006108dc61242a565b6009015463ffffffff16919050565b60006109006108f861242a565b338585612493565b50600192915050565b60006108cc61091661242a565b8360016125bb565b600061092861242a565b600b01546001600160a01b0316919050565b600061081761094761242a565b612612565b60008061095761242a565b90506109658186338661262c565b610971818686866126c2565b60019150505b9392505050565b600080600061098b61242a565b600c810154909150600119600160a01b90910460ff16016109c75760405162461bcd60e51b81526004016109be906139e1565b60405180910390fd5b600c8101805460ff60a01b1916600160a11b1790556109e533611fae565b60006109ef61242a565b90506000306001600160a01b03166349317f1d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a579190613a18565b90506000610a66836006015490565b90506000610a7384612867565b60098501549091506000908190819063ffffffff1685871115610bf4578587039a50610aa1888c60006125bb565b6009890154909250640100000000900461ffff1660008115610bb35761271061ffff83168e0204955061271061ffff831685020490506000807f000000000000000000000000770d0d1fb036483ed4abb6d53c1c88fb277d812f6001600160a01b0316635153b1996040518163ffffffff1660e01b81526004016040805180830381865afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190613a47565b9150915060008261ffff16600014610b8c575061271061ffff83168981028290049850840204610b8c8d83836128cf565b60098d0154610baf908e90600160301b90046001600160a01b03168387036128cf565b5050505b8215610bed57808403935083871115610bd857610bd38a30868a03612996565b610bed565b86841115610bed57610bed8a308987036128cf565b5050610c49565b868603995089600014610c3857306000908152600489016020526040812054610c35918790610c26908c908f906125bb565b610c309190613a8c565b612a6e565b94505b8415610c4957610c49883087612996565b3060009081526004890160205260409020548015610d045760088901546000906001600160601b031642811115610c8d5784830342826001600160601b0316030291505b600083610c9a8688613a9f565b610ca49085613a8c565b610cae9190613ab6565b905080610cc064e8d4a5100086613a9f565b610cca9190613ab6565b60078d0155610cd98142613a8c565b60088d0180546001600160601b0319166001600160601b039290921691909117905550610d17915050565b6008890180546001600160601b03191690555b60068901889055600a890180546001600160601b031916426001600160601b03161790557fecdd072e4d5bd913a75a37f02daedcea7e2dc0281f9942c0063cfd1cfe5c4c4f8c8c86610d69818a613ad8565b60408051948552602085019390935291830152606082015260800160405180910390a1505050600c909601805460ff60a01b1916600160a01b17905550959694955050505050565b6000610dbb61242a565b600801546001600160601b0316919050565b6000610dd761242a565b54600160a01b900460ff16919050565b610df033611065565b80610df961242a565b600c0180546001600160a01b0319166001600160a01b03928316179055604051908216907f2bf242d027263e45fab022c28b4144255c97b30b8e54c30f1f5757906d487f0990600090a250565b60408051808201825260058152640ccb8c0b8d60da1b60209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fda26655fe98828873f36b43d69dcf685bd7966c6141a47d0d8cf605a48cc4e6a818401527faa741e830036c691364b6111f364dcbe19c4c13e8962b6404784a49bef110d6460608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b6000610f0861242a565b546001600160a01b0316919050565b60006108cc610f2461242a565b83612a84565b6000610f3461242a565b600c810154909150600119600160a01b90910460ff1601610f675760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b179055610f8533611fae565b30639d7fb70c610f9361242a565b546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190613a18565b6040518263ffffffff1660e01b815260040161101b91815260200190565b600060405180830381600087803b15801561103557600080fd5b505af1158015611049573d6000803e3d6000fd5b505050600c909101805460ff60a01b1916600160a01b17905550565b61106d61242a565b600a01546001600160a01b03828116600160601b90920416146110c05760405162461bcd60e51b815260206004820152600b60248201526a085b585b9859d95b595b9d60aa1b60448201526064016109be565b50565b60006109776110d061242a565b84612b1e565b60006110e061242a565b60070154905090565b60006110f361242a565b600c810154909150600119600160a01b90910460ff16016111265760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b1790556111443361153a565b61114c61242a565b600c0154600160a81b900460ff166111955760405162461bcd60e51b815260206004820152600c60248201526b3737ba1039b43aba3237bbb760a11b60448201526064016109be565b604051631fbd027560e31b815260048101839052309063fde813a890602401600060405180830381600087803b1580156111ce57600080fd5b505af11580156111e2573d6000803e3d6000fd5b505050600c909101805460ff60a01b1916600160a01b1790555050565b61120833611065565b6001600160a01b03811661122e5760405162461bcd60e51b81526004016109be90613aeb565b306001600160a01b038216036112775760405162461bcd60e51b815260206004820152600e60248201526d21b0b73737ba1031329039b2b63360911b60448201526064016109be565b8061128061242a565b60090180546601000000000000600160d01b031916600160301b6001600160a01b0393841602179055604051908216907f9ebbf695dd251e855d9d15a146a72f5f654dc6f8630fbc11212f27e0c88ba11a90600090a250565b6000806112e461242a565b600c810154909150600119600160a01b90910460ff16016113175760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b179055600061133661242a565b905060001985036113af5780546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190613a18565b94505b6113b98185612a84565b8511156114085760405162461bcd60e51b815260206004820152601e60248201527f455243343632363a206465706f736974206d6f7265207468616e206d6178000060448201526064016109be565b611414818660006125bb565b9250826000036114545760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064016109be565b61146081858786612bbe565b50600c01805460ff60a01b1916600160a01b17905592915050565b600061148561242a565b600c01546001600160a01b0316919050565b60006108cc6114a461242a565b83612d08565b6114b333611065565b806114bc61242a565b60080180546001600160601b0316600160601b6001600160a01b0393841602179055604051908216907fd7f49e282c36d417b290d4181a56943f6d670aaa2987c0d40e60d39919c6888290600090a250565b600061151861242a565b6001600160a01b03909216600090815260039290920160205250604090205490565b600061154461242a565b600c8101549091506001600160a01b038381169116148061157b5750600a8101546001600160a01b03838116600160601b90920416145b6115bf5760405162461bcd60e51b815260206004820152601560248201527408595b595c99d95b98de48185d5d1a1bdc9a5e9959605a1b60448201526064016109be565b5050565b60006109776115d061242a565b84612d68565b60006115e061242a565b60090154640100000000900461ffff16919050565b60006115ff61242a565b600a0154600160601b90046001600160a01b0316919050565b60008061162361242a565b600c810154909150600119600160a01b90910460ff16016116565760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b179055600061167561242a565b90506116818185612e03565b8511156116d05760405162461bcd60e51b815260206004820152601b60248201527f455243343632363a206d696e74206d6f7265207468616e206d6178000000000060448201526064016109be565b6116dc81866001612458565b92508260000361171c5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b60448201526064016109be565b61146081858588612bbe565b606061173261242a565b54604080516395d89b4160e01b815290516001600160a01b03909216916395d89b41916004808201926000929091908290030181865afa15801561177a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117a29190810190613b11565b6040516020016117b29190613b7f565b604051602081830303815290604052905090565b60006117d061242a565b80549091506001600160a01b0316156118195760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064016109be565b80546001600160a01b0319166001600160a01b038716178155600181016118408682613bf7565b50856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561187f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a39190613cb7565b815460ff91909116600160a01b0260ff60a01b1990911617815560098101805463ffffffff1916620d2f001790556001600160a01b0383166118f75760405162461bcd60e51b81526004016109be90613aeb565b306001600160a01b038416036119385760405162461bcd60e51b81526004016109be9060208082526004908201526339b2b63360e11b604082015260600190565b600981018054640100000000600160d01b031916600160301b6001600160a01b038681169190910265ffff000000001916919091176503e80000000017909155600a820180546001600160601b031916426001600160601b031617905584166119b35760405162461bcd60e51b81526004016109be90613aeb565b600a810180546001600160a01b03808716600160601b9081026001600160601b03938416179093556008840180548683169094029390921692909217905560408051808201825260058152640ccb8c0b8d60da1b602082015290519188169130917ffb1616746b8474b6b7c67f2fe5ada156ed24774d0efe8bfe529cf537ba17333091611a409190613577565b60405180910390a3505050505050565b600080611a5b61242a565b8054909150611a82908290611a7b90600160a01b900460ff16600a613db8565b6000612458565b91505090565b600080611a9361242a565b600c810154909150600119600160a01b90910460ff1601611ac65760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b1790556000611ae561242a565b9050611af18186612b1e565b871115611b405760405162461bcd60e51b815260206004820152601d60248201527f455243343632363a2072656465656d206d6f7265207468616e206d617800000060448201526064016109be565b6000611b4e82896000612458565b905080600003611b8e5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b60448201526064016109be565b611b9c828888848c8a612eb4565b93505050600c01805460ff60a01b1916600160a01b179055949350505050565b600080611bc761242a565b600c810154909150600119600160a01b90910460ff1601611bfa5760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b1790556000611c1961242a565b9050611c258186612d68565b871115611c745760405162461bcd60e51b815260206004820152601f60248201527f455243343632363a207769746864726177206d6f7265207468616e206d61780060448201526064016109be565b611c80818860016125bb565b925082600003611cc05760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064016109be565b611cce8187878a8789612eb4565b5050600c01805460ff60a01b1916600160a01b179055949350505050565b6000610900611cf961242a565b3385856126c2565b611d0a33611065565b61138861ffff82161115611d4a5760405162461bcd60e51b81526020600482015260076024820152664d41582046454560c81b60448201526064016109be565b80611d5361242a565b600901805465ffff00000000191664010000000061ffff9384160217905560405190821681527fdc843735e683348ec21c302ffff45462399c5c46f75f67b0a1a5395c535997539060200160405180910390a150565b6000611db361242a565b60080154600160601b90046001600160a01b0316919050565b60006108cc611dd961242a565b836001612458565b6000611df08484846000611bbc565b949350505050565b6000611df0848484612710611a88565b611e113361153a565b6001611e1b61242a565b600c018054911515600160a81b0260ff60a81b199092169190911790556040517ffc1249757a7f27c510c8173c55d03ba442e0d33d9223e06ceb416feac8c7693f90600090a1565b6000611e6d61242a565b600c0154600160a81b900460ff16919050565b6000611e8a61242a565b600a01546001600160601b0316919050565b611ea533611065565b8181611eaf61242a565b60010191611ebe919083613dc7565b505050565b60006108cc611ed061242a565b83612e03565b60006108cc611ee361242a565b8360006125bb565b6000611ef561242a565b600b8101549091506001600160a01b03163314611f3f5760405162461bcd60e51b81526020600482015260086024820152672170656e64696e6760c01b60448201526064016109be565b600a810180546001600160601b031633600160601b810291909117909155600b820180546001600160a01b03191690556040517fff54978127edd34aec0f9061fb3b155fbe0ededdfa881ee3e0d541d3a1eef43890600090a250565b60006108cc611fa861242a565b83612d68565b6000611fb861242a565b60088101549091506001600160a01b03838116600160601b909204161480611ff65750600a8101546001600160a01b03838116600160601b90920416145b6115bf5760405162461bcd60e51b815260206004820152600760248201526610b5b2b2b832b960c91b60448201526064016109be565b4284101561207c5760405162461bcd60e51b815260206004820152601e60248201527f45524332303a205045524d49545f444541444c494e455f45585049524544000060448201526064016109be565b60006001612088610e46565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98a8a8a6120b461242a565b6001600160a01b038f8116600090815260039290920160209081526040928390208054600181019091558351808301989098529582168784015293166060860152608085019190915260a084019290925260c08084018b90528251808503909101815260e08401909252815191012061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156121a3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906121d95750876001600160a01b0316816001600160a01b0316145b61221d5760405162461bcd60e51b815260206004820152601560248201527422a92199181d1024a72b20a624a22fa9a4a3a722a960591b60448201526064016109be565b61223061222861242a565b828989612493565b5050505050505050565b60006108cc61224761242a565b83612b1e565b600061081761225a61242a565b612867565b600061097761226c61242a565b6001600160a01b03808616600090815260059290920160209081526040808420928716845291905290205490565b6122a333611065565b6301e185588111156122e25760405162461bcd60e51b8152602060048201526008602482015267746f6f206c6f6e6760c01b60448201526064016109be565b60006122ec61242a565b90508160000361233457306000908152600482016020526040902054801561231957612319823083612996565b50600060078201556008810180546001600160601b03191690555b60098101805463ffffffff191663ffffffff84161790556040518281527ff361aed463da6fa20358e45c6209f1d3e16d4eca706e6eab0b0aeb338729c77a9060200160405180910390a15050565b600061238c61242a565b60090154600160301b90046001600160a01b0316919050565b6123ae33611065565b6001600160a01b0381166123d45760405162461bcd60e51b81526004016109be90613aeb565b806123dd61242a565b600b0180546001600160a01b0319166001600160a01b03928316179055604051908216907fd74668a8c80a07cc56d7c3318a06439eaa815e740d97dcd83487e1fc75076b8b90600090a250565b6000806108cc60017fd2841a5d2692465040bd5e06a6f3b37483952c866e0f304dc0e03f76a1f8a0b1613ad8565b60008061246485612612565b905080156124885761248361247a866006015490565b8590838661317f565b61248a565b835b95945050505050565b6001600160a01b0383166124f55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016109be565b6001600160a01b0382166125565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016109be565b6001600160a01b03838116600081815260058701602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a350505050565b6000806125c785612612565b9050806000036125da5783915050610977565b60006125e7866006015490565b9050806000036125fc57600092505050610977565b6126088583838761317f565b9695505050505050565b600061261d82612867565b82600201546108cc9190613ad8565b6001600160a01b03838116600090815260058601602090815260408083209386168352929052205460001981146126bb57818110156126ad5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016109be565b6126bb858585858503612493565b5050505050565b6001600160a01b0383166127265760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016109be565b6001600160a01b0382166127885760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016109be565b306001600160a01b038316036127e05760405162461bcd60e51b815260206004820152601a60248201527f4552433230207472616e7366657220746f20737472617465677900000000000060448201526064016109be565b6001600160a01b03831660009081526004850160205260408120805483929061280a908490613ad8565b90915550506001600160a01b038083166000818152600487016020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906125ad9085815260200190565b60088101546000906001600160601b0316428111156128a557600a830154600784015464e8d4a51000916001600160601b03164203020491506128c9565b6001600160601b038116156128c95730600090815260048401602052604090205491505b50919050565b6001600160a01b0382166129255760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016109be565b808360020160008282546129399190613a8c565b90915550506001600160a01b03821660008181526004850160209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91015b60405180910390a3505050565b6001600160a01b0382166129f65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016109be565b6001600160a01b038216600090815260048401602052604081208054839290612a20908490613ad8565b909155505060028301805482900390556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612989565b6000818310612a7d5781610977565b5090919050565b600c820154600090600160a81b900460ff1680612aa957506001600160a01b03821630145b15612ab6575060006108cc565b604051632355178960e11b81526001600160a01b038316600482015230906346aa2f1290602401602060405180830381865afa158015612afa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109779190613a18565b6040516304bd462960e01b81526001600160a01b038216600482015260009030906304bd462990602401602060405180830381865afa158015612b65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b899190613a18565b90506000198103612ba557612b9e8383612d08565b90506108cc565b610977612bb4848360006125bb565b610c308585612d08565b83546001600160a01b0316612bd5813330866131d0565b6040516370a0823160e01b815230600482018190529063503160d9906001600160a01b038416906370a0823190602401602060405180830381865afa158015612c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c469190613a18565b6040518263ffffffff1660e01b8152600401612c6491815260200190565b600060405180830381600087803b158015612c7e57600080fd5b505af1158015612c92573d6000803e3d6000fd5b5050505082856006016000828254612caa9190613a8c565b90915550612cbb90508585846128cf565b60408051848152602081018490526001600160a01b0386169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a35050505050565b6000306001600160a01b03831603612d4857612d2383612867565b6001600160a01b0383166000908152600485016020526040902054612b9e9190613ad8565b506001600160a01b03166000908152600491909101602052604090205490565b6040516304bd462960e01b81526001600160a01b038216600482015260009030906304bd462990602401602060405180830381865afa158015612daf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd39190613a18565b90506000198103612dec57612b9e83611a7b8585612d08565b610977612dfd84611a7b8686612d08565b82612a6e565b600c820154600090600160a81b900460ff1680612e2857506001600160a01b03821630145b15612e35575060006108cc565b604051632355178960e11b81526001600160a01b038316600482015230906346aa2f1290602401602060405180830381865afa158015612e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9d9190613a18565b905060001981146108cc57610977838260006125bb565b60006001600160a01b038616612edc5760405162461bcd60e51b81526004016109be90613aeb565b612710821115612f205760405162461bcd60e51b815260206004820152600f60248201526e65786365656473204d41585f42505360881b60448201526064016109be565b336001600160a01b03861614612f3c57612f3c8786338661262c565b86546040516370a0823160e01b81523060048201526001600160a01b039091169060009082906370a0823190602401602060405180830381865afa158015612f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fac9190613a18565b90506000868210156130e457604051633d6cb57560e01b815282880360048201523090633d6cb57590602401600060405180830381600087803b158015612ff257600080fd5b505af1158015613006573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526001600160a01b03861692506370a082319150602401602060405180830381865afa15801561304e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130729190613a18565b9150868210156130e457508086036127108510156130e0576127106130978689613a9f565b6130a19190613ab6565b8111156130e05760405162461bcd60e51b815260206004820152600d60248201526c746f6f206d756368206c6f737360981b60448201526064016109be565b8196505b6130ee8188613a8c565b8a60060160008282546131019190613ad8565b9091555061311290508a8988612996565b6131266001600160a01b0384168a89613241565b60408051888152602081018890526001600160a01b03808b1692908c169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a4509498975050505050505050565b60008061318d868686613271565b905060018360028111156131a3576131a3613e87565b1480156131c05750600084806131bb576131bb613a31565b868809115b1561248a57612608600182613a8c565b6040516001600160a01b038085166024830152831660448201526064810182905261323b9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261335b565b50505050565b6040516001600160a01b038316602482015260448101829052611ebe90849063a9059cbb60e01b90606401613204565b60008080600019858709858702925082811083820303915050806000036132ab578382816132a1576132a1613a31565b0492505050610977565b8084116132f25760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b60448201526064016109be565b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60006133b0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134309092919063ffffffff16565b90508051600014806133d15750808060200190518101906133d19190613e9d565b611ebe5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016109be565b6060611df0848460008585600080866001600160a01b031685876040516134579190613ebf565b60006040518083038185875af1925050503d8060008114613494576040519150601f19603f3d011682016040523d82523d6000602084013e613499565b606091505b50915091506134aa878383876134b5565b979650505050505050565b6060831561352457825160000361351d576001600160a01b0385163b61351d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109be565b5081611df0565b611df083838151156135395781518083602001fd5b8060405162461bcd60e51b81526004016109be9190613577565b60005b8381101561356e578181015183820152602001613556565b50506000910152565b6020815260008251806020840152613596816040850160208701613553565b601f01601f19169190910160400192915050565b6000602082840312156135bc57600080fd5b5035919050565b6001600160a01b03811681146110c057600080fd5b80356135e3816135c3565b919050565b600080604083850312156135fb57600080fd5b8235613606816135c3565b946020939093013593505050565b60008060006060848603121561362957600080fd5b8335613634816135c3565b92506020840135613644816135c3565b929592945050506040919091013590565b60006020828403121561366757600080fd5b8135610977816135c3565b6000806040838503121561368557600080fd5b823591506020830135613697816135c3565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156136e1576136e16136a2565b604052919050565b600067ffffffffffffffff821115613703576137036136a2565b50601f01601f191660200190565b600080600080600060a0868803121561372957600080fd5b8535613734816135c3565b9450602086013567ffffffffffffffff81111561375057600080fd5b8601601f8101881361376157600080fd5b803561377461376f826136e9565b6136b8565b81815289602083850101111561378957600080fd5b816020840160208301376000602083830101528096505050506137ae604087016135d8565b92506137bc606087016135d8565b91506137ca608087016135d8565b90509295509295909350565b600080600080608085870312156137ec57600080fd5b8435935060208501356137fe816135c3565b9250604085013561380e816135c3565b9396929550929360600135925050565b61ffff811681146110c057600080fd5b60006020828403121561384057600080fd5b81356109778161381e565b60008060006060848603121561386057600080fd5b833592506020840135613872816135c3565b91506040840135613882816135c3565b809150509250925092565b600080602083850312156138a057600080fd5b823567ffffffffffffffff808211156138b857600080fd5b818501915085601f8301126138cc57600080fd5b8135818111156138db57600080fd5b8660208285010111156138ed57600080fd5b60209290920196919550909350505050565b60ff811681146110c057600080fd5b600080600080600080600060e0888a03121561392957600080fd5b8735613934816135c3565b96506020880135613944816135c3565b955060408801359450606088013593506080880135613962816138ff565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561399257600080fd5b823561399d816135c3565b91506020830135613697816135c3565b600181811c908216806139c157607f821691505b6020821081036128c957634e487b7160e01b600052602260045260246000fd5b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215613a2a57600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b60008060408385031215613a5a57600080fd5b8251613a658161381e565b6020840151909250613697816135c3565b634e487b7160e01b600052601160045260246000fd5b808201808211156108cc576108cc613a76565b80820281158282048414176108cc576108cc613a76565b600082613ad357634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156108cc576108cc613a76565b6020808252600c908201526b5a45524f204144445245535360a01b604082015260600190565b600060208284031215613b2357600080fd5b815167ffffffffffffffff811115613b3a57600080fd5b8201601f81018413613b4b57600080fd5b8051613b5961376f826136e9565b818152856020838501011115613b6e57600080fd5b61248a826020830160208601613553565b61797360f01b815260008251613b9c816002850160208701613553565b9190910160020192915050565b601f821115611ebe57600081815260208120601f850160051c81016020861015613bd05750805b601f850160051c820191505b81811015613bef57828155600101613bdc565b505050505050565b815167ffffffffffffffff811115613c1157613c116136a2565b613c2581613c1f84546139ad565b84613ba9565b602080601f831160018114613c5a5760008415613c425750858301515b600019600386901b1c1916600185901b178555613bef565b600085815260208120601f198616915b82811015613c8957888601518255948401946001909101908401613c6a565b5085821015613ca75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215613cc957600080fd5b8151610977816138ff565b600181815b80851115613d0f578160001904821115613cf557613cf5613a76565b80851615613d0257918102915b93841c9390800290613cd9565b509250929050565b600082613d26575060016108cc565b81613d33575060006108cc565b8160018114613d495760028114613d5357613d6f565b60019150506108cc565b60ff841115613d6457613d64613a76565b50506001821b6108cc565b5060208310610133831016604e8410600b8410161715613d92575081810a6108cc565b613d9c8383613cd4565b8060001904821115613db057613db0613a76565b029392505050565b600061097760ff841683613d17565b67ffffffffffffffff831115613ddf57613ddf6136a2565b613df383613ded83546139ad565b83613ba9565b6000601f841160018114613e275760008515613e0f5750838201355b600019600387901b1c1916600186901b1783556126bb565b600083815260209020601f19861690835b82811015613e585786850135825560209485019460019092019101613e38565b5086821015613e755760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052602160045260246000fd5b600060208284031215613eaf57600080fd5b8151801515811461097757600080fd5b60008251613ed1818460208701613553565b919091019291505056fea264697066735822122078217b19cda59fa3b0dd000bd2e8ed5e9eb975c62f213df8a6e2f9454ec72e3764736f6c63430008120033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"metadata":{"appendCBOR":true,"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"]}},"remappings":["forge-std/=lib/forge-std/src/","@openzeppelin/=lib/openzeppelin-contracts/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/erc4626-tests/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin-contracts/contracts/"],"viaIR":false},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x770D0d1Fb036483Ed4AbB6d53c1C88fb277D812F",{"internalType":"address","name":"_factory","type":"address"}]],"compiler_version":"v0.8.18+commit.87f61d96","is_verified_via_verifier_alliance":false,"verified_at":"2024-11-01T00:44:12.935586Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a06040523480156200001157600080fd5b5060405162004030380380620040308339810160408190526200003491620000a8565b6001600160a01b03811660805260016200004d62000072565b80546001600160a01b0319166001600160a01b039290921691909117905550620000fc565b600080620000a260017fd2841a5d2692465040bd5e06a6f3b37483952c866e0f304dc0e03f76a1f8a0b1620000da565b92915050565b600060208284031215620000bb57600080fd5b81516001600160a01b0381168114620000d357600080fd5b9392505050565b81810381811115620000a257634e487b7160e01b600052601160045260246000fd5b608051613f116200011f600039600081816104dc0152610adc0152613f116000f3fe608060405234801561001057600080fd5b50600436106103d05760003560e01c806387788782116101ff578063bf86d6901161011a578063d505accf116100ad578063df69b22a1161007c578063df69b22a146107d5578063ed27f7c9146107e8578063ef8b30f714610753578063f629b790146107f057600080fd5b8063d505accf14610794578063d905777e146107a7578063d9a0e97a146107ba578063dd62ed3e146107c257600080fd5b8063c6e6f592116100e9578063c6e6f59214610753578063c8c2fe6c14610766578063ce96cb771461076e578063d43fdcf71461078157600080fd5b8063bf86d6901461071d578063c3535b5214610725578063c47f00271461072d578063c63d75b61461074057600080fd5b8063a9059cbb11610192578063b460af9411610161578063b460af94146106e6578063ba087652146106f9578063bc063e1a1461070c578063be8f16681461071557600080fd5b8063a9059cbb146106a5578063aa290e6d146106b8578063aced1661146106cb578063b3d7f6b9146106d357600080fd5b806397073ae6116101ce57806397073ae61461066457806399530b06146106775780639f40a7b31461067f578063a318c1a41461069257600080fd5b8063877887821461062657806388a8d6021461064157806394bf804d1461064957806395d89b411461065c57600080fd5b806338d52e0f116102ef5780636a5f1aa211610282578063748747e611610251578063748747e6146105da5780637ecebe00146105ed57806382e00a441461060057806385b687561461061357600080fd5b80636a5f1aa2146105995780636e553f65146105ac57806370905dce146105bf57806370a08231146105c757600080fd5b80634abe4137116102be5780634abe41371461056b5780634cdad506146104055780635141eebb1461057e5780635312ea8e1461058657600080fd5b806338d52e0f14610535578063402d267d1461053d578063440368a31461055057806348e4a6491461055857600080fd5b806323b872dd116103675780632dd31000116103365780632dd31000146104d7578063313ce567146104fe57806335da3394146105185780633644e5151461052d57600080fd5b806323b872dd1461047e57806325829410146104915780632606a10b146104b25780632d632692146104cf57600080fd5b8063095ea7b3116103a3578063095ea7b3146104205780630a28a477146104435780630b68f46f1461045657806318160ddd1461047657600080fd5b806301e1d114146103d557806306fdde03146103f057806307a2d13a146104055780630952864e14610418575b600080fd5b6103dd610803565b6040519081526020015b60405180910390f35b6103f861081c565b6040516103e79190613577565b6103dd6104133660046135aa565b6108b7565b6103dd6108d2565b61043361042e3660046135e8565b6108eb565b60405190151581526020016103e7565b6103dd6104513660046135aa565b610909565b61045e61091e565b6040516001600160a01b0390911681526020016103e7565b6103dd61093a565b61043361048c366004613614565b61094c565b6040805180820190915260058152640ccb8c0b8d60da1b60208201526103f8565b6104ba61097e565b604080519283526020830191909152016103e7565b6103dd610db1565b61045e7f000000000000000000000000000000000000000000000000000000000000000081565b610506610dcd565b60405160ff90911681526020016103e7565b61052b610526366004613655565b610de7565b005b6103dd610e46565b61045e610efe565b6103dd61054b366004613655565b610f17565b61052b610f2a565b61052b610566366004613655565b611065565b6103dd6105793660046135e8565b6110c3565b6103dd6110d6565b61052b6105943660046135aa565b6110e9565b61052b6105a7366004613655565b6111ff565b6103dd6105ba366004613672565b6112d9565b61045e61147b565b6103dd6105d5366004613655565b611497565b61052b6105e8366004613655565b6114aa565b6103dd6105fb366004613655565b61150e565b61052b61060e366004613655565b61153a565b6103dd6106213660046135e8565b6115c3565b61062e6115d6565b60405161ffff90911681526020016103e7565b61045e6115f5565b6103dd610657366004613672565b611618565b6103f8611728565b61052b610672366004613711565b6117c6565b6103dd611a50565b6103dd61068d3660046137d6565b611a88565b6103dd6106a03660046137d6565b611bbc565b6104336106b33660046135e8565b611cec565b61052b6106c636600461382e565b611d01565b61045e611da9565b6103dd6106e13660046135aa565b611dcc565b6103dd6106f436600461384b565b611de1565b6103dd61070736600461384b565b611df8565b61062e61138881565b61052b611e08565b610433611e63565b6103dd611e80565b61052b61073b36600461388d565b611e9c565b6103dd61074e366004613655565b611ec3565b6103dd6107613660046135aa565b611ed6565b61052b611eeb565b6103dd61077c366004613655565b611f9b565b61052b61078f366004613655565b611fae565b61052b6107a236600461390e565b61202c565b6103dd6107b5366004613655565b61223a565b6103dd61224d565b6103dd6107d036600461397f565b61225f565b61052b6107e33660046135aa565b61229a565b61045e612382565b61052b6107fe366004613655565b6123a5565b600061081761081061242a565b6006015490565b905090565b606061082661242a565b6001018054610834906139ad565b80601f0160208091040260200160405190810160405280929190818152602001828054610860906139ad565b80156108ad5780601f10610882576101008083540402835291602001916108ad565b820191906000526020600020905b81548152906001019060200180831161089057829003601f168201915b5050505050905090565b60006108cc6108c461242a565b836000612458565b92915050565b60006108dc61242a565b6009015463ffffffff16919050565b60006109006108f861242a565b338585612493565b50600192915050565b60006108cc61091661242a565b8360016125bb565b600061092861242a565b600b01546001600160a01b0316919050565b600061081761094761242a565b612612565b60008061095761242a565b90506109658186338661262c565b610971818686866126c2565b60019150505b9392505050565b600080600061098b61242a565b600c810154909150600119600160a01b90910460ff16016109c75760405162461bcd60e51b81526004016109be906139e1565b60405180910390fd5b600c8101805460ff60a01b1916600160a11b1790556109e533611fae565b60006109ef61242a565b90506000306001600160a01b03166349317f1d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a579190613a18565b90506000610a66836006015490565b90506000610a7384612867565b60098501549091506000908190819063ffffffff1685871115610bf4578587039a50610aa1888c60006125bb565b6009890154909250640100000000900461ffff1660008115610bb35761271061ffff83168e0204955061271061ffff831685020490506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635153b1996040518163ffffffff1660e01b81526004016040805180830381865afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190613a47565b9150915060008261ffff16600014610b8c575061271061ffff83168981028290049850840204610b8c8d83836128cf565b60098d0154610baf908e90600160301b90046001600160a01b03168387036128cf565b5050505b8215610bed57808403935083871115610bd857610bd38a30868a03612996565b610bed565b86841115610bed57610bed8a308987036128cf565b5050610c49565b868603995089600014610c3857306000908152600489016020526040812054610c35918790610c26908c908f906125bb565b610c309190613a8c565b612a6e565b94505b8415610c4957610c49883087612996565b3060009081526004890160205260409020548015610d045760088901546000906001600160601b031642811115610c8d5784830342826001600160601b0316030291505b600083610c9a8688613a9f565b610ca49085613a8c565b610cae9190613ab6565b905080610cc064e8d4a5100086613a9f565b610cca9190613ab6565b60078d0155610cd98142613a8c565b60088d0180546001600160601b0319166001600160601b039290921691909117905550610d17915050565b6008890180546001600160601b03191690555b60068901889055600a890180546001600160601b031916426001600160601b03161790557fecdd072e4d5bd913a75a37f02daedcea7e2dc0281f9942c0063cfd1cfe5c4c4f8c8c86610d69818a613ad8565b60408051948552602085019390935291830152606082015260800160405180910390a1505050600c909601805460ff60a01b1916600160a01b17905550959694955050505050565b6000610dbb61242a565b600801546001600160601b0316919050565b6000610dd761242a565b54600160a01b900460ff16919050565b610df033611065565b80610df961242a565b600c0180546001600160a01b0319166001600160a01b03928316179055604051908216907f2bf242d027263e45fab022c28b4144255c97b30b8e54c30f1f5757906d487f0990600090a250565b60408051808201825260058152640ccb8c0b8d60da1b60209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fda26655fe98828873f36b43d69dcf685bd7966c6141a47d0d8cf605a48cc4e6a818401527faa741e830036c691364b6111f364dcbe19c4c13e8962b6404784a49bef110d6460608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b6000610f0861242a565b546001600160a01b0316919050565b60006108cc610f2461242a565b83612a84565b6000610f3461242a565b600c810154909150600119600160a01b90910460ff1601610f675760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b179055610f8533611fae565b30639d7fb70c610f9361242a565b546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190613a18565b6040518263ffffffff1660e01b815260040161101b91815260200190565b600060405180830381600087803b15801561103557600080fd5b505af1158015611049573d6000803e3d6000fd5b505050600c909101805460ff60a01b1916600160a01b17905550565b61106d61242a565b600a01546001600160a01b03828116600160601b90920416146110c05760405162461bcd60e51b815260206004820152600b60248201526a085b585b9859d95b595b9d60aa1b60448201526064016109be565b50565b60006109776110d061242a565b84612b1e565b60006110e061242a565b60070154905090565b60006110f361242a565b600c810154909150600119600160a01b90910460ff16016111265760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b1790556111443361153a565b61114c61242a565b600c0154600160a81b900460ff166111955760405162461bcd60e51b815260206004820152600c60248201526b3737ba1039b43aba3237bbb760a11b60448201526064016109be565b604051631fbd027560e31b815260048101839052309063fde813a890602401600060405180830381600087803b1580156111ce57600080fd5b505af11580156111e2573d6000803e3d6000fd5b505050600c909101805460ff60a01b1916600160a01b1790555050565b61120833611065565b6001600160a01b03811661122e5760405162461bcd60e51b81526004016109be90613aeb565b306001600160a01b038216036112775760405162461bcd60e51b815260206004820152600e60248201526d21b0b73737ba1031329039b2b63360911b60448201526064016109be565b8061128061242a565b60090180546601000000000000600160d01b031916600160301b6001600160a01b0393841602179055604051908216907f9ebbf695dd251e855d9d15a146a72f5f654dc6f8630fbc11212f27e0c88ba11a90600090a250565b6000806112e461242a565b600c810154909150600119600160a01b90910460ff16016113175760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b179055600061133661242a565b905060001985036113af5780546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190613a18565b94505b6113b98185612a84565b8511156114085760405162461bcd60e51b815260206004820152601e60248201527f455243343632363a206465706f736974206d6f7265207468616e206d6178000060448201526064016109be565b611414818660006125bb565b9250826000036114545760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064016109be565b61146081858786612bbe565b50600c01805460ff60a01b1916600160a01b17905592915050565b600061148561242a565b600c01546001600160a01b0316919050565b60006108cc6114a461242a565b83612d08565b6114b333611065565b806114bc61242a565b60080180546001600160601b0316600160601b6001600160a01b0393841602179055604051908216907fd7f49e282c36d417b290d4181a56943f6d670aaa2987c0d40e60d39919c6888290600090a250565b600061151861242a565b6001600160a01b03909216600090815260039290920160205250604090205490565b600061154461242a565b600c8101549091506001600160a01b038381169116148061157b5750600a8101546001600160a01b03838116600160601b90920416145b6115bf5760405162461bcd60e51b815260206004820152601560248201527408595b595c99d95b98de48185d5d1a1bdc9a5e9959605a1b60448201526064016109be565b5050565b60006109776115d061242a565b84612d68565b60006115e061242a565b60090154640100000000900461ffff16919050565b60006115ff61242a565b600a0154600160601b90046001600160a01b0316919050565b60008061162361242a565b600c810154909150600119600160a01b90910460ff16016116565760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b179055600061167561242a565b90506116818185612e03565b8511156116d05760405162461bcd60e51b815260206004820152601b60248201527f455243343632363a206d696e74206d6f7265207468616e206d6178000000000060448201526064016109be565b6116dc81866001612458565b92508260000361171c5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b60448201526064016109be565b61146081858588612bbe565b606061173261242a565b54604080516395d89b4160e01b815290516001600160a01b03909216916395d89b41916004808201926000929091908290030181865afa15801561177a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117a29190810190613b11565b6040516020016117b29190613b7f565b604051602081830303815290604052905090565b60006117d061242a565b80549091506001600160a01b0316156118195760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064016109be565b80546001600160a01b0319166001600160a01b038716178155600181016118408682613bf7565b50856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561187f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a39190613cb7565b815460ff91909116600160a01b0260ff60a01b1990911617815560098101805463ffffffff1916620d2f001790556001600160a01b0383166118f75760405162461bcd60e51b81526004016109be90613aeb565b306001600160a01b038416036119385760405162461bcd60e51b81526004016109be9060208082526004908201526339b2b63360e11b604082015260600190565b600981018054640100000000600160d01b031916600160301b6001600160a01b038681169190910265ffff000000001916919091176503e80000000017909155600a820180546001600160601b031916426001600160601b031617905584166119b35760405162461bcd60e51b81526004016109be90613aeb565b600a810180546001600160a01b03808716600160601b9081026001600160601b03938416179093556008840180548683169094029390921692909217905560408051808201825260058152640ccb8c0b8d60da1b602082015290519188169130917ffb1616746b8474b6b7c67f2fe5ada156ed24774d0efe8bfe529cf537ba17333091611a409190613577565b60405180910390a3505050505050565b600080611a5b61242a565b8054909150611a82908290611a7b90600160a01b900460ff16600a613db8565b6000612458565b91505090565b600080611a9361242a565b600c810154909150600119600160a01b90910460ff1601611ac65760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b1790556000611ae561242a565b9050611af18186612b1e565b871115611b405760405162461bcd60e51b815260206004820152601d60248201527f455243343632363a2072656465656d206d6f7265207468616e206d617800000060448201526064016109be565b6000611b4e82896000612458565b905080600003611b8e5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b60448201526064016109be565b611b9c828888848c8a612eb4565b93505050600c01805460ff60a01b1916600160a01b179055949350505050565b600080611bc761242a565b600c810154909150600119600160a01b90910460ff1601611bfa5760405162461bcd60e51b81526004016109be906139e1565b600c8101805460ff60a01b1916600160a11b1790556000611c1961242a565b9050611c258186612d68565b871115611c745760405162461bcd60e51b815260206004820152601f60248201527f455243343632363a207769746864726177206d6f7265207468616e206d61780060448201526064016109be565b611c80818860016125bb565b925082600003611cc05760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064016109be565b611cce8187878a8789612eb4565b5050600c01805460ff60a01b1916600160a01b179055949350505050565b6000610900611cf961242a565b3385856126c2565b611d0a33611065565b61138861ffff82161115611d4a5760405162461bcd60e51b81526020600482015260076024820152664d41582046454560c81b60448201526064016109be565b80611d5361242a565b600901805465ffff00000000191664010000000061ffff9384160217905560405190821681527fdc843735e683348ec21c302ffff45462399c5c46f75f67b0a1a5395c535997539060200160405180910390a150565b6000611db361242a565b60080154600160601b90046001600160a01b0316919050565b60006108cc611dd961242a565b836001612458565b6000611df08484846000611bbc565b949350505050565b6000611df0848484612710611a88565b611e113361153a565b6001611e1b61242a565b600c018054911515600160a81b0260ff60a81b199092169190911790556040517ffc1249757a7f27c510c8173c55d03ba442e0d33d9223e06ceb416feac8c7693f90600090a1565b6000611e6d61242a565b600c0154600160a81b900460ff16919050565b6000611e8a61242a565b600a01546001600160601b0316919050565b611ea533611065565b8181611eaf61242a565b60010191611ebe919083613dc7565b505050565b60006108cc611ed061242a565b83612e03565b60006108cc611ee361242a565b8360006125bb565b6000611ef561242a565b600b8101549091506001600160a01b03163314611f3f5760405162461bcd60e51b81526020600482015260086024820152672170656e64696e6760c01b60448201526064016109be565b600a810180546001600160601b031633600160601b810291909117909155600b820180546001600160a01b03191690556040517fff54978127edd34aec0f9061fb3b155fbe0ededdfa881ee3e0d541d3a1eef43890600090a250565b60006108cc611fa861242a565b83612d68565b6000611fb861242a565b60088101549091506001600160a01b03838116600160601b909204161480611ff65750600a8101546001600160a01b03838116600160601b90920416145b6115bf5760405162461bcd60e51b815260206004820152600760248201526610b5b2b2b832b960c91b60448201526064016109be565b4284101561207c5760405162461bcd60e51b815260206004820152601e60248201527f45524332303a205045524d49545f444541444c494e455f45585049524544000060448201526064016109be565b60006001612088610e46565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98a8a8a6120b461242a565b6001600160a01b038f8116600090815260039290920160209081526040928390208054600181019091558351808301989098529582168784015293166060860152608085019190915260a084019290925260c08084018b90528251808503909101815260e08401909252815191012061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156121a3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906121d95750876001600160a01b0316816001600160a01b0316145b61221d5760405162461bcd60e51b815260206004820152601560248201527422a92199181d1024a72b20a624a22fa9a4a3a722a960591b60448201526064016109be565b61223061222861242a565b828989612493565b5050505050505050565b60006108cc61224761242a565b83612b1e565b600061081761225a61242a565b612867565b600061097761226c61242a565b6001600160a01b03808616600090815260059290920160209081526040808420928716845291905290205490565b6122a333611065565b6301e185588111156122e25760405162461bcd60e51b8152602060048201526008602482015267746f6f206c6f6e6760c01b60448201526064016109be565b60006122ec61242a565b90508160000361233457306000908152600482016020526040902054801561231957612319823083612996565b50600060078201556008810180546001600160601b03191690555b60098101805463ffffffff191663ffffffff84161790556040518281527ff361aed463da6fa20358e45c6209f1d3e16d4eca706e6eab0b0aeb338729c77a9060200160405180910390a15050565b600061238c61242a565b60090154600160301b90046001600160a01b0316919050565b6123ae33611065565b6001600160a01b0381166123d45760405162461bcd60e51b81526004016109be90613aeb565b806123dd61242a565b600b0180546001600160a01b0319166001600160a01b03928316179055604051908216907fd74668a8c80a07cc56d7c3318a06439eaa815e740d97dcd83487e1fc75076b8b90600090a250565b6000806108cc60017fd2841a5d2692465040bd5e06a6f3b37483952c866e0f304dc0e03f76a1f8a0b1613ad8565b60008061246485612612565b905080156124885761248361247a866006015490565b8590838661317f565b61248a565b835b95945050505050565b6001600160a01b0383166124f55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016109be565b6001600160a01b0382166125565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016109be565b6001600160a01b03838116600081815260058701602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a350505050565b6000806125c785612612565b9050806000036125da5783915050610977565b60006125e7866006015490565b9050806000036125fc57600092505050610977565b6126088583838761317f565b9695505050505050565b600061261d82612867565b82600201546108cc9190613ad8565b6001600160a01b03838116600090815260058601602090815260408083209386168352929052205460001981146126bb57818110156126ad5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016109be565b6126bb858585858503612493565b5050505050565b6001600160a01b0383166127265760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016109be565b6001600160a01b0382166127885760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016109be565b306001600160a01b038316036127e05760405162461bcd60e51b815260206004820152601a60248201527f4552433230207472616e7366657220746f20737472617465677900000000000060448201526064016109be565b6001600160a01b03831660009081526004850160205260408120805483929061280a908490613ad8565b90915550506001600160a01b038083166000818152600487016020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906125ad9085815260200190565b60088101546000906001600160601b0316428111156128a557600a830154600784015464e8d4a51000916001600160601b03164203020491506128c9565b6001600160601b038116156128c95730600090815260048401602052604090205491505b50919050565b6001600160a01b0382166129255760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016109be565b808360020160008282546129399190613a8c565b90915550506001600160a01b03821660008181526004850160209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91015b60405180910390a3505050565b6001600160a01b0382166129f65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016109be565b6001600160a01b038216600090815260048401602052604081208054839290612a20908490613ad8565b909155505060028301805482900390556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612989565b6000818310612a7d5781610977565b5090919050565b600c820154600090600160a81b900460ff1680612aa957506001600160a01b03821630145b15612ab6575060006108cc565b604051632355178960e11b81526001600160a01b038316600482015230906346aa2f1290602401602060405180830381865afa158015612afa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109779190613a18565b6040516304bd462960e01b81526001600160a01b038216600482015260009030906304bd462990602401602060405180830381865afa158015612b65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b899190613a18565b90506000198103612ba557612b9e8383612d08565b90506108cc565b610977612bb4848360006125bb565b610c308585612d08565b83546001600160a01b0316612bd5813330866131d0565b6040516370a0823160e01b815230600482018190529063503160d9906001600160a01b038416906370a0823190602401602060405180830381865afa158015612c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c469190613a18565b6040518263ffffffff1660e01b8152600401612c6491815260200190565b600060405180830381600087803b158015612c7e57600080fd5b505af1158015612c92573d6000803e3d6000fd5b5050505082856006016000828254612caa9190613a8c565b90915550612cbb90508585846128cf565b60408051848152602081018490526001600160a01b0386169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a35050505050565b6000306001600160a01b03831603612d4857612d2383612867565b6001600160a01b0383166000908152600485016020526040902054612b9e9190613ad8565b506001600160a01b03166000908152600491909101602052604090205490565b6040516304bd462960e01b81526001600160a01b038216600482015260009030906304bd462990602401602060405180830381865afa158015612daf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd39190613a18565b90506000198103612dec57612b9e83611a7b8585612d08565b610977612dfd84611a7b8686612d08565b82612a6e565b600c820154600090600160a81b900460ff1680612e2857506001600160a01b03821630145b15612e35575060006108cc565b604051632355178960e11b81526001600160a01b038316600482015230906346aa2f1290602401602060405180830381865afa158015612e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9d9190613a18565b905060001981146108cc57610977838260006125bb565b60006001600160a01b038616612edc5760405162461bcd60e51b81526004016109be90613aeb565b612710821115612f205760405162461bcd60e51b815260206004820152600f60248201526e65786365656473204d41585f42505360881b60448201526064016109be565b336001600160a01b03861614612f3c57612f3c8786338661262c565b86546040516370a0823160e01b81523060048201526001600160a01b039091169060009082906370a0823190602401602060405180830381865afa158015612f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fac9190613a18565b90506000868210156130e457604051633d6cb57560e01b815282880360048201523090633d6cb57590602401600060405180830381600087803b158015612ff257600080fd5b505af1158015613006573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526001600160a01b03861692506370a082319150602401602060405180830381865afa15801561304e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130729190613a18565b9150868210156130e457508086036127108510156130e0576127106130978689613a9f565b6130a19190613ab6565b8111156130e05760405162461bcd60e51b815260206004820152600d60248201526c746f6f206d756368206c6f737360981b60448201526064016109be565b8196505b6130ee8188613a8c565b8a60060160008282546131019190613ad8565b9091555061311290508a8988612996565b6131266001600160a01b0384168a89613241565b60408051888152602081018890526001600160a01b03808b1692908c169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a4509498975050505050505050565b60008061318d868686613271565b905060018360028111156131a3576131a3613e87565b1480156131c05750600084806131bb576131bb613a31565b868809115b1561248a57612608600182613a8c565b6040516001600160a01b038085166024830152831660448201526064810182905261323b9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261335b565b50505050565b6040516001600160a01b038316602482015260448101829052611ebe90849063a9059cbb60e01b90606401613204565b60008080600019858709858702925082811083820303915050806000036132ab578382816132a1576132a1613a31565b0492505050610977565b8084116132f25760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b60448201526064016109be565b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60006133b0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134309092919063ffffffff16565b90508051600014806133d15750808060200190518101906133d19190613e9d565b611ebe5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016109be565b6060611df0848460008585600080866001600160a01b031685876040516134579190613ebf565b60006040518083038185875af1925050503d8060008114613494576040519150601f19603f3d011682016040523d82523d6000602084013e613499565b606091505b50915091506134aa878383876134b5565b979650505050505050565b6060831561352457825160000361351d576001600160a01b0385163b61351d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109be565b5081611df0565b611df083838151156135395781518083602001fd5b8060405162461bcd60e51b81526004016109be9190613577565b60005b8381101561356e578181015183820152602001613556565b50506000910152565b6020815260008251806020840152613596816040850160208701613553565b601f01601f19169190910160400192915050565b6000602082840312156135bc57600080fd5b5035919050565b6001600160a01b03811681146110c057600080fd5b80356135e3816135c3565b919050565b600080604083850312156135fb57600080fd5b8235613606816135c3565b946020939093013593505050565b60008060006060848603121561362957600080fd5b8335613634816135c3565b92506020840135613644816135c3565b929592945050506040919091013590565b60006020828403121561366757600080fd5b8135610977816135c3565b6000806040838503121561368557600080fd5b823591506020830135613697816135c3565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156136e1576136e16136a2565b604052919050565b600067ffffffffffffffff821115613703576137036136a2565b50601f01601f191660200190565b600080600080600060a0868803121561372957600080fd5b8535613734816135c3565b9450602086013567ffffffffffffffff81111561375057600080fd5b8601601f8101881361376157600080fd5b803561377461376f826136e9565b6136b8565b81815289602083850101111561378957600080fd5b816020840160208301376000602083830101528096505050506137ae604087016135d8565b92506137bc606087016135d8565b91506137ca608087016135d8565b90509295509295909350565b600080600080608085870312156137ec57600080fd5b8435935060208501356137fe816135c3565b9250604085013561380e816135c3565b9396929550929360600135925050565b61ffff811681146110c057600080fd5b60006020828403121561384057600080fd5b81356109778161381e565b60008060006060848603121561386057600080fd5b833592506020840135613872816135c3565b91506040840135613882816135c3565b809150509250925092565b600080602083850312156138a057600080fd5b823567ffffffffffffffff808211156138b857600080fd5b818501915085601f8301126138cc57600080fd5b8135818111156138db57600080fd5b8660208285010111156138ed57600080fd5b60209290920196919550909350505050565b60ff811681146110c057600080fd5b600080600080600080600060e0888a03121561392957600080fd5b8735613934816135c3565b96506020880135613944816135c3565b955060408801359450606088013593506080880135613962816138ff565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561399257600080fd5b823561399d816135c3565b91506020830135613697816135c3565b600181811c908216806139c157607f821691505b6020821081036128c957634e487b7160e01b600052602260045260246000fd5b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215613a2a57600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b60008060408385031215613a5a57600080fd5b8251613a658161381e565b6020840151909250613697816135c3565b634e487b7160e01b600052601160045260246000fd5b808201808211156108cc576108cc613a76565b80820281158282048414176108cc576108cc613a76565b600082613ad357634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156108cc576108cc613a76565b6020808252600c908201526b5a45524f204144445245535360a01b604082015260600190565b600060208284031215613b2357600080fd5b815167ffffffffffffffff811115613b3a57600080fd5b8201601f81018413613b4b57600080fd5b8051613b5961376f826136e9565b818152856020838501011115613b6e57600080fd5b61248a826020830160208601613553565b61797360f01b815260008251613b9c816002850160208701613553565b9190910160020192915050565b601f821115611ebe57600081815260208120601f850160051c81016020861015613bd05750805b601f850160051c820191505b81811015613bef57828155600101613bdc565b505050505050565b815167ffffffffffffffff811115613c1157613c116136a2565b613c2581613c1f84546139ad565b84613ba9565b602080601f831160018114613c5a5760008415613c425750858301515b600019600386901b1c1916600185901b178555613bef565b600085815260208120601f198616915b82811015613c8957888601518255948401946001909101908401613c6a565b5085821015613ca75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215613cc957600080fd5b8151610977816138ff565b600181815b80851115613d0f578160001904821115613cf557613cf5613a76565b80851615613d0257918102915b93841c9390800290613cd9565b509250929050565b600082613d26575060016108cc565b81613d33575060006108cc565b8160018114613d495760028114613d5357613d6f565b60019150506108cc565b60ff841115613d6457613d64613a76565b50506001821b6108cc565b5060208310610133831016604e8410600b8410161715613d92575081810a6108cc565b613d9c8383613cd4565b8060001904821115613db057613db0613a76565b029392505050565b600061097760ff841683613d17565b67ffffffffffffffff831115613ddf57613ddf6136a2565b613df383613ded83546139ad565b83613ba9565b6000601f841160018114613e275760008515613e0f5750838201355b600019600387901b1c1916600186901b1783556126bb565b600083815260209020601f19861690835b82811015613e585786850135825560209485019460019092019101613e38565b5086821015613e755760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052602160045260246000fd5b600060208284031215613eaf57600080fd5b8151801515811461097757600080fd5b60008251613ed1818460208701613553565b919091019291505056fea264697066735822122078217b19cda59fa3b0dd000bd2e8ed5e9eb975c62f213df8a6e2f9454ec72e3764736f6c63430008120033000000000000000000000000770d0d1fb036483ed4abb6d53c1c88fb277d812f","name":"TokenizedStrategy","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n    mapping(address => uint256) private _balances;\n\n    mapping(address => mapping(address => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual override returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual override returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual override returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual override returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `amount`.\n     */\n    function transfer(address to, uint256 amount) public virtual override returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `amount`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `amount`.\n     */\n    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, amount);\n        _transfer(from, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, allowance(owner, spender) + addedValue);\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n        address owner = _msgSender();\n        uint256 currentAllowance = allowance(owner, spender);\n        require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n        unchecked {\n            _approve(owner, spender, currentAllowance - subtractedValue);\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Moves `amount` of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `from` must have a balance of at least `amount`.\n     */\n    function _transfer(address from, address to, uint256 amount) internal virtual {\n        require(from != address(0), \"ERC20: transfer from the zero address\");\n        require(to != address(0), \"ERC20: transfer to the zero address\");\n\n        _beforeTokenTransfer(from, to, amount);\n\n        uint256 fromBalance = _balances[from];\n        require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n        unchecked {\n            _balances[from] = fromBalance - amount;\n            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n            // decrementing then incrementing.\n            _balances[to] += amount;\n        }\n\n        emit Transfer(from, to, amount);\n\n        _afterTokenTransfer(from, to, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function _mint(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        _beforeTokenTransfer(address(0), account, amount);\n\n        _totalSupply += amount;\n        unchecked {\n            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n            _balances[account] += amount;\n        }\n        emit Transfer(address(0), account, amount);\n\n        _afterTokenTransfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        _beforeTokenTransfer(account, address(0), amount);\n\n        uint256 accountBalance = _balances[account];\n        require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n        unchecked {\n            _balances[account] = accountBalance - amount;\n            // Overflow not possible: amount <= accountBalance <= totalSupply.\n            _totalSupply -= amount;\n        }\n\n        emit Transfer(account, address(0), amount);\n\n        _afterTokenTransfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     */\n    function _approve(address owner, address spender, uint256 amount) internal virtual {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n     *\n     * Does not update the allowance amount in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Might emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n            unchecked {\n                _approve(owner, spender, currentAllowance - amount);\n            }\n        }\n    }\n\n    /**\n     * @dev Hook that is called before any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * will be transferred to `to`.\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n    /**\n     * @dev Hook that is called after any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * has been transferred to `to`.\n     * - when `from` is zero, `amount` tokens have been minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20Permit token,\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal {\n        uint256 nonceBefore = token.nonces(owner);\n        token.permit(owner, spender, value, deadline, v, r, s);\n        uint256 nonceAfter = token.nonces(owner);\n        require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"},{"file_path":"src/interfaces/IBaseStrategy.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0\npragma solidity >=0.8.18;\n\ninterface IBaseStrategy {\n    function tokenizedStrategyAddress() external view returns (address);\n\n    /*//////////////////////////////////////////////////////////////\n                            IMMUTABLE FUNCTIONS\n    //////////////////////////////////////////////////////////////*/\n\n    function availableDepositLimit(\n        address _owner\n    ) external view returns (uint256);\n\n    function availableWithdrawLimit(\n        address _owner\n    ) external view returns (uint256);\n\n    function deployFunds(uint256 _assets) external;\n\n    function freeFunds(uint256 _amount) external;\n\n    function harvestAndReport() external returns (uint256);\n\n    function tendThis(uint256 _totalIdle) external;\n\n    function shutdownWithdraw(uint256 _amount) external;\n\n    function tendTrigger() external view returns (bool, bytes memory);\n}\n"},{"file_path":"src/interfaces/IFactory.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0\npragma solidity >=0.8.18;\n\ninterface IFactory {\n    function protocol_fee_config() external view returns (uint16, address);\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategy","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"string","name":"apiVersion","type":"string"}],"name":"NewTokenizedStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"profit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loss","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFees","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"performanceFees","type":"uint256"}],"name":"Reported","type":"event"},{"anonymous":false,"inputs":[],"name":"StrategyShutdown","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":true,"internalType":"address","name":"newEmergencyAdmin","type":"address"}],"name":"UpdateEmergencyAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newKeeper","type":"address"}],"name":"UpdateKeeper","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newManagement","type":"address"}],"name":"UpdateManagement","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newPendingManagement","type":"address"}],"name":"UpdatePendingManagement","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"newPerformanceFee","type":"uint16"}],"name":"UpdatePerformanceFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newPerformanceFeeRecipient","type":"address"}],"name":"UpdatePerformanceFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newProfitMaxUnlockTime","type":"uint256"}],"name":"UpdateProfitMaxUnlockTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptManagement","outputs":[],"stateMutability":"nonpayable","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":[],"name":"apiVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fullProfitUnlockDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_management","type":"address"},{"internalType":"address","name":"_performanceFeeRecipient","type":"address"},{"internalType":"address","name":"_keeper","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isShutdown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastReport","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"management","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","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":[],"name":"pendingManagement","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"profitMaxUnlockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"profitUnlockingRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"maxLoss","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"report","outputs":[{"internalType":"uint256","name":"profit","type":"uint256"},{"internalType":"uint256","name":"loss","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"requireEmergencyAuthorized","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"requireKeeperOrManagement","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"requireManagement","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_emergencyAdmin","type":"address"}],"name":"setEmergencyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"setKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"setName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_management","type":"address"}],"name":"setPendingManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_performanceFee","type":"uint16"}],"name":"setPerformanceFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_performanceFeeRecipient","type":"address"}],"name":"setPerformanceFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_profitMaxUnlockTime","type":"uint256"}],"name":"setProfitMaxUnlockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shutdownStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"unlockedShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"maxLoss","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":"000000000000000000000000770d0d1fb036483ed4abb6d53c1c88fb277d812f"}