creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/release/infrastructure/gas-relayer/GasRelayPaymasterLib.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity 0.6.12;\npragma experimental ABIEncoderV2;\n\nimport {SafeMath} from \"openzeppelin-solc-0.6/math/SafeMath.sol\";\nimport {Address} from \"openzeppelin-solc-0.6/utils/Address.sol\";\nimport {IGsnPaymaster} from \"../../../external-interfaces/IGsnPaymaster.sol\";\nimport {IGsnRelayHub} from \"../../../external-interfaces/IGsnRelayHub.sol\";\nimport {IGsnTypes} from \"../../../external-interfaces/IGsnTypes.sol\";\nimport {IWETH} from \"../../../external-interfaces/IWETH.sol\";\nimport {IComptroller} from \"../../core/fund/comptroller/IComptroller.sol\";\nimport {IVault} from \"../../core/fund/vault/IVault.sol\";\nimport {IFundDeployer} from \"../../core/fund-deployer/IFundDeployer.sol\";\nimport {IPolicyManager} from \"../../extensions/policy-manager/IPolicyManager.sol\";\nimport {GasRelayPaymasterLibBase2} from \"./bases/GasRelayPaymasterLibBase2.sol\";\nimport {IGasRelayPaymaster} from \"./IGasRelayPaymaster.sol\";\nimport {IGasRelayPaymasterDepositor} from \"./IGasRelayPaymasterDepositor.sol\";\n\n/// @title GasRelayPaymasterLib Contract\n/// @author Enzyme Council <security@enzyme.finance>\n/// @notice The core logic library for the \"paymaster\" contract which refunds GSN relayers\n/// @dev Allows any permissioned user of the fund to relay any call,\n/// without validation of the target of the call itself.\n/// Funds with untrusted permissioned users should monitor for abuse (i.e., relaying personal calls).\n/// The extent of abuse is throttled by `DEPOSIT_COOLDOWN` and `DEPOSIT_MAX_TOTAL`.\ncontract GasRelayPaymasterLib is IGasRelayPaymaster, GasRelayPaymasterLibBase2 {\n    using SafeMath for uint256;\n\n    event AdditionalRelayUserAdded(address indexed account);\n\n    event AdditionalRelayUserRemoved(address indexed account);\n\n    // Immutable and constants\n    // Sane defaults, subject to change after gas profiling\n    uint256 private constant CALLDATA_SIZE_LIMIT = 10500;\n    // Sane defaults, subject to change after gas profiling\n    uint256 private constant PRE_RELAYED_CALL_GAS_LIMIT = 100000;\n    uint256 private constant POST_RELAYED_CALL_GAS_LIMIT = 110000;\n    // FORWARDER_HUB_OVERHEAD = 50000;\n    // PAYMASTER_ACCEPTANCE_BUDGET = FORWARDER_HUB_OVERHEAD + PRE_RELAYED_CALL_GAS_LIMIT\n    uint256 private constant PAYMASTER_ACCEPTANCE_BUDGET = 150000;\n\n    uint256 private immutable DEPOSIT_COOLDOWN; // in seconds\n    uint256 private immutable DEPOSIT_MAX_TOTAL; // in wei\n    uint256 private immutable RELAY_FEE_MAX_BASE;\n    uint256 private immutable RELAY_FEE_MAX_PERCENT; // e.g., `10` is 10%\n    address private immutable RELAY_HUB;\n    address private immutable TRUSTED_FORWARDER;\n    address private immutable WETH_TOKEN;\n\n    mapping(address => bool) private accountToIsAdditionalRelayUser;\n\n    modifier onlyComptroller() {\n        require(msg.sender == getParentComptroller(), \"Can only be called by the parent comptroller\");\n        _;\n    }\n\n    modifier onlyFundOwner() {\n        require(__msgSender() == IVault(getParentVault()).getOwner(), \"Only the fund owner can call this function\");\n        _;\n    }\n\n    modifier relayHubOnly() {\n        require(msg.sender == getHubAddr(), \"Can only be called by RelayHub\");\n        _;\n    }\n\n    constructor(\n        address _wethToken,\n        address _relayHub,\n        address _trustedForwarder,\n        uint256 _depositCooldown,\n        uint256 _depositMaxTotal,\n        uint256 _relayFeeMaxBase,\n        uint256 _relayFeeMaxPercent\n    ) public {\n        DEPOSIT_COOLDOWN = _depositCooldown;\n        DEPOSIT_MAX_TOTAL = _depositMaxTotal;\n        RELAY_FEE_MAX_BASE = _relayFeeMaxBase;\n        RELAY_FEE_MAX_PERCENT = _relayFeeMaxPercent;\n        RELAY_HUB = _relayHub;\n        TRUSTED_FORWARDER = _trustedForwarder;\n        WETH_TOKEN = _wethToken;\n    }\n\n    // INIT\n\n    /// @notice Initializes a paymaster proxy\n    /// @param _vault The VaultProxy associated with the paymaster proxy\n    /// @dev Used to set the owning vault\n    function init(address _vault) external override {\n        require(getParentVault() == address(0), \"init: Paymaster already initialized\");\n\n        parentVault = _vault;\n    }\n\n    // EXTERNAL FUNCTIONS\n\n    /// @notice Pull deposit from the vault and reactivate relaying\n    function deposit() external override onlyComptroller {\n        __depositMax();\n    }\n\n    /// @notice Checks whether the paymaster will pay for a given relayed tx\n    /// @param _relayRequest The full relay request structure\n    /// @return context_ The tx signer and the fn sig, encoded so that it can be passed to `postRelayCall`\n    /// @return rejectOnRecipientRevert_ Always false\n    function preRelayedCall(IGsnTypes.RelayRequest calldata _relayRequest, bytes calldata, bytes calldata, uint256)\n        external\n        override\n        relayHubOnly\n        returns (bytes memory context_, bool rejectOnRecipientRevert_)\n    {\n        require(_relayRequest.relayData.forwarder == TRUSTED_FORWARDER, \"preRelayedCall: Unauthorized forwarder\");\n        require(_relayRequest.relayData.baseRelayFee <= RELAY_FEE_MAX_BASE, \"preRelayedCall: High baseRelayFee\");\n        require(_relayRequest.relayData.pctRelayFee <= RELAY_FEE_MAX_PERCENT, \"preRelayedCall: High pctRelayFee\");\n\n        // No Enzyme txs require msg.value\n        require(_relayRequest.request.value == 0, \"preRelayedCall: Non-zero value\");\n\n        // Allow any transaction, as long as it's from a permissioned account for the fund\n        address vaultProxy = getParentVault();\n        require(\n            IVault(vaultProxy).canRelayCalls(_relayRequest.request.from)\n                || isAdditionalRelayUser(_relayRequest.request.from),\n            \"preRelayedCall: Unauthorized caller\"\n        );\n\n        bytes4 selector = __parseTxDataFunctionSelector(_relayRequest.request.data);\n\n        return (abi.encode(_relayRequest.request.from, selector), false);\n    }\n\n    /// @notice Called by the relay hub after the relayed tx is executed, tops up deposit if flag passed through paymasterdata is true\n    /// @param _context The context constructed by preRelayedCall (used to pass data from pre to post relayed call)\n    /// @param _success Whether or not the relayed tx succeed\n    /// @param _relayData The relay params of the request. can be used by relayHub.calculateCharge()\n    function postRelayedCall(bytes calldata _context, bool _success, uint256, IGsnTypes.RelayData calldata _relayData)\n        external\n        override\n        relayHubOnly\n    {\n        bool shouldTopUpDeposit = abi.decode(_relayData.paymasterData, (bool));\n        if (shouldTopUpDeposit) {\n            __depositMax();\n        }\n\n        (address spender, bytes4 selector) = abi.decode(_context, (address, bytes4));\n        emit TransactionRelayed(spender, selector, _success);\n    }\n\n    /// @notice Send any deposited ETH back to the vault\n    function withdrawBalance() external override {\n        address vaultProxy = getParentVault();\n        address canonicalSender = __msgSender();\n        require(\n            canonicalSender == IVault(vaultProxy).getOwner() || canonicalSender == __getComptrollerForVault(vaultProxy),\n            \"withdrawBalance: Only owner or comptroller is authorized\"\n        );\n\n        IGsnRelayHub(getHubAddr()).withdraw(getRelayHubDeposit(), payable(address(this)));\n\n        uint256 amount = address(this).balance;\n\n        Address.sendValue(payable(vaultProxy), amount);\n\n        emit Withdrawn(amount);\n    }\n\n    // PUBLIC FUNCTIONS\n\n    /// @notice Gets the current ComptrollerProxy of the VaultProxy associated with this contract\n    /// @return parentComptroller_ The ComptrollerProxy\n    function getParentComptroller() public view override returns (address parentComptroller_) {\n        return __getComptrollerForVault(parentVault);\n    }\n\n    // PRIVATE FUNCTIONS\n\n    /// @dev Helper to pull WETH from the associated vault to top up to the max ETH deposit in the relay hub\n    function __depositMax() private {\n        // Only allow one deposit every DEPOSIT_COOLDOWN seconds\n        if (block.timestamp - getLastDepositTimestamp() < DEPOSIT_COOLDOWN) {\n            return;\n        }\n\n        // Cap the total deposit to DEPOSIT_MAX_TOTAL wei\n        uint256 prevDeposit = getRelayHubDeposit();\n        if (prevDeposit >= DEPOSIT_MAX_TOTAL) {\n            return;\n        }\n        uint256 amount = DEPOSIT_MAX_TOTAL.sub(prevDeposit);\n\n        IGasRelayPaymasterDepositor(getParentComptroller()).pullWethForGasRelayer(amount);\n\n        IWETH(getWethToken()).withdraw(amount);\n\n        IGsnRelayHub(getHubAddr()).depositFor{value: amount}(address(this));\n\n        lastDepositTimestamp = block.timestamp;\n\n        emit Deposited(amount);\n    }\n\n    /// @dev Helper to get the ComptrollerProxy for a given VaultProxy\n    function __getComptrollerForVault(address _vaultProxy) private view returns (address comptrollerProxy_) {\n        return IVault(_vaultProxy).getAccessor();\n    }\n\n    /// @dev Helper to parse the canonical msg sender from trusted forwarder relayed calls\n    /// See https://github.com/opengsn/gsn/blob/da4222b76e3ae1968608dc5c5d80074dcac7c4be/packages/contracts/src/ERC2771Recipient.sol#L41-L53\n    function __msgSender() internal view returns (address canonicalSender_) {\n        if (msg.data.length >= 20 && msg.sender == TRUSTED_FORWARDER) {\n            assembly {\n                canonicalSender_ := shr(96, calldataload(sub(calldatasize(), 20)))\n            }\n\n            return canonicalSender_;\n        }\n\n        return msg.sender;\n    }\n\n    /// @notice Parses the function selector from tx data\n    /// @param _txData The tx data\n    /// @return functionSelector_ The extracted function selector\n    function __parseTxDataFunctionSelector(bytes calldata _txData) private pure returns (bytes4 functionSelector_) {\n        /// convert bytes[:4] to bytes4\n        require(_txData.length >= 4, \"__parseTxDataFunctionSelector: _txData is not a valid length\");\n\n        functionSelector_ =\n            _txData[0] | (bytes4(_txData[1]) >> 8) | (bytes4(_txData[2]) >> 16) | (bytes4(_txData[3]) >> 24);\n\n        return functionSelector_;\n    }\n\n    //////////////////////////////////////\n    // REGISTRY: ADDITIONAL RELAY USERS //\n    //////////////////////////////////////\n\n    /// @notice Adds additional relay users\n    /// @param _usersToAdd The users to add\n    function addAdditionalRelayUsers(address[] calldata _usersToAdd) external override onlyFundOwner {\n        for (uint256 i; i < _usersToAdd.length; i++) {\n            address user = _usersToAdd[i];\n            require(!isAdditionalRelayUser(user), \"addAdditionalRelayUsers: User registered\");\n\n            accountToIsAdditionalRelayUser[user] = true;\n\n            emit AdditionalRelayUserAdded(user);\n        }\n    }\n\n    /// @notice Removes additional relay users\n    /// @param _usersToRemove The users to remove\n    function removeAdditionalRelayUsers(address[] calldata _usersToRemove) external override onlyFundOwner {\n        for (uint256 i; i < _usersToRemove.length; i++) {\n            address user = _usersToRemove[i];\n            require(isAdditionalRelayUser(user), \"removeAdditionalRelayUsers: User not registered\");\n\n            accountToIsAdditionalRelayUser[user] = false;\n\n            emit AdditionalRelayUserRemoved(user);\n        }\n    }\n\n    ///////////////////\n    // STATE GETTERS //\n    ///////////////////\n\n    /// @notice Gets gas limits used by the relay hub for the pre and post relay calls\n    /// @return limits_ `GasAndDataLimits(PAYMASTER_ACCEPTANCE_BUDGET, PRE_RELAYED_CALL_GAS_LIMIT, POST_RELAYED_CALL_GAS_LIMIT, CALLDATA_SIZE_LIMIT)`\n    function getGasAndDataLimits() external view override returns (IGsnPaymaster.GasAndDataLimits memory limits_) {\n        return IGsnPaymaster.GasAndDataLimits(\n            PAYMASTER_ACCEPTANCE_BUDGET, PRE_RELAYED_CALL_GAS_LIMIT, POST_RELAYED_CALL_GAS_LIMIT, CALLDATA_SIZE_LIMIT\n        );\n    }\n\n    /// @notice Gets the `RELAY_HUB` variable value\n    /// @return relayHub_ The `RELAY_HUB` value\n    function getHubAddr() public view override returns (address relayHub_) {\n        return RELAY_HUB;\n    }\n\n    /// @notice Gets the timestamp at last deposit into the relayer\n    /// @return lastDepositTimestamp_ The timestamp\n    function getLastDepositTimestamp() public view override returns (uint256 lastDepositTimestamp_) {\n        return lastDepositTimestamp;\n    }\n\n    /// @notice Gets the `parentVault` variable value\n    /// @return parentVault_ The `parentVault` value\n    function getParentVault() public view override returns (address parentVault_) {\n        return parentVault;\n    }\n\n    /// @notice Look up amount of ETH deposited on the relay hub\n    /// @return depositBalance_ amount of ETH deposited on the relay hub\n    function getRelayHubDeposit() public view override returns (uint256 depositBalance_) {\n        return IGsnRelayHub(getHubAddr()).balanceOf(address(this));\n    }\n\n    /// @notice Gets the `WETH_TOKEN` variable value\n    /// @return wethToken_ The `WETH_TOKEN` value\n    function getWethToken() public view override returns (address wethToken_) {\n        return WETH_TOKEN;\n    }\n\n    /// @notice Checks whether an account is an approved additional relayer user\n    /// @return isAdditionalRelayUser_ True if the account is an additional relayer user\n    function isAdditionalRelayUser(address _who) public view override returns (bool isAdditionalRelayUser_) {\n        return accountToIsAdditionalRelayUser[_who];\n    }\n\n    /// @notice Gets the `TRUSTED_FORWARDER` variable value\n    /// @return trustedForwarder_ The forwarder contract which is trusted to validated the relayed tx signature\n    function trustedForwarder() external view override returns (address trustedForwarder_) {\n        return TRUSTED_FORWARDER;\n    }\n\n    /// @notice Gets the string representation of the contract version (fulfills interface)\n    /// @return versionString_ The version string\n    function versionPaymaster() external view override returns (string memory versionString_) {\n        return \"2.2.3+opengsn.enzymefund.ipaymaster\";\n    }\n}\n"
      },
      "lib/openzeppelin-solc-0.6/contracts/math/SafeMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        uint256 c = a + b;\n        if (c < a) return (false, 0);\n        return (true, c);\n    }\n\n    /**\n     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b > a) return (false, 0);\n        return (true, a - b);\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n        // benefit is lost if 'b' is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n        if (a == 0) return (true, 0);\n        uint256 c = a * b;\n        if (c / a != b) return (false, 0);\n        return (true, c);\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b == 0) return (false, 0);\n        return (true, a / b);\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b == 0) return (false, 0);\n        return (true, a % b);\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b <= a, \"SafeMath: subtraction overflow\");\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (a == 0) return 0;\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b > 0, \"SafeMath: division by zero\");\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b > 0, \"SafeMath: modulo by zero\");\n        return a % b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {trySub}.\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b <= a, errorMessage);\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryDiv}.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting with custom message when dividing by zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryMod}.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        return a % b;\n    }\n}\n"
      },
      "lib/openzeppelin-solc-0.6/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\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     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize, which returns 0 for contracts in\n        // construction, since the code is only stored at the end of the\n        // constructor execution.\n\n        uint256 size;\n        // solhint-disable-next-line no-inline-assembly\n        assembly { size := extcodesize(account) }\n        return size > 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://diligence.consensys.net/posts/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.5.11/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        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\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 functionCall(target, data, \"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(address target, bytes memory data, string memory errorMessage) 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(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.call{ value: value }(data);\n        return _verifyCallResult(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(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return _verifyCallResult(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(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\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\n                // solhint-disable-next-line no-inline-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}\n"
      },
      "contracts/external-interfaces/IGsnPaymaster.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\nimport \"./IGsnTypes.sol\";\n\n/// @title IGsnPaymaster interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IGsnPaymaster {\n    struct GasAndDataLimits {\n        uint256 acceptanceBudget;\n        uint256 preRelayedCallGasLimit;\n        uint256 postRelayedCallGasLimit;\n        uint256 calldataSizeLimit;\n    }\n\n    function getGasAndDataLimits() external view returns (GasAndDataLimits memory limits);\n\n    function getHubAddr() external view returns (address);\n\n    function getRelayHubDeposit() external view returns (uint256);\n\n    function preRelayedCall(\n        IGsnTypes.RelayRequest calldata relayRequest,\n        bytes calldata signature,\n        bytes calldata approvalData,\n        uint256 maxPossibleGas\n    ) external returns (bytes memory context, bool rejectOnRecipientRevert);\n\n    function postRelayedCall(\n        bytes calldata context,\n        bool success,\n        uint256 gasUseWithoutPost,\n        IGsnTypes.RelayData calldata relayData\n    ) external;\n\n    function trustedForwarder() external view returns (address);\n\n    function versionPaymaster() external view returns (string memory);\n}\n"
      },
      "contracts/external-interfaces/IGsnRelayHub.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\nimport \"./IGsnTypes.sol\";\n\n/// @title IGsnRelayHub Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IGsnRelayHub {\n    function balanceOf(address target) external view returns (uint256);\n\n    function calculateCharge(uint256 gasUsed, IGsnTypes.RelayData calldata relayData) external view returns (uint256);\n\n    function depositFor(address target) external payable;\n\n    function relayCall(\n        uint256 maxAcceptanceBudget,\n        IGsnTypes.RelayRequest calldata relayRequest,\n        bytes calldata signature,\n        bytes calldata approvalData,\n        uint256 externalGasLimit\n    ) external returns (bool paymasterAccepted, bytes memory returnValue);\n\n    function withdraw(uint256 amount, address payable dest) external;\n}\n"
      },
      "contracts/external-interfaces/IGsnTypes.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\nimport \"./IGsnForwarder.sol\";\n\n/// @title IGsnTypes Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IGsnTypes {\n    struct RelayData {\n        uint256 gasPrice;\n        uint256 pctRelayFee;\n        uint256 baseRelayFee;\n        address relayWorker;\n        address paymaster;\n        address forwarder;\n        bytes paymasterData;\n        uint256 clientId;\n    }\n\n    struct RelayRequest {\n        IGsnForwarder.ForwardRequest request;\n        RelayData relayData;\n    }\n}\n"
      },
      "contracts/external-interfaces/IWETH.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IWETH Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IWETH {\n    function deposit() external payable;\n\n    function withdraw(uint256) external;\n}\n"
      },
      "contracts/release/core/fund/comptroller/IComptroller.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\nimport {IVault} from \"../vault/IVault.sol\";\n\n/// @title IComptroller Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IComptroller {\n    function activate(bool _isMigration) external;\n\n    function buyBackProtocolFeeShares(uint256 _sharesAmount) external;\n\n    function buyShares(uint256 _investmentAmount, uint256 _minSharesQuantity)\n        external\n        returns (uint256 sharesReceived_);\n\n    function buySharesOnBehalf(address _buyer, uint256 _investmentAmount, uint256 _minSharesQuantity)\n        external\n        returns (uint256 sharesReceived_);\n\n    function calcGav() external returns (uint256 gav_);\n\n    function calcGrossShareValue() external returns (uint256 grossShareValue_);\n\n    function callOnExtension(address _extension, uint256 _actionId, bytes calldata _callArgs) external;\n\n    function deployGasRelayPaymaster() external;\n\n    function depositToGasRelayPaymaster() external;\n\n    function destructActivated(uint256 _deactivateFeeManagerGasLimit, uint256 _payProtocolFeeGasLimit) external;\n\n    function destructUnactivated() external;\n\n    function doesAutoProtocolFeeSharesBuyback() external view returns (bool doesAutoBuyback_);\n\n    function getDenominationAsset() external view returns (address denominationAsset_);\n\n    function getDispatcher() external view returns (address dispatcher_);\n\n    function getExternalPositionManager() external view returns (address externalPositionManager_);\n\n    function getFeeManager() external view returns (address feeManager_);\n\n    function getFundDeployer() external view returns (address fundDeployer_);\n\n    function getGasRelayPaymaster() external view returns (address gasRelayPaymaster_);\n\n    function getIntegrationManager() external view returns (address integrationManager_);\n\n    function getLastSharesBoughtTimestampForAccount(address _who)\n        external\n        view\n        returns (uint256 lastSharesBoughtTimestamp_);\n\n    function getMlnToken() external view returns (address mlnToken_);\n\n    function getPolicyManager() external view returns (address policyManager_);\n\n    function getProtocolFeeReserve() external view returns (address protocolFeeReserve_);\n\n    function getSharesActionTimelock() external view returns (uint256 sharesActionTimelock_);\n\n    function getValueInterpreter() external view returns (address valueInterpreter_);\n\n    function getVaultProxy() external view returns (address vaultProxy_);\n\n    function getWethToken() external view returns (address wethToken_);\n\n    function init(address _denominationAsset, uint256 _sharesActionTimelock) external;\n\n    function permissionedVaultAction(IVault.VaultAction _action, bytes calldata _actionData) external;\n\n    function preTransferSharesHook(address _sender, address _recipient, uint256 _amount) external;\n\n    function preTransferSharesHookFreelyTransferable(address _sender) external view;\n\n    function redeemSharesForSpecificAssets(\n        address _recipient,\n        uint256 _sharesQuantity,\n        address[] calldata _payoutAssets,\n        uint256[] calldata _payoutAssetPercentages\n    ) external returns (uint256[] memory payoutAmounts_);\n\n    function redeemSharesInKind(\n        address _recipient,\n        uint256 _sharesQuantity,\n        address[] calldata _additionalAssets,\n        address[] calldata _assetsToSkip\n    ) external returns (address[] memory payoutAssets_, uint256[] memory payoutAmounts_);\n\n    function setAutoProtocolFeeSharesBuyback(bool _nextAutoProtocolFeeSharesBuyback) external;\n\n    function setGasRelayPaymaster(address _nextGasRelayPaymaster) external;\n\n    function setVaultProxy(address _vaultProxy) external;\n\n    function shutdownGasRelayPaymaster() external;\n\n    function vaultCallOnContract(address _contract, bytes4 _selector, bytes calldata _encodedArgs)\n        external\n        returns (bytes memory returnData_);\n}\n"
      },
      "contracts/release/core/fund/vault/IVault.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\nimport {IExternalPositionVault} from \"../../../../persistent/vault/interfaces/IExternalPositionVault.sol\";\nimport {IFreelyTransferableSharesVault} from\n    \"../../../../persistent/vault/interfaces/IFreelyTransferableSharesVault.sol\";\nimport {IMigratableVault} from \"../../../../persistent/vault/interfaces/IMigratableVault.sol\";\nimport {IVaultCore} from \"../../../../persistent/vault/interfaces/IVaultCore.sol\";\n\n/// @title IVault Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IVault is IVaultCore, IMigratableVault, IFreelyTransferableSharesVault, IExternalPositionVault {\n    enum VaultAction {\n        None,\n        // Shares management\n        BurnShares,\n        MintShares,\n        TransferShares,\n        // Asset management\n        AddTrackedAsset,\n        ApproveAssetSpender,\n        RemoveTrackedAsset,\n        WithdrawAssetTo,\n        // External position management\n        AddExternalPosition,\n        CallOnExternalPosition,\n        RemoveExternalPosition\n    }\n\n    function addAssetManagers(address[] calldata _managers) external;\n\n    function addTrackedAsset(address _asset) external;\n\n    function burnShares(address _target, uint256 _amount) external;\n\n    function buyBackProtocolFeeShares(uint256 _sharesAmount, uint256 _mlnValue, uint256 _gav) external;\n\n    function callOnContract(address _contract, bytes calldata _callData) external returns (bytes memory returnData_);\n\n    function canManageAssets(address _who) external view returns (bool canManageAssets_);\n\n    function canRelayCalls(address _who) external view returns (bool canRelayCalls_);\n\n    function claimOwnership() external;\n\n    function getActiveExternalPositions() external view returns (address[] memory activeExternalPositions_);\n\n    function getExternalPositionManager() external view returns (address externalPositionManager_);\n\n    function getFundDeployer() external view returns (address fundDeployer_);\n\n    function getMlnBurner() external view returns (address mlnBurner_);\n\n    function getMlnToken() external view returns (address mlnToken_);\n\n    function getNominatedOwner() external view returns (address nominatedOwner_);\n\n    function getPositionsLimit() external view returns (uint256 positionsLimit_);\n\n    function getProtocolFeeReserve() external view returns (address protocolFeeReserve_);\n\n    function getProtocolFeeTracker() external view returns (address protocolFeeTracker_);\n\n    function getTrackedAssets() external view returns (address[] memory trackedAssets_);\n\n    function isActiveExternalPosition(address _externalPosition)\n        external\n        view\n        returns (bool isActiveExternalPosition_);\n\n    function isAssetManager(address _who) external view returns (bool isAssetManager_);\n\n    function isTrackedAsset(address _asset) external view returns (bool isTrackedAsset_);\n\n    function mintShares(address _target, uint256 _amount) external;\n\n    function payProtocolFee() external;\n\n    function receiveValidatedVaultAction(VaultAction _action, bytes calldata _actionData) external;\n\n    function removeAssetManagers(address[] calldata _managers) external;\n\n    function removeNominatedOwner() external;\n\n    function setAccessorForFundReconfiguration(address _nextAccessor) external;\n\n    function setFreelyTransferableShares() external;\n\n    function setMigrator(address _nextMigrator) external;\n\n    function setName(string calldata _nextName) external;\n\n    function setNominatedOwner(address _nextNominatedOwner) external;\n\n    function setSymbol(string calldata _nextSymbol) external;\n\n    function transferShares(address _from, address _to, uint256 _amount) external;\n\n    function withdrawAssetTo(address _asset, address _target, uint256 _amount) external;\n}\n"
      },
      "contracts/release/core/fund-deployer/IFundDeployer.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\n/// @title IFundDeployer Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IFundDeployer {\n    struct ReconfigurationRequest {\n        address nextComptrollerProxy;\n        uint256 executableTimestamp;\n    }\n\n    function cancelMigration(address _vaultProxy, bool _bypassPrevReleaseFailure) external;\n\n    function cancelReconfiguration(address _vaultProxy) external;\n\n    function createMigrationRequest(\n        address _vaultProxy,\n        address _denominationAsset,\n        uint256 _sharesActionTimelock,\n        bytes calldata _feeManagerConfigData,\n        bytes calldata _policyManagerConfigData,\n        bool _bypassPrevReleaseFailure\n    ) external returns (address comptrollerProxy_);\n\n    function createNewFund(\n        address _fundOwner,\n        string calldata _fundName,\n        string calldata _fundSymbol,\n        address _denominationAsset,\n        uint256 _sharesActionTimelock,\n        bytes calldata _feeManagerConfigData,\n        bytes calldata _policyManagerConfigData\n    ) external returns (address comptrollerProxy_, address vaultProxy_);\n\n    function createReconfigurationRequest(\n        address _vaultProxy,\n        address _denominationAsset,\n        uint256 _sharesActionTimelock,\n        bytes calldata _feeManagerConfigData,\n        bytes calldata _policyManagerConfigData\n    ) external returns (address comptrollerProxy_);\n\n    function deregisterBuySharesOnBehalfCallers(address[] calldata _callers) external;\n\n    function deregisterVaultCalls(\n        address[] calldata _contracts,\n        bytes4[] calldata _selectors,\n        bytes32[] memory _dataHashes\n    ) external;\n\n    function executeMigration(address _vaultProxy, bool _bypassPrevReleaseFailure) external;\n\n    function executeReconfiguration(address _vaultProxy) external;\n\n    function getComptrollerLib() external view returns (address comptrollerLib_);\n\n    function getCreator() external view returns (address creator_);\n\n    function getDispatcher() external view returns (address dispatcher_);\n\n    function getGasLimitsForDestructCall()\n        external\n        view\n        returns (uint256 deactivateFeeManagerGasLimit_, uint256 payProtocolFeeGasLimit_);\n\n    function getOwner() external view returns (address owner_);\n\n    function getProtocolFeeTracker() external view returns (address protocolFeeTracker_);\n\n    function getReconfigurationRequestForVaultProxy(address _vaultProxy)\n        external\n        view\n        returns (ReconfigurationRequest memory reconfigurationRequest_);\n\n    function getReconfigurationTimelock() external view returns (uint256 reconfigurationTimelock_);\n\n    function getVaultLib() external view returns (address vaultLib_);\n\n    function hasReconfigurationRequest(address _vaultProxy) external view returns (bool hasReconfigurationRequest_);\n\n    function isAllowedBuySharesOnBehalfCaller(address _who) external view returns (bool isAllowed_);\n\n    function isAllowedVaultCall(address _contract, bytes4 _selector, bytes32 _dataHash)\n        external\n        view\n        returns (bool isAllowed_);\n\n    function isRegisteredVaultCall(address _contract, bytes4 _selector, bytes32 _dataHash)\n        external\n        view\n        returns (bool isRegistered_);\n\n    function registerBuySharesOnBehalfCallers(address[] calldata _callers) external;\n\n    function registerVaultCalls(\n        address[] calldata _contracts,\n        bytes4[] calldata _selectors,\n        bytes32[] memory _dataHashes\n    ) external;\n\n    function releaseIsLive() external view returns (bool isLive_);\n\n    function setComptrollerLib(address _comptrollerLib) external;\n\n    function setGasLimitsForDestructCall(uint32 _nextDeactivateFeeManagerGasLimit, uint32 _nextPayProtocolFeeGasLimit)\n        external;\n\n    function setProtocolFeeTracker(address _protocolFeeTracker) external;\n\n    function setReconfigurationTimelock(uint256 _nextTimelock) external;\n\n    function setReleaseLive() external;\n\n    function setVaultLib(address _vaultLib) external;\n}\n"
      },
      "contracts/release/extensions/policy-manager/IPolicyManager.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\n/// @title PolicyManager Interface\n/// @author Enzyme Council <security@enzyme.finance>\n/// @notice Interface for the PolicyManager\ninterface IPolicyManager {\n    // When updating PolicyHook, also update these functions in PolicyManager:\n    // 1. __getAllPolicyHooks()\n    // 2. __policyHookRestrictsCurrentInvestorActions()\n    enum PolicyHook {\n        PostBuyShares,\n        PostCallOnIntegration,\n        PreTransferShares,\n        RedeemSharesForSpecificAssets,\n        AddTrackedAssets,\n        RemoveTrackedAssets,\n        CreateExternalPosition,\n        PostCallOnExternalPosition,\n        RemoveExternalPosition,\n        ReactivateExternalPosition\n    }\n\n    function disablePolicyForFund(address _comptrollerProxy, address _policy) external;\n\n    function enablePolicyForFund(address _comptrollerProxy, address _policy, bytes calldata _settingsData) external;\n\n    function getEnabledPoliciesForFund(address _comptrollerProxy)\n        external\n        view\n        returns (address[] memory enabledPolicies_);\n\n    function getEnabledPoliciesOnHookForFund(address _comptrollerProxy, PolicyHook _hook)\n        external\n        view\n        returns (address[] memory enabledPolicies_);\n\n    function policyIsEnabledOnHookForFund(address _comptrollerProxy, PolicyHook _hook, address _policy)\n        external\n        view\n        returns (bool isEnabled_);\n\n    function updatePolicySettingsForFund(address _comptrollerProxy, address _policy, bytes calldata _settingsData)\n        external;\n\n    function validatePolicies(address _comptrollerProxy, PolicyHook _hook, bytes calldata _validationData) external;\n}\n"
      },
      "contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase2.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity 0.6.12;\n\nimport {GasRelayPaymasterLibBase1} from \"./GasRelayPaymasterLibBase1.sol\";\n\n/// @title GasRelayPaymasterLibBase2 Contract\n/// @author Enzyme Council <security@enzyme.finance>\n/// @notice A persistent contract containing all required storage variables and events\n/// for a GasRelayPaymasterLib\n/// @dev DO NOT EDIT CONTRACT ONCE DEPLOYED. If new events or storage are necessary,\n/// they should be added to a numbered GasRelayPaymasterLibBaseXXX that inherits the previous base.\n/// e.g., `GasRelayPaymasterLibBase2 is GasRelayPaymasterLibBase1`\nabstract contract GasRelayPaymasterLibBase2 is GasRelayPaymasterLibBase1 {\n    uint256 internal lastDepositTimestamp;\n}\n"
      },
      "contracts/release/infrastructure/gas-relayer/IGasRelayPaymaster.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\nimport {IGsnPaymaster} from \"../../../external-interfaces/IGsnPaymaster.sol\";\n\n/// @title IGasRelayPaymaster Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IGasRelayPaymaster is IGsnPaymaster {\n    function addAdditionalRelayUsers(address[] calldata _usersToAdd) external;\n\n    function deposit() external;\n\n    function getLastDepositTimestamp() external view returns (uint256 lastDepositTimestamp_);\n\n    function getParentComptroller() external view returns (address parentComptroller_);\n\n    function getParentVault() external view returns (address parentVault_);\n\n    function getWethToken() external view returns (address wethToken_);\n\n    function init(address _vault) external;\n\n    function isAdditionalRelayUser(address _who) external view returns (bool isAdditionalRelayUser_);\n\n    function removeAdditionalRelayUsers(address[] calldata _usersToRemove) external;\n\n    function withdrawBalance() external;\n}\n"
      },
      "contracts/release/infrastructure/gas-relayer/IGasRelayPaymasterDepositor.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IGasRelayPaymasterDepositor Interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IGasRelayPaymasterDepositor {\n    function pullWethForGasRelayer(uint256) external;\n}\n"
      },
      "contracts/external-interfaces/IGsnForwarder.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IGsnForwarder interface\n/// @author Enzyme Council <security@enzyme.finance>\ninterface IGsnForwarder {\n    struct ForwardRequest {\n        address from;\n        address to;\n        uint256 value;\n        uint256 gas;\n        uint256 nonce;\n        bytes data;\n        uint256 validUntil;\n    }\n}\n"
      },
      "contracts/persistent/vault/interfaces/IExternalPositionVault.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IExternalPositionVault interface\n/// @author Enzyme Council <security@enzyme.finance>\n/// Provides an interface to get the externalPositionLib for a given type from the Vault\ninterface IExternalPositionVault {\n    function getExternalPositionLibForType(uint256) external view returns (address);\n}\n"
      },
      "contracts/persistent/vault/interfaces/IFreelyTransferableSharesVault.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IFreelyTransferableSharesVault Interface\n/// @author Enzyme Council <security@enzyme.finance>\n/// @notice Provides the interface for determining whether a vault's shares\n/// are guaranteed to be freely transferable.\n/// @dev DO NOT EDIT CONTRACT\ninterface IFreelyTransferableSharesVault {\n    function sharesAreFreelyTransferable() external view returns (bool sharesAreFreelyTransferable_);\n}\n"
      },
      "contracts/persistent/vault/interfaces/IMigratableVault.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IMigratableVault Interface\n/// @author Enzyme Council <security@enzyme.finance>\n/// @dev DO NOT EDIT CONTRACT\ninterface IMigratableVault {\n    function canMigrate(address _who) external view returns (bool canMigrate_);\n\n    function init(address _owner, address _accessor, string calldata _fundName) external;\n\n    function setAccessor(address _nextAccessor) external;\n\n    function setVaultLib(address _nextVaultLib) external;\n}\n"
      },
      "contracts/persistent/vault/interfaces/IVaultCore.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity >=0.6.0 <0.9.0;\n\n/// @title IVaultCore interface\n/// @author Enzyme Council <security@enzyme.finance>\n/// @notice Interface for getters of core vault storage\n/// @dev DO NOT EDIT CONTRACT\ninterface IVaultCore {\n    function getAccessor() external view returns (address accessor_);\n\n    function getCreator() external view returns (address creator_);\n\n    function getMigrator() external view returns (address migrator_);\n\n    function getOwner() external view returns (address owner_);\n}\n"
      },
      "contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase1.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\n/*\n    This file is part of the Enzyme Protocol.\n\n    (c) Enzyme Council <council@enzyme.finance>\n\n    For the full license information, please view the LICENSE\n    file that was distributed with this source code.\n*/\n\npragma solidity 0.6.12;\n\n/// @title GasRelayPaymasterLibBase1 Contract\n/// @author Enzyme Council <security@enzyme.finance>\n/// @notice A persistent contract containing all required storage variables and events\n/// for a GasRelayPaymasterLib\n/// @dev DO NOT EDIT CONTRACT ONCE DEPLOYED. If new events or storage are necessary,\n/// they should be added to a numbered GasRelayPaymasterLibBaseXXX that inherits the previous base.\n/// e.g., `GasRelayPaymasterLibBase2 is GasRelayPaymasterLibBase1`\nabstract contract GasRelayPaymasterLibBase1 {\n    event Deposited(uint256 amount);\n\n    event TransactionRelayed(address indexed authorizer, bytes4 invokedSelector, bool successful);\n\n    event Withdrawn(uint256 amount);\n\n    // Pseudo-constants\n    address internal parentVault;\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "@openzeppelin/contracts/=lib/openzeppelin-solc-0.6/contracts/",
        "@uniswap/v3-core/=lib/uniswap-v3-core/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "openzeppelin-solc-0.6/=lib/openzeppelin-solc-0.6/contracts/",
        "openzeppelin-solc-0.7/=lib/openzeppelin-solc-0.7/contracts/",
        "openzeppelin-solc-0.8/=lib/openzeppelin-solc-0.8/contracts/",
        "uniswap-v3-core/=lib/uniswap-v3-core/",
        "uniswap-v3-core-0.8/=lib/uniswap-v3-core-0.8/",
        "uniswap-v3-periphery/=lib/uniswap-v3-periphery/contracts/",
        "uniswap-v3-periphery-0.8/=lib/uniswap-v3-periphery-0.8/contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200,
        "details": {
          "yul": false
        }
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "none"
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "istanbul",
      "libraries": {}
    }
  }}