{
  "address": "0xcddfa3BfC0e548d9A526E3355FefDf987F4e1aAE",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "contract IPrizePool",
          "name": "_prizePool",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "_amount",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "_to",
          "type": "address"
        },
        {
          "components": [
            {
              "internalType": "address",
              "name": "delegate",
              "type": "address"
            },
            {
              "components": [
                {
                  "internalType": "uint256",
                  "name": "deadline",
                  "type": "uint256"
                },
                {
                  "internalType": "uint8",
                  "name": "v",
                  "type": "uint8"
                },
                {
                  "internalType": "bytes32",
                  "name": "r",
                  "type": "bytes32"
                },
                {
                  "internalType": "bytes32",
                  "name": "s",
                  "type": "bytes32"
                }
              ],
              "internalType": "struct Signature",
              "name": "signature",
              "type": "tuple"
            }
          ],
          "internalType": "struct DelegateSignature",
          "name": "_delegateSignature",
          "type": "tuple"
        }
      ],
      "name": "depositToAndDelegate",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IPrizePool",
          "name": "_prizePool",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "_amount",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "_to",
          "type": "address"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "deadline",
              "type": "uint256"
            },
            {
              "internalType": "uint8",
              "name": "v",
              "type": "uint8"
            },
            {
              "internalType": "bytes32",
              "name": "r",
              "type": "bytes32"
            },
            {
              "internalType": "bytes32",
              "name": "s",
              "type": "bytes32"
            }
          ],
          "internalType": "struct Signature",
          "name": "_permitSignature",
          "type": "tuple"
        },
        {
          "components": [
            {
              "internalType": "address",
              "name": "delegate",
              "type": "address"
            },
            {
              "components": [
                {
                  "internalType": "uint256",
                  "name": "deadline",
                  "type": "uint256"
                },
                {
                  "internalType": "uint8",
                  "name": "v",
                  "type": "uint8"
                },
                {
                  "internalType": "bytes32",
                  "name": "r",
                  "type": "bytes32"
                },
                {
                  "internalType": "bytes32",
                  "name": "s",
                  "type": "bytes32"
                }
              ],
              "internalType": "struct Signature",
              "name": "signature",
              "type": "tuple"
            }
          ],
          "internalType": "struct DelegateSignature",
          "name": "_delegateSignature",
          "type": "tuple"
        }
      ],
      "name": "permitAndDepositToAndDelegate",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "transactionHash": "0x9e145b87fa931c185a12c315355c3f72dcc7178abe9a63f8e5814c79c34375bd",
  "receipt": {
    "to": null,
    "from": "0x4D40eb12430A57965cEe3015348d490C6156dF20",
    "contractAddress": "0xcddfa3BfC0e548d9A526E3355FefDf987F4e1aAE",
    "transactionIndex": 0,
    "gasUsed": "721741",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0x032396107ad03d4101ad3dc451f0599cb283a341a51cbf0d270c965ab9f00266",
    "transactionHash": "0x9e145b87fa931c185a12c315355c3f72dcc7178abe9a63f8e5814c79c34375bd",
    "logs": [],
    "blockNumber": 14043058,
    "cumulativeGasUsed": "721741",
    "status": 1,
    "byzantium": true
  },
  "args": [],
  "numDeployments": 1,
  "solcInputHash": "81bc9ae0cb2caeb2744ac5c81556a380",
  "metadata": "{\"compiler\":{\"version\":\"0.8.6+commit.11564f7e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IPrizePool\",\"name\":\"_prizePool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct Signature\",\"name\":\"signature\",\"type\":\"tuple\"}],\"internalType\":\"struct DelegateSignature\",\"name\":\"_delegateSignature\",\"type\":\"tuple\"}],\"name\":\"depositToAndDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPrizePool\",\"name\":\"_prizePool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct Signature\",\"name\":\"_permitSignature\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct Signature\",\"name\":\"signature\",\"type\":\"tuple\"}],\"internalType\":\"struct DelegateSignature\",\"name\":\"_delegateSignature\",\"type\":\"tuple\"}],\"name\":\"permitAndDepositToAndDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:experimental\":\"This contract has not been fully audited yet.\",\"kind\":\"dev\",\"methods\":{\"depositToAndDelegate(address,uint256,address,(address,(uint256,uint8,bytes32,bytes32)))\":{\"params\":{\"_amount\":\"Amount of tokens to deposit into the prize pool\",\"_delegateSignature\":\"Delegate signature\",\"_prizePool\":\"Address of the prize pool to deposit into\",\"_to\":\"Address that will receive the tickets\"}},\"permitAndDepositToAndDelegate(address,uint256,address,(uint256,uint8,bytes32,bytes32),(address,(uint256,uint8,bytes32,bytes32)))\":{\"details\":\"The `spender` address required by the permit function is the address of this contract.\",\"params\":{\"_amount\":\"Amount of tokens to deposit into the prize pool\",\"_delegateSignature\":\"Delegate signature\",\"_permitSignature\":\"Permit signature\",\"_prizePool\":\"Address of the prize pool to deposit into\",\"_to\":\"Address that will receive the tickets\"}}},\"title\":\"Allows users to approve and deposit EIP-2612 compatible tokens into a prize pool in a single transaction.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"depositToAndDelegate(address,uint256,address,(address,(uint256,uint8,bytes32,bytes32)))\":{\"notice\":\"Deposits user's token into the prize pool and delegate tickets.\"},\"permitAndDepositToAndDelegate(address,uint256,address,(uint256,uint8,bytes32,bytes32),(address,(uint256,uint8,bytes32,bytes32)))\":{\"notice\":\"Permits this contract to spend on a user's behalf and deposits into the prize pool.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@pooltogether/v4-core/contracts/permit/EIP2612PermitAndDeposit.sol\":\"EIP2612PermitAndDeposit\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 `recipient`.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * Emits a {Transfer} event.\\n     */\\n    function transfer(address recipient, 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 `sender` to `recipient` 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(\\n        address sender,\\n        address recipient,\\n        uint256 amount\\n    ) external returns (bool);\\n\\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\",\"keccak256\":\"0x61437cb513a887a1bbad006e7b1c8b414478427d33de47c5600af3c748f108da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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 */\\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    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\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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    function safeTransfer(\\n        IERC20 token,\\n        address to,\\n        uint256 value\\n    ) internal {\\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n    }\\n\\n    function safeTransferFrom(\\n        IERC20 token,\\n        address from,\\n        address to,\\n        uint256 value\\n    ) 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(\\n        IERC20 token,\\n        address spender,\\n        uint256 value\\n    ) 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    function safeIncreaseAllowance(\\n        IERC20 token,\\n        address spender,\\n        uint256 value\\n    ) internal {\\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n    }\\n\\n    function safeDecreaseAllowance(\\n        IERC20 token,\\n        address spender,\\n        uint256 value\\n    ) internal {\\n        unchecked {\\n            uint256 oldAllowance = token.allowance(address(this), spender);\\n            require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n            uint256 newAllowance = oldAllowance - value;\\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n        }\\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        if (returndata.length > 0) {\\n            // Return data is optional\\n            require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\\n\\npragma solidity ^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        assembly {\\n            size := extcodesize(account)\\n        }\\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        (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(\\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(\\n        address target,\\n        bytes memory data,\\n        uint256 value\\n    ) 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        require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\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(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal view returns (bytes memory) {\\n        require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\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(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal returns (bytes memory) {\\n        require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n        (bool success, bytes memory returndata) = target.delegatecall(data);\\n        return verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n     * revert reason 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            // 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                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\",\"keccak256\":\"0x51b758a8815ecc9596c66c37d56b1d33883a444631a3f916b9fe65cb863ef7c4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\n    /**\\n     * @dev Returns the downcasted uint224 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint224).\\n     *\\n     * Counterpart to Solidity's `uint224` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 224 bits\\n     */\\n    function toUint224(uint256 value) internal pure returns (uint224) {\\n        require(value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n        return uint224(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint128 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint128).\\n     *\\n     * Counterpart to Solidity's `uint128` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 128 bits\\n     */\\n    function toUint128(uint256 value) internal pure returns (uint128) {\\n        require(value <= type(uint128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n        return uint128(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint96 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint96).\\n     *\\n     * Counterpart to Solidity's `uint96` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 96 bits\\n     */\\n    function toUint96(uint256 value) internal pure returns (uint96) {\\n        require(value <= type(uint96).max, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n        return uint96(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint64 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint64).\\n     *\\n     * Counterpart to Solidity's `uint64` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 64 bits\\n     */\\n    function toUint64(uint256 value) internal pure returns (uint64) {\\n        require(value <= type(uint64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n        return uint64(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint32 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint32).\\n     *\\n     * Counterpart to Solidity's `uint32` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 32 bits\\n     */\\n    function toUint32(uint256 value) internal pure returns (uint32) {\\n        require(value <= type(uint32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n        return uint32(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint16 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint16).\\n     *\\n     * Counterpart to Solidity's `uint16` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 16 bits\\n     */\\n    function toUint16(uint256 value) internal pure returns (uint16) {\\n        require(value <= type(uint16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n        return uint16(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint8 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint8).\\n     *\\n     * Counterpart to Solidity's `uint8` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 8 bits.\\n     */\\n    function toUint8(uint256 value) internal pure returns (uint8) {\\n        require(value <= type(uint8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n        return uint8(value);\\n    }\\n\\n    /**\\n     * @dev Converts a signed int256 into an unsigned uint256.\\n     *\\n     * Requirements:\\n     *\\n     * - input must be greater than or equal to 0.\\n     */\\n    function toUint256(int256 value) internal pure returns (uint256) {\\n        require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n        return uint256(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int128 from int256, reverting on\\n     * overflow (when the input is less than smallest int128 or\\n     * greater than largest int128).\\n     *\\n     * Counterpart to Solidity's `int128` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 128 bits\\n     *\\n     * _Available since v3.1._\\n     */\\n    function toInt128(int256 value) internal pure returns (int128) {\\n        require(value >= type(int128).min && value <= type(int128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n        return int128(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int64 from int256, reverting on\\n     * overflow (when the input is less than smallest int64 or\\n     * greater than largest int64).\\n     *\\n     * Counterpart to Solidity's `int64` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 64 bits\\n     *\\n     * _Available since v3.1._\\n     */\\n    function toInt64(int256 value) internal pure returns (int64) {\\n        require(value >= type(int64).min && value <= type(int64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n        return int64(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int32 from int256, reverting on\\n     * overflow (when the input is less than smallest int32 or\\n     * greater than largest int32).\\n     *\\n     * Counterpart to Solidity's `int32` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 32 bits\\n     *\\n     * _Available since v3.1._\\n     */\\n    function toInt32(int256 value) internal pure returns (int32) {\\n        require(value >= type(int32).min && value <= type(int32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n        return int32(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int16 from int256, reverting on\\n     * overflow (when the input is less than smallest int16 or\\n     * greater than largest int16).\\n     *\\n     * Counterpart to Solidity's `int16` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 16 bits\\n     *\\n     * _Available since v3.1._\\n     */\\n    function toInt16(int256 value) internal pure returns (int16) {\\n        require(value >= type(int16).min && value <= type(int16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n        return int16(value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted int8 from int256, reverting on\\n     * overflow (when the input is less than smallest int8 or\\n     * greater than largest int8).\\n     *\\n     * Counterpart to Solidity's `int8` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 8 bits.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function toInt8(int256 value) internal pure returns (int8) {\\n        require(value >= type(int8).min && value <= type(int8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n        return int8(value);\\n    }\\n\\n    /**\\n     * @dev Converts an unsigned uint256 into a signed int256.\\n     *\\n     * Requirements:\\n     *\\n     * - input must be less than or equal to maxInt256.\\n     */\\n    function toInt256(uint256 value) internal pure returns (int256) {\\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n        require(value <= uint256(type(int256).max), \\\"SafeCast: value doesn't fit in an int256\\\");\\n        return int256(value);\\n    }\\n}\\n\",\"keccak256\":\"0x5c6caab697d302ad7eb59c234a4d2dbc965c1bae87709bd2850060b7695b28c7\",\"license\":\"MIT\"},\"@pooltogether/v4-core/contracts/external/compound/ICompLike.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface ICompLike is IERC20 {\\n    function getCurrentVotes(address account) external view returns (uint96);\\n\\n    function delegate(address delegate) external;\\n}\\n\",\"keccak256\":\"0x34d2c8a57ca27b9c58ec07c4bd8d263c71a25d194068ad9403f3895dc99a7122\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IControlledToken.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/** @title IControlledToken\\n  * @author PoolTogether Inc Team\\n  * @notice ERC20 Tokens with a controller for minting & burning.\\n*/\\ninterface IControlledToken is IERC20 {\\n\\n    /** \\n        @notice Interface to the contract responsible for controlling mint/burn\\n    */\\n    function controller() external view returns (address);\\n\\n    /** \\n      * @notice Allows the controller to mint tokens for a user account\\n      * @dev May be overridden to provide more granular control over minting\\n      * @param user Address of the receiver of the minted tokens\\n      * @param amount Amount of tokens to mint\\n    */\\n    function controllerMint(address user, uint256 amount) external;\\n\\n    /** \\n      * @notice Allows the controller to burn tokens from a user account\\n      * @dev May be overridden to provide more granular control over burning\\n      * @param user Address of the holder account to burn tokens from\\n      * @param amount Amount of tokens to burn\\n    */\\n    function controllerBurn(address user, uint256 amount) external;\\n\\n    /** \\n      * @notice Allows an operator via the controller to burn tokens on behalf of a user account\\n      * @dev May be overridden to provide more granular control over operator-burning\\n      * @param operator Address of the operator performing the burn action via the controller contract\\n      * @param user Address of the holder account to burn tokens from\\n      * @param amount Amount of tokens to burn\\n    */\\n    function controllerBurnFrom(\\n        address operator,\\n        address user,\\n        uint256 amount\\n    ) external;\\n}\\n\",\"keccak256\":\"0x90dceeec1eea6e49021e8db88b084f3f0c503c60b6f7e0bbecd2529ffde87ef3\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IPrizePool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"../external/compound/ICompLike.sol\\\";\\nimport \\\"../interfaces/ITicket.sol\\\";\\n\\ninterface IPrizePool {\\n    /// @dev Event emitted when controlled token is added\\n    event ControlledTokenAdded(ITicket indexed token);\\n\\n    event AwardCaptured(uint256 amount);\\n\\n    /// @dev Event emitted when assets are deposited\\n    event Deposited(\\n        address indexed operator,\\n        address indexed to,\\n        ITicket indexed token,\\n        uint256 amount\\n    );\\n\\n    /// @dev Event emitted when interest is awarded to a winner\\n    event Awarded(address indexed winner, ITicket indexed token, uint256 amount);\\n\\n    /// @dev Event emitted when external ERC20s are awarded to a winner\\n    event AwardedExternalERC20(address indexed winner, address indexed token, uint256 amount);\\n\\n    /// @dev Event emitted when external ERC20s are transferred out\\n    event TransferredExternalERC20(address indexed to, address indexed token, uint256 amount);\\n\\n    /// @dev Event emitted when external ERC721s are awarded to a winner\\n    event AwardedExternalERC721(address indexed winner, address indexed token, uint256[] tokenIds);\\n\\n    /// @dev Event emitted when assets are withdrawn\\n    event Withdrawal(\\n        address indexed operator,\\n        address indexed from,\\n        ITicket indexed token,\\n        uint256 amount,\\n        uint256 redeemed\\n    );\\n\\n    /// @dev Event emitted when the Balance Cap is set\\n    event BalanceCapSet(uint256 balanceCap);\\n\\n    /// @dev Event emitted when the Liquidity Cap is set\\n    event LiquidityCapSet(uint256 liquidityCap);\\n\\n    /// @dev Event emitted when the Prize Strategy is set\\n    event PrizeStrategySet(address indexed prizeStrategy);\\n\\n    /// @dev Event emitted when the Ticket is set\\n    event TicketSet(ITicket indexed ticket);\\n\\n    /// @dev Emitted when there was an error thrown awarding an External ERC721\\n    event ErrorAwardingExternalERC721(bytes error);\\n\\n    /// @notice Deposit assets into the Prize Pool in exchange for tokens\\n    /// @param to The address receiving the newly minted tokens\\n    /// @param amount The amount of assets to deposit\\n    function depositTo(address to, uint256 amount) external;\\n\\n    /// @notice Deposit assets into the Prize Pool in exchange for tokens,\\n    /// then sets the delegate on behalf of the caller.\\n    /// @param to The address receiving the newly minted tokens\\n    /// @param amount The amount of assets to deposit\\n    /// @param delegate The address to delegate to for the caller\\n    function depositToAndDelegate(address to, uint256 amount, address delegate) external;\\n\\n    /// @notice Withdraw assets from the Prize Pool instantly.  A fairness fee may be charged for an early exit.\\n    /// @param from The address to redeem tokens from.\\n    /// @param amount The amount of tokens to redeem for assets.\\n    /// @return The actual amount withdrawn\\n    function withdrawFrom(address from, uint256 amount) external returns (uint256);\\n\\n    /// @notice Called by the prize strategy to award prizes.\\n    /// @dev The amount awarded must be less than the awardBalance()\\n    /// @param to The address of the winner that receives the award\\n    /// @param amount The amount of assets to be awarded\\n    function award(address to, uint256 amount) external;\\n\\n    /// @notice Returns the balance that is available to award.\\n    /// @dev captureAwardBalance() should be called first\\n    /// @return The total amount of assets to be awarded for the current prize\\n    function awardBalance() external view returns (uint256);\\n\\n    /// @notice Captures any available interest as award balance.\\n    /// @dev This function also captures the reserve fees.\\n    /// @return The total amount of assets to be awarded for the current prize\\n    function captureAwardBalance() external returns (uint256);\\n\\n    /// @dev Checks with the Prize Pool if a specific token type may be awarded as an external prize\\n    /// @param externalToken The address of the token to check\\n    /// @return True if the token may be awarded, false otherwise\\n    function canAwardExternal(address externalToken) external view returns (bool);\\n\\n    // @dev Returns the total underlying balance of all assets. This includes both principal and interest.\\n    /// @return The underlying balance of assets\\n    function balance() external returns (uint256);\\n\\n    /**\\n     * @notice Read internal Ticket accounted balance.\\n     * @return uint256 accountBalance\\n     */\\n    function getAccountedBalance() external view returns (uint256);\\n\\n    /**\\n     * @notice Read internal balanceCap variable\\n     */\\n    function getBalanceCap() external view returns (uint256);\\n\\n    /**\\n     * @notice Read internal liquidityCap variable\\n     */\\n    function getLiquidityCap() external view returns (uint256);\\n\\n    /**\\n     * @notice Read ticket variable\\n     */\\n    function getTicket() external view returns (ITicket);\\n\\n    /**\\n     * @notice Read token variable\\n     */\\n    function getToken() external view returns (address);\\n\\n    /**\\n     * @notice Read prizeStrategy variable\\n     */\\n    function getPrizeStrategy() external view returns (address);\\n\\n    /// @dev Checks if a specific token is controlled by the Prize Pool\\n    /// @param controlledToken The address of the token to check\\n    /// @return True if the token is a controlled token, false otherwise\\n    function isControlled(ITicket controlledToken) external view returns (bool);\\n\\n    /// @notice Called by the Prize-Strategy to transfer out external ERC20 tokens\\n    /// @dev Used to transfer out tokens held by the Prize Pool.  Could be liquidated, or anything.\\n    /// @param to The address of the winner that receives the award\\n    /// @param externalToken The address of the external asset token being awarded\\n    /// @param amount The amount of external assets to be awarded\\n    function transferExternalERC20(\\n        address to,\\n        address externalToken,\\n        uint256 amount\\n    ) external;\\n\\n    /// @notice Called by the Prize-Strategy to award external ERC20 prizes\\n    /// @dev Used to award any arbitrary tokens held by the Prize Pool\\n    /// @param to The address of the winner that receives the award\\n    /// @param amount The amount of external assets to be awarded\\n    /// @param externalToken The address of the external asset token being awarded\\n    function awardExternalERC20(\\n        address to,\\n        address externalToken,\\n        uint256 amount\\n    ) external;\\n\\n    /// @notice Called by the prize strategy to award external ERC721 prizes\\n    /// @dev Used to award any arbitrary NFTs held by the Prize Pool\\n    /// @param to The address of the winner that receives the award\\n    /// @param externalToken The address of the external NFT token being awarded\\n    /// @param tokenIds An array of NFT Token IDs to be transferred\\n    function awardExternalERC721(\\n        address to,\\n        address externalToken,\\n        uint256[] calldata tokenIds\\n    ) external;\\n\\n    /// @notice Allows the owner to set a balance cap per `token` for the pool.\\n    /// @dev If a user wins, his balance can go over the cap. He will be able to withdraw the excess but not deposit.\\n    /// @dev Needs to be called after deploying a prize pool to be able to deposit into it.\\n    /// @param balanceCap New balance cap.\\n    /// @return True if new balance cap has been successfully set.\\n    function setBalanceCap(uint256 balanceCap) external returns (bool);\\n\\n    /// @notice Allows the Governor to set a cap on the amount of liquidity that he pool can hold\\n    /// @param liquidityCap The new liquidity cap for the prize pool\\n    function setLiquidityCap(uint256 liquidityCap) external;\\n\\n    /// @notice Sets the prize strategy of the prize pool.  Only callable by the owner.\\n    /// @param _prizeStrategy The new prize strategy.\\n    function setPrizeStrategy(address _prizeStrategy) external;\\n\\n    /// @notice Set prize pool ticket.\\n    /// @param ticket Address of the ticket to set.\\n    /// @return True if ticket has been successfully set.\\n    function setTicket(ITicket ticket) external returns (bool);\\n\\n    /// @notice Delegate the votes for a Compound COMP-like token held by the prize pool\\n    /// @param compLike The COMP-like token held by the prize pool that should be delegated\\n    /// @param to The address to delegate to\\n    function compLikeDelegate(ICompLike compLike, address to) external;\\n}\\n\",\"keccak256\":\"0x1dd613819255c4af91347b88cd156724df2a594c909bd9d2207bebc560a254fa\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/ITicket.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"../libraries/TwabLib.sol\\\";\\nimport \\\"./IControlledToken.sol\\\";\\n\\ninterface ITicket is IControlledToken {\\n    /**\\n     * @notice A struct containing details for an Account.\\n     * @param balance The current balance for an Account.\\n     * @param nextTwabIndex The next available index to store a new twab.\\n     * @param cardinality The number of recorded twabs (plus one!).\\n     */\\n    struct AccountDetails {\\n        uint224 balance;\\n        uint16 nextTwabIndex;\\n        uint16 cardinality;\\n    }\\n\\n    /**\\n     * @notice Combines account details with their twab history.\\n     * @param details The account details.\\n     * @param twabs The history of twabs for this account.\\n     */\\n    struct Account {\\n        AccountDetails details;\\n        ObservationLib.Observation[65535] twabs;\\n    }\\n\\n    /**\\n     * @notice Emitted when TWAB balance has been delegated to another user.\\n     * @param delegator Address of the delegator.\\n     * @param delegate Address of the delegate.\\n     */\\n    event Delegated(address indexed delegator, address indexed delegate);\\n\\n    /**\\n     * @notice Emitted when ticket is initialized.\\n     * @param name Ticket name (eg: PoolTogether Dai Ticket (Compound)).\\n     * @param symbol Ticket symbol (eg: PcDAI).\\n     * @param decimals Ticket decimals.\\n     * @param controller Token controller address.\\n     */\\n    event TicketInitialized(string name, string symbol, uint8 decimals, address indexed controller);\\n\\n    /**\\n     * @notice Emitted when a new TWAB has been recorded.\\n     * @param delegate The recipient of the ticket power (may be the same as the user).\\n     * @param newTwab Updated TWAB of a ticket holder after a successful TWAB recording.\\n     */\\n    event NewUserTwab(\\n        address indexed delegate,\\n        ObservationLib.Observation newTwab\\n    );\\n\\n    /**\\n     * @notice Emitted when a new total supply TWAB has been recorded.\\n     * @param newTotalSupplyTwab Updated TWAB of tickets total supply after a successful total supply TWAB recording.\\n     */\\n    event NewTotalSupplyTwab(ObservationLib.Observation newTotalSupplyTwab);\\n\\n    /**\\n     * @notice Retrieves the address of the delegate to whom `user` has delegated their tickets.\\n     * @dev Address of the delegate will be the zero address if `user` has not delegated their tickets.\\n     * @param user Address of the delegator.\\n     * @return Address of the delegate.\\n     */\\n    function delegateOf(address user) external view returns (address);\\n\\n    /**\\n    * @notice Delegate time-weighted average balances to an alternative address.\\n    * @dev    Transfers (including mints) trigger the storage of a TWAB in delegate(s) account, instead of the\\n              targetted sender and/or recipient address(s).\\n    * @dev    To reset the delegate, pass the zero address (0x000.000) as `to` parameter.\\n    * @dev Current delegate address should be different from the new delegate address `to`.\\n    * @param  to Recipient of delegated TWAB.\\n    */\\n    function delegate(address to) external;\\n\\n    /**\\n     * @notice Allows the controller to delegate on a users behalf.\\n     * @param user The user for whom to delegate\\n     * @param delegate The new delegate\\n     */\\n    function controllerDelegateFor(address user, address delegate) external;\\n\\n    /**\\n     * @notice Allows a user to delegate via signature\\n     * @param user The user who is delegating\\n     * @param delegate The new delegate\\n     * @param deadline The timestamp by which this must be submitted\\n     * @param v The v portion of the ECDSA sig\\n     * @param r The r portion of the ECDSA sig\\n     * @param s The s portion of the ECDSA sig\\n     */\\n    function delegateWithSignature(\\n        address user,\\n        address delegate,\\n        uint256 deadline,\\n        uint8 v,\\n        bytes32 r,\\n        bytes32 s\\n    ) external;\\n\\n    /**\\n     * @notice Gets a users twab context.  This is a struct with their balance, next twab index, and cardinality.\\n     * @param user The user for whom to fetch the TWAB context.\\n     * @return The TWAB context, which includes { balance, nextTwabIndex, cardinality }\\n     */\\n    function getAccountDetails(address user) external view returns (TwabLib.AccountDetails memory);\\n\\n    /**\\n     * @notice Gets the TWAB at a specific index for a user.\\n     * @param user The user for whom to fetch the TWAB.\\n     * @param index The index of the TWAB to fetch.\\n     * @return The TWAB, which includes the twab amount and the timestamp.\\n     */\\n    function getTwab(address user, uint16 index)\\n        external\\n        view\\n        returns (ObservationLib.Observation memory);\\n\\n    /**\\n     * @notice Retrieves `user` TWAB balance.\\n     * @param user Address of the user whose TWAB is being fetched.\\n     * @param timestamp Timestamp at which we want to retrieve the TWAB balance.\\n     * @return The TWAB balance at the given timestamp.\\n     */\\n    function getBalanceAt(address user, uint64 timestamp) external view returns (uint256);\\n\\n    /**\\n     * @notice Retrieves `user` TWAB balances.\\n     * @param user Address of the user whose TWABs are being fetched.\\n     * @param timestamps Timestamps range at which we want to retrieve the TWAB balances.\\n     * @return `user` TWAB balances.\\n     */\\n    function getBalancesAt(address user, uint64[] calldata timestamps)\\n        external\\n        view\\n        returns (uint256[] memory);\\n\\n    /**\\n     * @notice Retrieves the average balance held by a user for a given time frame.\\n     * @param user The user whose balance is checked.\\n     * @param startTime The start time of the time frame.\\n     * @param endTime The end time of the time frame.\\n     * @return The average balance that the user held during the time frame.\\n     */\\n    function getAverageBalanceBetween(\\n        address user,\\n        uint64 startTime,\\n        uint64 endTime\\n    ) external view returns (uint256);\\n\\n    /**\\n     * @notice Retrieves the average balances held by a user for a given time frame.\\n     * @param user The user whose balance is checked.\\n     * @param startTimes The start time of the time frame.\\n     * @param endTimes The end time of the time frame.\\n     * @return The average balance that the user held during the time frame.\\n     */\\n    function getAverageBalancesBetween(\\n        address user,\\n        uint64[] calldata startTimes,\\n        uint64[] calldata endTimes\\n    ) external view returns (uint256[] memory);\\n\\n    /**\\n     * @notice Retrieves the total supply TWAB balance at the given timestamp.\\n     * @param timestamp Timestamp at which we want to retrieve the total supply TWAB balance.\\n     * @return The total supply TWAB balance at the given timestamp.\\n     */\\n    function getTotalSupplyAt(uint64 timestamp) external view returns (uint256);\\n\\n    /**\\n     * @notice Retrieves the total supply TWAB balance between the given timestamps range.\\n     * @param timestamps Timestamps range at which we want to retrieve the total supply TWAB balance.\\n     * @return Total supply TWAB balances.\\n     */\\n    function getTotalSuppliesAt(uint64[] calldata timestamps)\\n        external\\n        view\\n        returns (uint256[] memory);\\n\\n    /**\\n     * @notice Retrieves the average total supply balance for a set of given time frames.\\n     * @param startTimes Array of start times.\\n     * @param endTimes Array of end times.\\n     * @return The average total supplies held during the time frame.\\n     */\\n    function getAverageTotalSuppliesBetween(\\n        uint64[] calldata startTimes,\\n        uint64[] calldata endTimes\\n    ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb9f6423a8a9c7394941cb84723b82cc66c5f815d689dc0562e612ae4d9f1cc27\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/ExtendedSafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary ExtendedSafeCastLib {\\n\\n    /**\\n     * @dev Returns the downcasted uint104 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint104).\\n     *\\n     * Counterpart to Solidity's `uint104` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 104 bits\\n     */\\n    function toUint104(uint256 _value) internal pure returns (uint104) {\\n        require(_value <= type(uint104).max, \\\"SafeCast: value doesn't fit in 104 bits\\\");\\n        return uint104(_value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint208 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint208).\\n     *\\n     * Counterpart to Solidity's `uint208` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 208 bits\\n     */\\n    function toUint208(uint256 _value) internal pure returns (uint208) {\\n        require(_value <= type(uint208).max, \\\"SafeCast: value doesn't fit in 208 bits\\\");\\n        return uint208(_value);\\n    }\\n\\n    /**\\n     * @dev Returns the downcasted uint224 from uint256, reverting on\\n     * overflow (when the input is greater than largest uint224).\\n     *\\n     * Counterpart to Solidity's `uint224` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - input must fit into 224 bits\\n     */\\n    function toUint224(uint256 _value) internal pure returns (uint224) {\\n        require(_value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n        return uint224(_value);\\n    }\\n}\\n\",\"keccak256\":\"0x1e8add7802f19dbf5957b4d921b2d7b5277f39c9e44505c0375e52f02134e434\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/ObservationLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\n\\nimport \\\"./OverflowSafeComparatorLib.sol\\\";\\nimport \\\"./RingBufferLib.sol\\\";\\n\\n/**\\n* @title Observation Library\\n* @notice This library allows one to store an array of timestamped values and efficiently binary search them.\\n* @dev Largely pulled from Uniswap V3 Oracle.sol: https://github.com/Uniswap/v3-core/blob/c05a0e2c8c08c460fb4d05cfdda30b3ad8deeaac/contracts/libraries/Oracle.sol\\n* @author PoolTogether Inc.\\n*/\\nlibrary ObservationLib {\\n    using OverflowSafeComparatorLib for uint32;\\n    using SafeCast for uint256;\\n\\n    /// @notice The maximum number of observations\\n    uint24 public constant MAX_CARDINALITY = 16777215; // 2**24\\n\\n    /**\\n    * @notice Observation, which includes an amount and timestamp.\\n    * @param amount `amount` at `timestamp`.\\n    * @param timestamp Recorded `timestamp`.\\n    */\\n    struct Observation {\\n        uint224 amount;\\n        uint32 timestamp;\\n    }\\n\\n    /**\\n    * @notice Fetches Observations `beforeOrAt` and `atOrAfter` a `_target`, eg: where [`beforeOrAt`, `atOrAfter`] is satisfied.\\n    * The result may be the same Observation, or adjacent Observations.\\n    * @dev The answer must be contained in the array used when the target is located within the stored Observation.\\n    * boundaries: older than the most recent Observation and younger, or the same age as, the oldest Observation.\\n    * @dev  If `_newestObservationIndex` is less than `_oldestObservationIndex`, it means that we've wrapped around the circular buffer.\\n    *       So the most recent observation will be at `_oldestObservationIndex + _cardinality - 1`, at the beginning of the circular buffer.\\n    * @param _observations List of Observations to search through.\\n    * @param _newestObservationIndex Index of the newest Observation. Right side of the circular buffer.\\n    * @param _oldestObservationIndex Index of the oldest Observation. Left side of the circular buffer.\\n    * @param _target Timestamp at which we are searching the Observation.\\n    * @param _cardinality Cardinality of the circular buffer we are searching through.\\n    * @param _time Timestamp at which we perform the binary search.\\n    * @return beforeOrAt Observation recorded before, or at, the target.\\n    * @return atOrAfter Observation recorded at, or after, the target.\\n    */\\n    function binarySearch(\\n        Observation[MAX_CARDINALITY] storage _observations,\\n        uint24 _newestObservationIndex,\\n        uint24 _oldestObservationIndex,\\n        uint32 _target,\\n        uint24 _cardinality,\\n        uint32 _time\\n    ) internal view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\\n        uint256 leftSide = _oldestObservationIndex;\\n        uint256 rightSide = _newestObservationIndex < leftSide\\n            ? leftSide + _cardinality - 1\\n            : _newestObservationIndex;\\n        uint256 currentIndex;\\n\\n        while (true) {\\n            // We start our search in the middle of the `leftSide` and `rightSide`.\\n            // After each iteration, we narrow down the search to the left or the right side while still starting our search in the middle.\\n            currentIndex = (leftSide + rightSide) / 2;\\n\\n            beforeOrAt = _observations[uint24(RingBufferLib.wrap(currentIndex, _cardinality))];\\n            uint32 beforeOrAtTimestamp = beforeOrAt.timestamp;\\n\\n            // We've landed on an uninitialized timestamp, keep searching higher (more recently).\\n            if (beforeOrAtTimestamp == 0) {\\n                leftSide = currentIndex + 1;\\n                continue;\\n            }\\n\\n            atOrAfter = _observations[uint24(RingBufferLib.nextIndex(currentIndex, _cardinality))];\\n\\n            bool targetAtOrAfter = beforeOrAtTimestamp.lte(_target, _time);\\n\\n            // Check if we've found the corresponding Observation.\\n            if (targetAtOrAfter && _target.lte(atOrAfter.timestamp, _time)) {\\n                break;\\n            }\\n\\n            // If `beforeOrAtTimestamp` is greater than `_target`, then we keep searching lower. To the left of the current index.\\n            if (!targetAtOrAfter) {\\n                rightSide = currentIndex - 1;\\n            } else {\\n                // Otherwise, we keep searching higher. To the left of the current index.\\n                leftSide = currentIndex + 1;\\n            }\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0x225592b42013fc0af60822e75bc047d53b42a5fcf15f2173cdc3b50bea334b0a\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/OverflowSafeComparatorLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/// @title OverflowSafeComparatorLib library to share comparator functions between contracts\\n/// @dev Code taken from Uniswap V3 Oracle.sol: https://github.com/Uniswap/v3-core/blob/3e88af408132fc957e3e406f65a0ce2b1ca06c3d/contracts/libraries/Oracle.sol\\n/// @author PoolTogether Inc.\\nlibrary OverflowSafeComparatorLib {\\n    /// @notice 32-bit timestamps comparator.\\n    /// @dev safe for 0 or 1 overflows, `_a` and `_b` must be chronologically before or equal to time.\\n    /// @param _a A comparison timestamp from which to determine the relative position of `_timestamp`.\\n    /// @param _b Timestamp to compare against `_a`.\\n    /// @param _timestamp A timestamp truncated to 32 bits.\\n    /// @return bool Whether `_a` is chronologically < `_b`.\\n    function lt(\\n        uint32 _a,\\n        uint32 _b,\\n        uint32 _timestamp\\n    ) internal pure returns (bool) {\\n        // No need to adjust if there hasn't been an overflow\\n        if (_a <= _timestamp && _b <= _timestamp) return _a < _b;\\n\\n        uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\\n        uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\\n\\n        return aAdjusted < bAdjusted;\\n    }\\n\\n    /// @notice 32-bit timestamps comparator.\\n    /// @dev safe for 0 or 1 overflows, `_a` and `_b` must be chronologically before or equal to time.\\n    /// @param _a A comparison timestamp from which to determine the relative position of `_timestamp`.\\n    /// @param _b Timestamp to compare against `_a`.\\n    /// @param _timestamp A timestamp truncated to 32 bits.\\n    /// @return bool Whether `_a` is chronologically <= `_b`.\\n    function lte(\\n        uint32 _a,\\n        uint32 _b,\\n        uint32 _timestamp\\n    ) internal pure returns (bool) {\\n\\n        // No need to adjust if there hasn't been an overflow\\n        if (_a <= _timestamp && _b <= _timestamp) return _a <= _b;\\n\\n        uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\\n        uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\\n\\n        return aAdjusted <= bAdjusted;\\n    }\\n\\n    /// @notice 32-bit timestamp subtractor\\n    /// @dev safe for 0 or 1 overflows, where `_a` and `_b` must be chronologically before or equal to time\\n    /// @param _a The subtraction left operand\\n    /// @param _b The subtraction right operand\\n    /// @param _timestamp The current time.  Expected to be chronologically after both.\\n    /// @return The difference between a and b, adjusted for overflow\\n    function checkedSub(\\n        uint32 _a,\\n        uint32 _b,\\n        uint32 _timestamp\\n    ) internal pure returns (uint32) {\\n        // No need to adjust if there hasn't been an overflow\\n\\n        if (_a <= _timestamp && _b <= _timestamp) return _a - _b;\\n\\n        uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\\n        uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\\n\\n        return uint32(aAdjusted - bAdjusted);\\n    }\\n}\\n\",\"keccak256\":\"0x20630cf89e7b92462946defe979fd0e69fa119841d55886121948ad810778c74\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/RingBufferLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nlibrary RingBufferLib {\\n    /**\\n    * @notice Returns wrapped TWAB index.\\n    * @dev  In order to navigate the TWAB circular buffer, we need to use the modulo operator.\\n    * @dev  For example, if `_index` is equal to 32 and the TWAB circular buffer is of `_cardinality` 32,\\n    *       it will return 0 and will point to the first element of the array.\\n    * @param _index Index used to navigate through the TWAB circular buffer.\\n    * @param _cardinality TWAB buffer cardinality.\\n    * @return TWAB index.\\n    */\\n    function wrap(uint256 _index, uint256 _cardinality) internal pure returns (uint256) {\\n        return _index % _cardinality;\\n    }\\n\\n    /**\\n    * @notice Computes the negative offset from the given index, wrapped by the cardinality.\\n    * @dev  We add `_cardinality` to `_index` to be able to offset even if `_amount` is superior to `_cardinality`.\\n    * @param _index The index from which to offset\\n    * @param _amount The number of indices to offset.  This is subtracted from the given index.\\n    * @param _cardinality The number of elements in the ring buffer\\n    * @return Offsetted index.\\n     */\\n    function offset(\\n        uint256 _index,\\n        uint256 _amount,\\n        uint256 _cardinality\\n    ) internal pure returns (uint256) {\\n        return wrap(_index + _cardinality - _amount, _cardinality);\\n    }\\n\\n    /// @notice Returns the index of the last recorded TWAB\\n    /// @param _nextIndex The next available twab index.  This will be recorded to next.\\n    /// @param _cardinality The cardinality of the TWAB history.\\n    /// @return The index of the last recorded TWAB\\n    function newestIndex(uint256 _nextIndex, uint256 _cardinality)\\n        internal\\n        pure\\n        returns (uint256)\\n    {\\n        if (_cardinality == 0) {\\n            return 0;\\n        }\\n\\n        return wrap(_nextIndex + _cardinality - 1, _cardinality);\\n    }\\n\\n    /// @notice Computes the ring buffer index that follows the given one, wrapped by cardinality\\n    /// @param _index The index to increment\\n    /// @param _cardinality The number of elements in the Ring Buffer\\n    /// @return The next index relative to the given index.  Will wrap around to 0 if the next index == cardinality\\n    function nextIndex(uint256 _index, uint256 _cardinality)\\n        internal\\n        pure\\n        returns (uint256)\\n    {\\n        return wrap(_index + 1, _cardinality);\\n    }\\n}\\n\",\"keccak256\":\"0x052e3bf6bfb30f32950e322c853589a8d153cf34f4b1ee292b17eb46f2ae656c\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/TwabLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"./ExtendedSafeCastLib.sol\\\";\\nimport \\\"./OverflowSafeComparatorLib.sol\\\";\\nimport \\\"./RingBufferLib.sol\\\";\\nimport \\\"./ObservationLib.sol\\\";\\n\\n/**\\n  * @title  PoolTogether V4 TwabLib (Library)\\n  * @author PoolTogether Inc Team\\n  * @dev    Time-Weighted Average Balance Library for ERC20 tokens.\\n  * @notice This TwabLib adds on-chain historical lookups to a user(s) time-weighted average balance.\\n            Each user is mapped to an Account struct containing the TWAB history (ring bufffer) and\\n            ring buffer parameters. Every token.transfer() creates a new TWAB checkpoint. The new TWAB\\n            checkpoint is stored in the circular ring buffer, as either a new checkpoint or rewriting\\n            a previous checkpoint with new parameters. The TwabLib (using existing blocktimes 1block/15sec)\\n            guarantees minimum 7.4 years of search history.\\n */\\nlibrary TwabLib {\\n    using OverflowSafeComparatorLib for uint32;\\n    using ExtendedSafeCastLib for uint256;\\n\\n    /**\\n      * @notice Sets max ring buffer length in the Account.twabs Observation list.\\n                As users transfer/mint/burn tickets new Observation checkpoints are\\n                recorded. The current max cardinality guarantees a six month minimum,\\n                of historical accurate lookups with current estimates of 1 new block\\n                every 15 seconds - the of course contain a transfer to trigger an\\n                observation write to storage.\\n      * @dev    The user Account.AccountDetails.cardinality parameter can NOT exceed\\n                the max cardinality variable. Preventing \\\"corrupted\\\" ring buffer lookup\\n                pointers and new observation checkpoints.\\n\\n                The MAX_CARDINALITY in fact guarantees at least 7.4 years of records:\\n                If 14 = block time in seconds\\n                (2**24) * 14 = 234881024 seconds of history\\n                234881024 / (365 * 24 * 60 * 60) ~= 7.44 years\\n    */\\n    uint24 public constant MAX_CARDINALITY = 16777215; // 2**24\\n\\n    /** @notice Struct ring buffer parameters for single user Account\\n      * @param balance       Current balance for an Account\\n      * @param nextTwabIndex Next uninitialized or updatable ring buffer checkpoint storage slot\\n      * @param cardinality   Current total \\\"initialized\\\" ring buffer checkpoints for single user AccountDetails.\\n                             Used to set initial boundary conditions for an efficient binary search.\\n    */\\n    struct AccountDetails {\\n        uint208 balance;\\n        uint24 nextTwabIndex;\\n        uint24 cardinality;\\n    }\\n\\n    /// @notice Combines account details with their twab history\\n    /// @param details The account details\\n    /// @param twabs The history of twabs for this account\\n    struct Account {\\n        AccountDetails details;\\n        ObservationLib.Observation[MAX_CARDINALITY] twabs;\\n    }\\n\\n    /// @notice Increases an account's balance and records a new twab.\\n    /// @param _account The account whose balance will be increased\\n    /// @param _amount The amount to increase the balance by\\n    /// @param _currentTime The current time\\n    /// @return accountDetails The new AccountDetails\\n    /// @return twab The user's latest TWAB\\n    /// @return isNew Whether the TWAB is new\\n    function increaseBalance(\\n        Account storage _account,\\n        uint208 _amount,\\n        uint32 _currentTime\\n    )\\n        internal\\n        returns (\\n            AccountDetails memory accountDetails,\\n            ObservationLib.Observation memory twab,\\n            bool isNew\\n        )\\n    {\\n        AccountDetails memory _accountDetails = _account.details;\\n        (accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);\\n        accountDetails.balance = _accountDetails.balance + _amount;\\n    }\\n\\n    /** @notice Calculates the next TWAB checkpoint for an account with a decreasing balance.\\n     * @dev    With Account struct and amount decreasing calculates the next TWAB observable checkpoint.\\n     * @param _account        Account whose balance will be decreased\\n     * @param _amount         Amount to decrease the balance by\\n     * @param _revertMessage  Revert message for insufficient balance\\n     * @return accountDetails Updated Account.details struct\\n     * @return twab           TWAB observation (with decreasing average)\\n     * @return isNew          Whether TWAB is new or calling twice in the same block\\n     */\\n    function decreaseBalance(\\n        Account storage _account,\\n        uint208 _amount,\\n        string memory _revertMessage,\\n        uint32 _currentTime\\n    )\\n        internal\\n        returns (\\n            AccountDetails memory accountDetails,\\n            ObservationLib.Observation memory twab,\\n            bool isNew\\n        )\\n    {\\n        AccountDetails memory _accountDetails = _account.details;\\n\\n        require(_accountDetails.balance >= _amount, _revertMessage);\\n\\n        (accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);\\n        unchecked {\\n            accountDetails.balance -= _amount;\\n        }\\n    }\\n\\n    /** @notice Calculates the average balance held by a user for a given time frame.\\n      * @dev    Finds the average balance between start and end timestamp epochs.\\n                Validates the supplied end time is within the range of elapsed time i.e. less then timestamp of now.\\n      * @param _twabs          Individual user Observation recorded checkpoints passed as storage pointer\\n      * @param _accountDetails User AccountDetails struct loaded in memory\\n      * @param _startTime      Start of timestamp range as an epoch\\n      * @param _endTime        End of timestamp range as an epoch\\n      * @param _currentTime    Block.timestamp\\n      * @return Average balance of user held between epoch timestamps start and end\\n    */\\n    function getAverageBalanceBetween(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails,\\n        uint32 _startTime,\\n        uint32 _endTime,\\n        uint32 _currentTime\\n    ) internal view returns (uint256) {\\n        uint32 endTime = _endTime > _currentTime ? _currentTime : _endTime;\\n\\n        return\\n            _getAverageBalanceBetween(_twabs, _accountDetails, _startTime, endTime, _currentTime);\\n    }\\n\\n    /// @notice Retrieves the oldest TWAB\\n    /// @param _twabs The storage array of twabs\\n    /// @param _accountDetails The TWAB account details\\n    /// @return index The index of the oldest TWAB in the twabs array\\n    /// @return twab The oldest TWAB\\n    function oldestTwab(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails\\n    ) internal view returns (uint24 index, ObservationLib.Observation memory twab) {\\n        index = _accountDetails.nextTwabIndex;\\n        twab = _twabs[index];\\n\\n        // If the TWAB is not initialized we go to the beginning of the TWAB circular buffer at index 0\\n        if (twab.timestamp == 0) {\\n            index = 0;\\n            twab = _twabs[0];\\n        }\\n    }\\n\\n    /// @notice Retrieves the newest TWAB\\n    /// @param _twabs The storage array of twabs\\n    /// @param _accountDetails The TWAB account details\\n    /// @return index The index of the newest TWAB in the twabs array\\n    /// @return twab The newest TWAB\\n    function newestTwab(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails\\n    ) internal view returns (uint24 index, ObservationLib.Observation memory twab) {\\n        index = uint24(RingBufferLib.newestIndex(_accountDetails.nextTwabIndex, MAX_CARDINALITY));\\n        twab = _twabs[index];\\n    }\\n\\n    /// @notice Retrieves amount at `_targetTime` timestamp\\n    /// @param _twabs List of TWABs to search through.\\n    /// @param _accountDetails Accounts details\\n    /// @param _targetTime Timestamp at which the reserved TWAB should be for.\\n    /// @return uint256 TWAB amount at `_targetTime`.\\n    function getBalanceAt(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails,\\n        uint32 _targetTime,\\n        uint32 _currentTime\\n    ) internal view returns (uint256) {\\n        uint32 timeToTarget = _targetTime > _currentTime ? _currentTime : _targetTime;\\n        return _getBalanceAt(_twabs, _accountDetails, timeToTarget, _currentTime);\\n    }\\n\\n    /// @notice Calculates the average balance held by a user for a given time frame.\\n    /// @param _startTime The start time of the time frame.\\n    /// @param _endTime The end time of the time frame.\\n    /// @return The average balance that the user held during the time frame.\\n    function _getAverageBalanceBetween(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails,\\n        uint32 _startTime,\\n        uint32 _endTime,\\n        uint32 _currentTime\\n    ) private view returns (uint256) {\\n        (uint24 oldestTwabIndex, ObservationLib.Observation memory oldTwab) = oldestTwab(\\n            _twabs,\\n            _accountDetails\\n        );\\n\\n        (uint24 newestTwabIndex, ObservationLib.Observation memory newTwab) = newestTwab(\\n            _twabs,\\n            _accountDetails\\n        );\\n\\n        ObservationLib.Observation memory startTwab = _calculateTwab(\\n            _twabs,\\n            _accountDetails,\\n            newTwab,\\n            oldTwab,\\n            newestTwabIndex,\\n            oldestTwabIndex,\\n            _startTime,\\n            _currentTime\\n        );\\n\\n        ObservationLib.Observation memory endTwab = _calculateTwab(\\n            _twabs,\\n            _accountDetails,\\n            newTwab,\\n            oldTwab,\\n            newestTwabIndex,\\n            oldestTwabIndex,\\n            _endTime,\\n            _currentTime\\n        );\\n\\n        // Difference in amount / time\\n        return (endTwab.amount - startTwab.amount) / OverflowSafeComparatorLib.checkedSub(endTwab.timestamp, startTwab.timestamp, _currentTime);\\n    }\\n\\n    /** @notice Searches TWAB history and calculate the difference between amount(s)/timestamp(s) to return average balance\\n                between the Observations closes to the supplied targetTime.\\n      * @param _twabs          Individual user Observation recorded checkpoints passed as storage pointer\\n      * @param _accountDetails User AccountDetails struct loaded in memory\\n      * @param _targetTime     Target timestamp to filter Observations in the ring buffer binary search\\n      * @param _currentTime    Block.timestamp\\n      * @return uint256 Time-weighted average amount between two closest observations.\\n    */\\n    function _getBalanceAt(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails,\\n        uint32 _targetTime,\\n        uint32 _currentTime\\n    ) private view returns (uint256) {\\n        uint24 newestTwabIndex;\\n        ObservationLib.Observation memory afterOrAt;\\n        ObservationLib.Observation memory beforeOrAt;\\n        (newestTwabIndex, beforeOrAt) = newestTwab(_twabs, _accountDetails);\\n\\n        // If `_targetTime` is chronologically after the newest TWAB, we can simply return the current balance\\n        if (beforeOrAt.timestamp.lte(_targetTime, _currentTime)) {\\n            return _accountDetails.balance;\\n        }\\n\\n        uint24 oldestTwabIndex;\\n        // Now, set before to the oldest TWAB\\n        (oldestTwabIndex, beforeOrAt) = oldestTwab(_twabs, _accountDetails);\\n\\n        // If `_targetTime` is chronologically before the oldest TWAB, we can early return\\n        if (_targetTime.lt(beforeOrAt.timestamp, _currentTime)) {\\n            return 0;\\n        }\\n\\n        // Otherwise, we perform the `binarySearch`\\n        (beforeOrAt, afterOrAt) = ObservationLib.binarySearch(\\n            _twabs,\\n            newestTwabIndex,\\n            oldestTwabIndex,\\n            _targetTime,\\n            _accountDetails.cardinality,\\n            _currentTime\\n        );\\n\\n        // Sum the difference in amounts and divide by the difference in timestamps.\\n        // The time-weighted average balance uses time measured between two epoch timestamps as\\n        // a constaint on the measurement when calculating the time weighted average balance.\\n        return\\n            (afterOrAt.amount - beforeOrAt.amount) / OverflowSafeComparatorLib.checkedSub(afterOrAt.timestamp, beforeOrAt.timestamp, _currentTime);\\n    }\\n\\n    /** @notice Calculates a user TWAB for a target timestamp using the historical TWAB records.\\n                The balance is linearly interpolated: amount differences / timestamp differences\\n                using the simple (after.amount - before.amount / end.timestamp - start.timestamp) formula.\\n    /** @dev    Binary search in _calculateTwab fails when searching out of bounds. Thus, before\\n                searching we exclude target timestamps out of range of newest/oldest TWAB(s).\\n                IF a search is before or after the range we \\\"extrapolate\\\" a Observation from the expected state.\\n      * @param _twabs           Individual user Observation recorded checkpoints passed as storage pointer\\n      * @param _accountDetails  User AccountDetails struct loaded in memory\\n      * @param _newestTwab      Newest TWAB in history (end of ring buffer)\\n      * @param _oldestTwab      Olderst TWAB in history (end of ring buffer)\\n      * @param _newestTwabIndex Pointer in ring buffer to newest TWAB\\n      * @param _oldestTwabIndex Pointer in ring buffer to oldest TWAB\\n      * @param _targetTimestamp Epoch timestamp to calculate for time (T) in the TWAB\\n      * @param _time            Block.timestamp\\n      * @return accountDetails Updated Account.details struct\\n    */\\n    function _calculateTwab(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails,\\n        ObservationLib.Observation memory _newestTwab,\\n        ObservationLib.Observation memory _oldestTwab,\\n        uint24 _newestTwabIndex,\\n        uint24 _oldestTwabIndex,\\n        uint32 _targetTimestamp,\\n        uint32 _time\\n    ) private view returns (ObservationLib.Observation memory) {\\n        // If `_targetTimestamp` is chronologically after the newest TWAB, we extrapolate a new one\\n        if (_newestTwab.timestamp.lt(_targetTimestamp, _time)) {\\n            return _computeNextTwab(_newestTwab, _accountDetails.balance, _targetTimestamp);\\n        }\\n\\n        if (_newestTwab.timestamp == _targetTimestamp) {\\n            return _newestTwab;\\n        }\\n\\n        if (_oldestTwab.timestamp == _targetTimestamp) {\\n            return _oldestTwab;\\n        }\\n\\n        // If `_targetTimestamp` is chronologically before the oldest TWAB, we create a zero twab\\n        if (_targetTimestamp.lt(_oldestTwab.timestamp, _time)) {\\n            return ObservationLib.Observation({ amount: 0, timestamp: _targetTimestamp });\\n        }\\n\\n        // Otherwise, both timestamps must be surrounded by twabs.\\n        (\\n            ObservationLib.Observation memory beforeOrAtStart,\\n            ObservationLib.Observation memory afterOrAtStart\\n        ) = ObservationLib.binarySearch(\\n                _twabs,\\n                _newestTwabIndex,\\n                _oldestTwabIndex,\\n                _targetTimestamp,\\n                _accountDetails.cardinality,\\n                _time\\n            );\\n\\n        uint224 heldBalance = (afterOrAtStart.amount - beforeOrAtStart.amount) /\\n            OverflowSafeComparatorLib.checkedSub(afterOrAtStart.timestamp, beforeOrAtStart.timestamp, _time);\\n\\n        return _computeNextTwab(beforeOrAtStart, heldBalance, _targetTimestamp);\\n    }\\n\\n    /**\\n     * @notice Calculates the next TWAB using the newestTwab and updated balance.\\n     * @dev    Storage of the TWAB obersation is managed by the calling function and not _computeNextTwab.\\n     * @param _currentTwab    Newest Observation in the Account.twabs list\\n     * @param _currentBalance User balance at time of most recent (newest) checkpoint write\\n     * @param _time           Current block.timestamp\\n     * @return TWAB Observation\\n     */\\n    function _computeNextTwab(\\n        ObservationLib.Observation memory _currentTwab,\\n        uint224 _currentBalance,\\n        uint32 _time\\n    ) private pure returns (ObservationLib.Observation memory) {\\n        // New twab amount = last twab amount (or zero) + (current amount * elapsed seconds)\\n        return\\n            ObservationLib.Observation({\\n                amount: _currentTwab.amount +\\n                    _currentBalance *\\n                    (_time.checkedSub(_currentTwab.timestamp, _time)),\\n                timestamp: _time\\n            });\\n    }\\n\\n    /// @notice Sets a new TWAB Observation at the next available index and returns the new account details.\\n    /// @dev Note that if _currentTime is before the last observation timestamp, it appears as an overflow\\n    /// @param _twabs The twabs array to insert into\\n    /// @param _accountDetails The current account details\\n    /// @param _currentTime The current time\\n    /// @return accountDetails The new account details\\n    /// @return twab The newest twab (may or may not be brand-new)\\n    /// @return isNew Whether the newest twab was created by this call\\n    function _nextTwab(\\n        ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n        AccountDetails memory _accountDetails,\\n        uint32 _currentTime\\n    )\\n        private\\n        returns (\\n            AccountDetails memory accountDetails,\\n            ObservationLib.Observation memory twab,\\n            bool isNew\\n        )\\n    {\\n        (, ObservationLib.Observation memory _newestTwab) = newestTwab(_twabs, _accountDetails);\\n\\n        // if we're in the same block, return\\n        if (_newestTwab.timestamp == _currentTime) {\\n            return (_accountDetails, _newestTwab, false);\\n        }\\n\\n        ObservationLib.Observation memory newTwab = _computeNextTwab(\\n            _newestTwab,\\n            _accountDetails.balance,\\n            _currentTime\\n        );\\n\\n        _twabs[_accountDetails.nextTwabIndex] = newTwab;\\n\\n        AccountDetails memory nextAccountDetails = push(_accountDetails);\\n\\n        return (nextAccountDetails, newTwab, true);\\n    }\\n\\n    /// @notice \\\"Pushes\\\" a new element on the AccountDetails ring buffer, and returns the new AccountDetails\\n    /// @param _accountDetails The account details from which to pull the cardinality and next index\\n    /// @return The new AccountDetails\\n    function push(AccountDetails memory _accountDetails)\\n        internal\\n        pure\\n        returns (AccountDetails memory)\\n    {\\n        _accountDetails.nextTwabIndex = uint24(\\n            RingBufferLib.nextIndex(_accountDetails.nextTwabIndex, MAX_CARDINALITY)\\n        );\\n\\n        // Prevent the Account specific cardinality from exceeding the MAX_CARDINALITY.\\n        // The ring buffer length is limited by MAX_CARDINALITY. IF the account.cardinality\\n        // exceeds the max cardinality, new observations would be incorrectly set or the\\n        // observation would be out of \\\"bounds\\\" of the ring buffer. Once reached the\\n        // AccountDetails.cardinality will continue to be equal to max cardinality.\\n        if (_accountDetails.cardinality < MAX_CARDINALITY) {\\n            _accountDetails.cardinality += 1;\\n        }\\n\\n        return _accountDetails;\\n    }\\n}\\n\",\"keccak256\":\"0xa9cd1103707325d2eaba038d7c0f2b271d934448b8782b82f922653eccb8c90a\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/permit/EIP2612PermitAndDeposit.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport \\\"../interfaces/IPrizePool.sol\\\";\\nimport \\\"../interfaces/ITicket.sol\\\";\\n\\n/**\\n * @notice Secp256k1 signature values.\\n * @param deadline Timestamp at which the signature expires\\n * @param v `v` portion of the signature\\n * @param r `r` portion of the signature\\n * @param s `s` portion of the signature\\n */\\nstruct Signature {\\n    uint256 deadline;\\n    uint8 v;\\n    bytes32 r;\\n    bytes32 s;\\n}\\n\\n/**\\n * @notice Delegate signature to allow delegation of tickets to delegate.\\n * @param delegate Address to delegate the prize pool tickets to\\n * @param signature Delegate signature\\n */\\nstruct DelegateSignature {\\n    address delegate;\\n    Signature signature;\\n}\\n\\n/// @title Allows users to approve and deposit EIP-2612 compatible tokens into a prize pool in a single transaction.\\n/// @custom:experimental This contract has not been fully audited yet.\\ncontract EIP2612PermitAndDeposit {\\n    using SafeERC20 for IERC20;\\n\\n    /**\\n     * @notice Permits this contract to spend on a user's behalf and deposits into the prize pool.\\n     * @dev The `spender` address required by the permit function is the address of this contract.\\n     * @param _prizePool Address of the prize pool to deposit into\\n     * @param _amount Amount of tokens to deposit into the prize pool\\n     * @param _to Address that will receive the tickets\\n     * @param _permitSignature Permit signature\\n     * @param _delegateSignature Delegate signature\\n     */\\n    function permitAndDepositToAndDelegate(\\n        IPrizePool _prizePool,\\n        uint256 _amount,\\n        address _to,\\n        Signature calldata _permitSignature,\\n        DelegateSignature calldata _delegateSignature\\n    ) external {\\n        ITicket _ticket = _prizePool.getTicket();\\n        address _token = _prizePool.getToken();\\n\\n        IERC20Permit(_token).permit(\\n            msg.sender,\\n            address(this),\\n            _amount,\\n            _permitSignature.deadline,\\n            _permitSignature.v,\\n            _permitSignature.r,\\n            _permitSignature.s\\n        );\\n\\n        _depositToAndDelegate(\\n            address(_prizePool),\\n            _ticket,\\n            _token,\\n            _amount,\\n            _to,\\n            _delegateSignature\\n        );\\n    }\\n\\n    /**\\n     * @notice Deposits user's token into the prize pool and delegate tickets.\\n     * @param _prizePool Address of the prize pool to deposit into\\n     * @param _amount Amount of tokens to deposit into the prize pool\\n     * @param _to Address that will receive the tickets\\n     * @param _delegateSignature Delegate signature\\n     */\\n    function depositToAndDelegate(\\n        IPrizePool _prizePool,\\n        uint256 _amount,\\n        address _to,\\n        DelegateSignature calldata _delegateSignature\\n    ) external {\\n        ITicket _ticket = _prizePool.getTicket();\\n        address _token = _prizePool.getToken();\\n\\n        _depositToAndDelegate(\\n            address(_prizePool),\\n            _ticket,\\n            _token,\\n            _amount,\\n            _to,\\n            _delegateSignature\\n        );\\n    }\\n\\n    /**\\n     * @notice Deposits user's token into the prize pool and delegate tickets.\\n     * @param _prizePool Address of the prize pool to deposit into\\n     * @param _ticket Address of the ticket minted by the prize pool\\n     * @param _token Address of the token used to deposit into the prize pool\\n     * @param _amount Amount of tokens to deposit into the prize pool\\n     * @param _to Address that will receive the tickets\\n     * @param _delegateSignature Delegate signature\\n     */\\n    function _depositToAndDelegate(\\n        address _prizePool,\\n        ITicket _ticket,\\n        address _token,\\n        uint256 _amount,\\n        address _to,\\n        DelegateSignature calldata _delegateSignature\\n    ) internal {\\n        _depositTo(_token, msg.sender, _amount, _prizePool, _to);\\n\\n        Signature memory signature = _delegateSignature.signature;\\n\\n        _ticket.delegateWithSignature(\\n            _to,\\n            _delegateSignature.delegate,\\n            signature.deadline,\\n            signature.v,\\n            signature.r,\\n            signature.s\\n        );\\n    }\\n\\n    /**\\n     * @notice Deposits user's token into the prize pool.\\n     * @param _token Address of the EIP-2612 token to approve and deposit\\n     * @param _owner Token owner's address (Authorizer)\\n     * @param _amount Amount of tokens to deposit\\n     * @param _prizePool Address of the prize pool to deposit into\\n     * @param _to Address that will receive the tickets\\n     */\\n    function _depositTo(\\n        address _token,\\n        address _owner,\\n        uint256 _amount,\\n        address _prizePool,\\n        address _to\\n    ) internal {\\n        IERC20(_token).safeTransferFrom(_owner, address(this), _amount);\\n        IERC20(_token).safeIncreaseAllowance(_prizePool, _amount);\\n        IPrizePool(_prizePool).depositTo(_to, _amount);\\n    }\\n}\\n\",\"keccak256\":\"0x3144c696947c8ff9f694c87f82f54a96d2c443616f1aabf6e37c6e7e42070779\",\"license\":\"GPL-3.0\"}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b50610c29806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a81bc43b1461003b578063c00dbd5114610050575b600080fd5b61004e6100493660046109cd565b610063565b005b61004e61005e36600461097a565b61022a565b6000856001600160a01b031663c002c4d66040518163ffffffff1660e01b815260040160206040518083038186803b15801561009e57600080fd5b505afa1580156100b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d6919061093b565b90506000866001600160a01b03166321df0da76040518163ffffffff1660e01b815260040160206040518083038186803b15801561011357600080fd5b505afa158015610127573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014b919061093b565b90506001600160a01b03811663d505accf333089883561017160408b0160208c01610b06565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b1681526001600160a01b0396871660048201529590941660248601526044850192909252606484015260ff16608483015287013560a4820152606087013560c482015260e401600060405180830381600087803b1580156101fb57600080fd5b505af115801561020f573d6000803e3d6000fd5b5050505061022187838389898861032a565b50505050505050565b6000846001600160a01b031663c002c4d66040518163ffffffff1660e01b815260040160206040518083038186803b15801561026557600080fd5b505afa158015610279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029d919061093b565b90506000856001600160a01b03166321df0da76040518163ffffffff1660e01b815260040160206040518083038186803b1580156102da57600080fd5b505afa1580156102ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610312919061093b565b905061032286838388888861032a565b505050505050565b610337843385898661041b565b600061034b36839003830160208401610a5b565b90506001600160a01b03861663919974dc8461036a602086018661091e565b845160208601516040808801516060890151915160e088901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039687166004820152959094166024860152604485019290925260ff166064840152608483019190915260a482015260c401600060405180830381600087803b1580156103fa57600080fd5b505af115801561040e573d6000803e3d6000fd5b5050505050505050505050565b6104306001600160a01b0386168530866104c6565b6104446001600160a01b038616838561057d565b6040517fffaad6a50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526024820185905283169063ffaad6a590604401600060405180830381600087803b1580156104a757600080fd5b505af11580156104bb573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526105779085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610670565b50505050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b1580156105e257600080fd5b505afa1580156105f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061a9190610aed565b6106249190610b70565b6040516001600160a01b0385166024820152604481018290529091506105779085907f095ea7b30000000000000000000000000000000000000000000000000000000090606401610513565b60006106c5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661075f9092919063ffffffff16565b80519091501561075a57808060200190518101906106e39190610958565b61075a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b505050565b606061076e8484600085610778565b90505b9392505050565b6060824710156107f05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610751565b843b61083e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610751565b600080866001600160a01b0316858760405161085a9190610b21565b60006040518083038185875af1925050503d8060008114610897576040519150601f19603f3d011682016040523d82523d6000602084013e61089c565b606091505b50915091506108ac8282866108b7565b979650505050505050565b606083156108c6575081610771565b8251156108d65782518084602001fd5b8160405162461bcd60e51b81526004016107519190610b3d565b600060a0828403121561090257600080fd5b50919050565b803560ff8116811461091957600080fd5b919050565b60006020828403121561093057600080fd5b813561077181610bdb565b60006020828403121561094d57600080fd5b815161077181610bdb565b60006020828403121561096a57600080fd5b8151801515811461077157600080fd5b600080600080610100858703121561099157600080fd5b843561099c81610bdb565b93506020850135925060408501356109b381610bdb565b91506109c286606087016108f0565b905092959194509250565b60008060008060008587036101808112156109e757600080fd5b86356109f281610bdb565b9550602087013594506040870135610a0981610bdb565b935060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa082011215610a3b57600080fd5b50606086019150610a4f8760e088016108f0565b90509295509295909350565b600060808284031215610a6d57600080fd5b6040516080810181811067ffffffffffffffff82111715610ab7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405282358152610aca60208401610908565b602082015260408301356040820152606083013560608201528091505092915050565b600060208284031215610aff57600080fd5b5051919050565b600060208284031215610b1857600080fd5b61077182610908565b60008251610b33818460208701610baf565b9190910192915050565b6020815260008251806020840152610b5c816040850160208701610baf565b601f01601f19169190910160400192915050565b60008219821115610baa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b60005b83811015610bca578181015183820152602001610bb2565b838111156105775750506000910152565b6001600160a01b0381168114610bf057600080fd5b5056fea26469706673582212207593ea4afc2abd6c493bf3ab64dbfff92da0ab0e49d90eec6f1fcdf1320c585864736f6c63430008060033",
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a81bc43b1461003b578063c00dbd5114610050575b600080fd5b61004e6100493660046109cd565b610063565b005b61004e61005e36600461097a565b61022a565b6000856001600160a01b031663c002c4d66040518163ffffffff1660e01b815260040160206040518083038186803b15801561009e57600080fd5b505afa1580156100b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d6919061093b565b90506000866001600160a01b03166321df0da76040518163ffffffff1660e01b815260040160206040518083038186803b15801561011357600080fd5b505afa158015610127573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014b919061093b565b90506001600160a01b03811663d505accf333089883561017160408b0160208c01610b06565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b1681526001600160a01b0396871660048201529590941660248601526044850192909252606484015260ff16608483015287013560a4820152606087013560c482015260e401600060405180830381600087803b1580156101fb57600080fd5b505af115801561020f573d6000803e3d6000fd5b5050505061022187838389898861032a565b50505050505050565b6000846001600160a01b031663c002c4d66040518163ffffffff1660e01b815260040160206040518083038186803b15801561026557600080fd5b505afa158015610279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029d919061093b565b90506000856001600160a01b03166321df0da76040518163ffffffff1660e01b815260040160206040518083038186803b1580156102da57600080fd5b505afa1580156102ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610312919061093b565b905061032286838388888861032a565b505050505050565b610337843385898661041b565b600061034b36839003830160208401610a5b565b90506001600160a01b03861663919974dc8461036a602086018661091e565b845160208601516040808801516060890151915160e088901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039687166004820152959094166024860152604485019290925260ff166064840152608483019190915260a482015260c401600060405180830381600087803b1580156103fa57600080fd5b505af115801561040e573d6000803e3d6000fd5b5050505050505050505050565b6104306001600160a01b0386168530866104c6565b6104446001600160a01b038616838561057d565b6040517fffaad6a50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526024820185905283169063ffaad6a590604401600060405180830381600087803b1580156104a757600080fd5b505af11580156104bb573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526105779085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610670565b50505050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b1580156105e257600080fd5b505afa1580156105f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061a9190610aed565b6106249190610b70565b6040516001600160a01b0385166024820152604481018290529091506105779085907f095ea7b30000000000000000000000000000000000000000000000000000000090606401610513565b60006106c5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661075f9092919063ffffffff16565b80519091501561075a57808060200190518101906106e39190610958565b61075a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b505050565b606061076e8484600085610778565b90505b9392505050565b6060824710156107f05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610751565b843b61083e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610751565b600080866001600160a01b0316858760405161085a9190610b21565b60006040518083038185875af1925050503d8060008114610897576040519150601f19603f3d011682016040523d82523d6000602084013e61089c565b606091505b50915091506108ac8282866108b7565b979650505050505050565b606083156108c6575081610771565b8251156108d65782518084602001fd5b8160405162461bcd60e51b81526004016107519190610b3d565b600060a0828403121561090257600080fd5b50919050565b803560ff8116811461091957600080fd5b919050565b60006020828403121561093057600080fd5b813561077181610bdb565b60006020828403121561094d57600080fd5b815161077181610bdb565b60006020828403121561096a57600080fd5b8151801515811461077157600080fd5b600080600080610100858703121561099157600080fd5b843561099c81610bdb565b93506020850135925060408501356109b381610bdb565b91506109c286606087016108f0565b905092959194509250565b60008060008060008587036101808112156109e757600080fd5b86356109f281610bdb565b9550602087013594506040870135610a0981610bdb565b935060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa082011215610a3b57600080fd5b50606086019150610a4f8760e088016108f0565b90509295509295909350565b600060808284031215610a6d57600080fd5b6040516080810181811067ffffffffffffffff82111715610ab7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405282358152610aca60208401610908565b602082015260408301356040820152606083013560608201528091505092915050565b600060208284031215610aff57600080fd5b5051919050565b600060208284031215610b1857600080fd5b61077182610908565b60008251610b33818460208701610baf565b9190910192915050565b6020815260008251806020840152610b5c816040850160208701610baf565b601f01601f19169190910160400192915050565b60008219821115610baa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b60005b83811015610bca578181015183820152602001610bb2565b838111156105775750506000910152565b6001600160a01b0381168114610bf057600080fd5b5056fea26469706673582212207593ea4afc2abd6c493bf3ab64dbfff92da0ab0e49d90eec6f1fcdf1320c585864736f6c63430008060033",
  "devdoc": {
    "custom:experimental": "This contract has not been fully audited yet.",
    "kind": "dev",
    "methods": {
      "depositToAndDelegate(address,uint256,address,(address,(uint256,uint8,bytes32,bytes32)))": {
        "params": {
          "_amount": "Amount of tokens to deposit into the prize pool",
          "_delegateSignature": "Delegate signature",
          "_prizePool": "Address of the prize pool to deposit into",
          "_to": "Address that will receive the tickets"
        }
      },
      "permitAndDepositToAndDelegate(address,uint256,address,(uint256,uint8,bytes32,bytes32),(address,(uint256,uint8,bytes32,bytes32)))": {
        "details": "The `spender` address required by the permit function is the address of this contract.",
        "params": {
          "_amount": "Amount of tokens to deposit into the prize pool",
          "_delegateSignature": "Delegate signature",
          "_permitSignature": "Permit signature",
          "_prizePool": "Address of the prize pool to deposit into",
          "_to": "Address that will receive the tickets"
        }
      }
    },
    "title": "Allows users to approve and deposit EIP-2612 compatible tokens into a prize pool in a single transaction.",
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "depositToAndDelegate(address,uint256,address,(address,(uint256,uint8,bytes32,bytes32)))": {
        "notice": "Deposits user's token into the prize pool and delegate tickets."
      },
      "permitAndDepositToAndDelegate(address,uint256,address,(uint256,uint8,bytes32,bytes32),(address,(uint256,uint8,bytes32,bytes32)))": {
        "notice": "Permits this contract to spend on a user's behalf and deposits into the prize pool."
      }
    },
    "version": 1
  },
  "storageLayout": {
    "storage": [],
    "types": null
  }
}