{
  "format": "talon-contract-sources-v1",
  "chainId": 4663,
  "nft": "0x43Fda6A15Fe33539b640116Fdbd1C96534DAA406",
  "verification": "Sources match compiler metadata; compiled runtimes match deployed code after masking immutable references. Governance and immutable bindings are checked by the release verifier. This is not an external audit.",
  "sources": {
    "lib/openzeppelin-contracts/contracts/access/AccessControl.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    mapping(bytes32 role => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n        return _roles[role].hasRole[account];\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n     * is missing `role`.\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert AccessControlUnauthorizedAccount(account, role);\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n        if (callerConfirmation != _msgSender()) {\n            revert AccessControlBadConfirmation();\n        }\n\n        _revokeRole(role, callerConfirmation);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        _roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n        if (!hasRole(role, account)) {\n            _roles[role].hasRole[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n        if (hasRole(role, account)) {\n            _roles[role].hasRole[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n",
      "keccak256": "0x1a6b4f6b7798ab80929d491b89d5427a9b3338c0fd1acd0ba325f69c6f1646af"
    },
    "lib/openzeppelin-contracts/contracts/access/IAccessControl.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/IAccessControl.sol)\n\npragma solidity >=0.8.4;\n\n/**\n * @dev External interface of AccessControl declared to support ERC-165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev The `account` is missing a role.\n     */\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n    /**\n     * @dev The caller of a function is not the expected one.\n     *\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n     */\n    error AccessControlBadConfirmation();\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted to signal this.\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).\n     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n",
      "keccak256": "0xbff9f59c84e5337689161ce7641c0ef8e872d6a7536fbc1f5133f128887aba3c"
    },
    "lib/openzeppelin-contracts/contracts/governance/TimelockController.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (governance/TimelockController.sol)\n\npragma solidity ^0.8.20;\n\nimport {AccessControl} from \"../access/AccessControl.sol\";\nimport {ERC721Holder} from \"../token/ERC721/utils/ERC721Holder.sol\";\nimport {ERC1155Holder} from \"../token/ERC1155/utils/ERC1155Holder.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {IERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module which acts as a timelocked controller. When set as the\n * owner of an `Ownable` smart contract, it enforces a timelock on all\n * `onlyOwner` maintenance operations. This gives time for users of the\n * controlled contract to exit before a potentially dangerous maintenance\n * operation is applied.\n *\n * By default, this contract is self administered, meaning administration tasks\n * have to go through the timelock process. The proposer (resp executor) role\n * is in charge of proposing (resp executing) operations. A common use case is\n * to position this {TimelockController} as the owner of a smart contract, with\n * a multisig or a DAO as the sole proposer.\n */\ncontract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {\n    bytes32 public constant PROPOSER_ROLE = keccak256(\"PROPOSER_ROLE\");\n    bytes32 public constant EXECUTOR_ROLE = keccak256(\"EXECUTOR_ROLE\");\n    bytes32 public constant CANCELLER_ROLE = keccak256(\"CANCELLER_ROLE\");\n    uint256 internal constant DONE_TIMESTAMP = uint256(1);\n\n    mapping(bytes32 id => uint256) private _timestamps;\n    uint256 private _minDelay;\n\n    enum OperationState {\n        Unset,\n        Waiting,\n        Ready,\n        Done\n    }\n\n    /**\n     * @dev Mismatch between the parameters length for an operation call.\n     */\n    error TimelockInvalidOperationLength(uint256 targets, uint256 payloads, uint256 values);\n\n    /**\n     * @dev The schedule operation doesn't meet the minimum delay.\n     */\n    error TimelockInsufficientDelay(uint256 delay, uint256 minDelay);\n\n    /**\n     * @dev The current state of an operation is not as required.\n     * The `expectedStates` is a bitmap with the bits enabled for each OperationState enum position\n     * counting from right to left.\n     *\n     * See {_encodeStateBitmap}.\n     */\n    error TimelockUnexpectedOperationState(bytes32 operationId, bytes32 expectedStates);\n\n    /**\n     * @dev The predecessor to an operation not yet done.\n     */\n    error TimelockUnexecutedPredecessor(bytes32 predecessorId);\n\n    /**\n     * @dev The caller account is not authorized.\n     */\n    error TimelockUnauthorizedCaller(address caller);\n\n    /**\n     * @dev Emitted when a call is scheduled as part of operation `id`.\n     */\n    event CallScheduled(\n        bytes32 indexed id,\n        uint256 indexed index,\n        address target,\n        uint256 value,\n        bytes data,\n        bytes32 predecessor,\n        uint256 delay\n    );\n\n    /**\n     * @dev Emitted when a call is performed as part of operation `id`.\n     */\n    event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data);\n\n    /**\n     * @dev Emitted when new proposal is scheduled with non-zero salt.\n     */\n    event CallSalt(bytes32 indexed id, bytes32 salt);\n\n    /**\n     * @dev Emitted when operation `id` is cancelled.\n     */\n    event Cancelled(bytes32 indexed id);\n\n    /**\n     * @dev Emitted when the minimum delay for future operations is modified.\n     */\n    event MinDelayChange(uint256 oldDuration, uint256 newDuration);\n\n    /**\n     * @dev Initializes the contract with the following parameters:\n     *\n     * - `minDelay`: initial minimum delay in seconds for operations\n     * - `proposers`: accounts to be granted proposer and canceller roles\n     * - `executors`: accounts to be granted executor role\n     * - `admin`: optional account to be granted admin role; disable with zero address\n     *\n     * IMPORTANT: The optional admin can aid with initial configuration of roles after deployment\n     * without being subject to delay, but this role should be subsequently renounced in favor of\n     * administration through timelocked proposals. Previous versions of this contract would assign\n     * this admin to the deployer automatically and should be renounced as well.\n     */\n    constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) {\n        // self administration\n        _grantRole(DEFAULT_ADMIN_ROLE, address(this));\n\n        // optional admin\n        if (admin != address(0)) {\n            _grantRole(DEFAULT_ADMIN_ROLE, admin);\n        }\n\n        // register proposers and cancellers\n        for (uint256 i = 0; i < proposers.length; ++i) {\n            _grantRole(PROPOSER_ROLE, proposers[i]);\n            _grantRole(CANCELLER_ROLE, proposers[i]);\n        }\n\n        // register executors\n        for (uint256 i = 0; i < executors.length; ++i) {\n            _grantRole(EXECUTOR_ROLE, executors[i]);\n        }\n\n        _minDelay = minDelay;\n        emit MinDelayChange(0, minDelay);\n    }\n\n    /**\n     * @dev Modifier to make a function callable only by a certain role. In\n     * addition to checking the sender's role, `address(0)` 's role is also\n     * considered. Granting a role to `address(0)` is equivalent to enabling\n     * this role for everyone.\n     */\n    modifier onlyRoleOrOpenRole(bytes32 role) {\n        if (!hasRole(role, address(0))) {\n            _checkRole(role, _msgSender());\n        }\n        _;\n    }\n\n    /**\n     * @dev Contract might receive/hold ETH as part of the maintenance process.\n     */\n    receive() external payable virtual {}\n\n    /// @inheritdoc IERC165\n    function supportsInterface(\n        bytes4 interfaceId\n    ) public view virtual override(AccessControl, ERC1155Holder) returns (bool) {\n        return super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns whether an id corresponds to a registered operation. This\n     * includes both Waiting, Ready, and Done operations.\n     */\n    function isOperation(bytes32 id) public view returns (bool) {\n        return getOperationState(id) != OperationState.Unset;\n    }\n\n    /**\n     * @dev Returns whether an operation is pending or not. Note that a \"pending\" operation may also be \"ready\".\n     */\n    function isOperationPending(bytes32 id) public view returns (bool) {\n        OperationState state = getOperationState(id);\n        return state == OperationState.Waiting || state == OperationState.Ready;\n    }\n\n    /**\n     * @dev Returns whether an operation is ready for execution. Note that a \"ready\" operation is also \"pending\".\n     */\n    function isOperationReady(bytes32 id) public view returns (bool) {\n        return getOperationState(id) == OperationState.Ready;\n    }\n\n    /**\n     * @dev Returns whether an operation is done or not.\n     */\n    function isOperationDone(bytes32 id) public view returns (bool) {\n        return getOperationState(id) == OperationState.Done;\n    }\n\n    /**\n     * @dev Returns the timestamp at which an operation becomes ready (0 for\n     * unset operations, 1 for done operations).\n     */\n    function getTimestamp(bytes32 id) public view virtual returns (uint256) {\n        return _timestamps[id];\n    }\n\n    /**\n     * @dev Returns operation state.\n     */\n    function getOperationState(bytes32 id) public view virtual returns (OperationState) {\n        uint256 timestamp = getTimestamp(id);\n        if (timestamp == 0) {\n            return OperationState.Unset;\n        } else if (timestamp == DONE_TIMESTAMP) {\n            return OperationState.Done;\n        } else if (timestamp > block.timestamp) {\n            return OperationState.Waiting;\n        } else {\n            return OperationState.Ready;\n        }\n    }\n\n    /**\n     * @dev Returns the minimum delay in seconds for an operation to become valid.\n     *\n     * This value can be changed by executing an operation that calls `updateDelay`.\n     */\n    function getMinDelay() public view virtual returns (uint256) {\n        return _minDelay;\n    }\n\n    /**\n     * @dev Returns the identifier of an operation containing a single\n     * transaction.\n     */\n    function hashOperation(\n        address target,\n        uint256 value,\n        bytes calldata data,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public pure virtual returns (bytes32) {\n        return keccak256(abi.encode(target, value, data, predecessor, salt));\n    }\n\n    /**\n     * @dev Returns the identifier of an operation containing a batch of\n     * transactions.\n     */\n    function hashOperationBatch(\n        address[] calldata targets,\n        uint256[] calldata values,\n        bytes[] calldata payloads,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public pure virtual returns (bytes32) {\n        return keccak256(abi.encode(targets, values, payloads, predecessor, salt));\n    }\n\n    /**\n     * @dev Schedule an operation containing a single transaction.\n     *\n     * Emits {CallSalt} if salt is nonzero, and {CallScheduled}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'proposer' role.\n     */\n    function schedule(\n        address target,\n        uint256 value,\n        bytes calldata data,\n        bytes32 predecessor,\n        bytes32 salt,\n        uint256 delay\n    ) public virtual onlyRole(PROPOSER_ROLE) {\n        bytes32 id = hashOperation(target, value, data, predecessor, salt);\n        _schedule(id, delay);\n        emit CallScheduled(id, 0, target, value, data, predecessor, delay);\n        if (salt != bytes32(0)) {\n            emit CallSalt(id, salt);\n        }\n    }\n\n    /**\n     * @dev Schedule an operation containing a batch of transactions.\n     *\n     * Emits {CallSalt} if salt is nonzero, and one {CallScheduled} event per transaction in the batch.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'proposer' role.\n     */\n    function scheduleBatch(\n        address[] calldata targets,\n        uint256[] calldata values,\n        bytes[] calldata payloads,\n        bytes32 predecessor,\n        bytes32 salt,\n        uint256 delay\n    ) public virtual onlyRole(PROPOSER_ROLE) {\n        if (targets.length != values.length || targets.length != payloads.length) {\n            revert TimelockInvalidOperationLength(targets.length, payloads.length, values.length);\n        }\n\n        bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt);\n        _schedule(id, delay);\n        for (uint256 i = 0; i < targets.length; ++i) {\n            emit CallScheduled(id, i, targets[i], values[i], payloads[i], predecessor, delay);\n        }\n        if (salt != bytes32(0)) {\n            emit CallSalt(id, salt);\n        }\n    }\n\n    /**\n     * @dev Schedule an operation that is to become valid after a given delay.\n     */\n    function _schedule(bytes32 id, uint256 delay) private {\n        if (isOperation(id)) {\n            revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Unset));\n        }\n        uint256 minDelay = getMinDelay();\n        if (delay < minDelay) {\n            revert TimelockInsufficientDelay(delay, minDelay);\n        }\n        _timestamps[id] = block.timestamp + delay;\n    }\n\n    /**\n     * @dev Cancel an operation.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'canceller' role.\n     */\n    function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) {\n        if (!isOperationPending(id)) {\n            revert TimelockUnexpectedOperationState(\n                id,\n                _encodeStateBitmap(OperationState.Waiting) | _encodeStateBitmap(OperationState.Ready)\n            );\n        }\n        delete _timestamps[id];\n\n        emit Cancelled(id);\n    }\n\n    /**\n     * @dev Execute a ready operation containing a single transaction.\n     *\n     * Emits a {CallExecuted} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'executor' role.\n     */\n    // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,\n    // thus any modifications to the operation during reentrancy should be caught.\n    // slither-disable-next-line reentrancy-eth\n    function execute(\n        address target,\n        uint256 value,\n        bytes calldata payload,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {\n        bytes32 id = hashOperation(target, value, payload, predecessor, salt);\n\n        _beforeCall(id, predecessor);\n        _execute(target, value, payload);\n        emit CallExecuted(id, 0, target, value, payload);\n        _afterCall(id);\n    }\n\n    /**\n     * @dev Execute a ready operation containing a batch of transactions.\n     *\n     * Emits one {CallExecuted} event per transaction in the batch.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'executor' role.\n     */\n    // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,\n    // thus any modifications to the operation during reentrancy should be caught.\n    // slither-disable-next-line reentrancy-eth\n    function executeBatch(\n        address[] calldata targets,\n        uint256[] calldata values,\n        bytes[] calldata payloads,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {\n        if (targets.length != values.length || targets.length != payloads.length) {\n            revert TimelockInvalidOperationLength(targets.length, payloads.length, values.length);\n        }\n\n        bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt);\n\n        _beforeCall(id, predecessor);\n        for (uint256 i = 0; i < targets.length; ++i) {\n            address target = targets[i];\n            uint256 value = values[i];\n            bytes calldata payload = payloads[i];\n            _execute(target, value, payload);\n            emit CallExecuted(id, i, target, value, payload);\n        }\n        _afterCall(id);\n    }\n\n    /**\n     * @dev Execute an operation's call.\n     */\n    function _execute(address target, uint256 value, bytes calldata data) internal virtual {\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        Address.verifyCallResult(success, returndata);\n    }\n\n    /**\n     * @dev Checks before execution of an operation's calls.\n     */\n    function _beforeCall(bytes32 id, bytes32 predecessor) private view {\n        if (!isOperationReady(id)) {\n            revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready));\n        }\n        if (predecessor != bytes32(0) && !isOperationDone(predecessor)) {\n            revert TimelockUnexecutedPredecessor(predecessor);\n        }\n    }\n\n    /**\n     * @dev Checks after execution of an operation's calls.\n     */\n    function _afterCall(bytes32 id) private {\n        if (!isOperationReady(id)) {\n            revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready));\n        }\n        _timestamps[id] = DONE_TIMESTAMP;\n    }\n\n    /**\n     * @dev Changes the minimum timelock duration for future operations.\n     *\n     * Emits a {MinDelayChange} event.\n     *\n     * Requirements:\n     *\n     * - the caller must be the timelock itself. This can only be achieved by scheduling and later executing\n     * an operation where the timelock is the target and the data is the ABI-encoded call to this function.\n     */\n    function updateDelay(uint256 newDelay) public virtual {\n        address sender = _msgSender();\n        if (sender != address(this)) {\n            revert TimelockUnauthorizedCaller(sender);\n        }\n        emit MinDelayChange(_minDelay, newDelay);\n        _minDelay = newDelay;\n    }\n\n    /**\n     * @dev Encodes a `OperationState` into a `bytes32` representation where each bit enabled corresponds to\n     * the underlying position in the `OperationState` enum. For example:\n     *\n     * 0x000...1000\n     *   ^^^^^^----- ...\n     *         ^---- Done\n     *          ^--- Ready\n     *           ^-- Waiting\n     *            ^- Unset\n     */\n    function _encodeStateBitmap(OperationState operationState) internal pure returns (bytes32) {\n        return bytes32(1 << uint8(operationState));\n    }\n}\n",
      "keccak256": "0x9c59807266868756e364e70c2824c7f3f64cc4364395e43d198421293e46e39b"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n    /**\n     * @dev Handles the receipt of a single ERC-1155 token type. This function is\n     * called at the end of a `safeTransferFrom` after the balance has been updated.\n     *\n     * NOTE: To accept the transfer, this must return\n     * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n     * (i.e. 0xf23a6e61, or its own function selector).\n     *\n     * @param operator The address which initiated the transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param id The ID of the token being transferred\n     * @param value The amount of tokens being transferred\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n     */\n    function onERC1155Received(\n        address operator,\n        address from,\n        uint256 id,\n        uint256 value,\n        bytes calldata data\n    ) external returns (bytes4);\n\n    /**\n     * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n     * is called at the end of a `safeBatchTransferFrom` after the balances have\n     * been updated.\n     *\n     * NOTE: To accept the transfer(s), this must return\n     * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n     * (i.e. 0xbc197c81, or its own function selector).\n     *\n     * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param ids An array containing ids of each token being transferred (order and length must match values array)\n     * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n     */\n    function onERC1155BatchReceived(\n        address operator,\n        address from,\n        uint256[] calldata ids,\n        uint256[] calldata values,\n        bytes calldata data\n    ) external returns (bytes4);\n}\n",
      "keccak256": "0x6ec6d7fce29668ede560c7d2e10f9d10de3473f5298e431e70a5767db42fa620"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC1155/utils/ERC1155Holder.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165, ERC165} from \"../../../utils/introspection/ERC165.sol\";\nimport {IERC1155Receiver} from \"../IERC1155Receiver.sol\";\n\n/**\n * @dev Simple implementation of `IERC1155Receiver` that will allow a contract to hold ERC-1155 tokens.\n *\n * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be\n * stuck.\n *\n * @custom:stateless\n */\nabstract contract ERC1155Holder is ERC165, IERC1155Receiver {\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    function onERC1155Received(\n        address,\n        address,\n        uint256,\n        uint256,\n        bytes memory\n    ) public virtual override returns (bytes4) {\n        return this.onERC1155Received.selector;\n    }\n\n    function onERC1155BatchReceived(\n        address,\n        address,\n        uint256[] memory,\n        uint256[] memory,\n        bytes memory\n    ) public virtual override returns (bytes4) {\n        return this.onERC1155BatchReceived.selector;\n    }\n}\n",
      "keccak256": "0x8727aacfc1f069266528eef6380f351d4d4d907b56715e799e0a6bc2d1362db7"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity >=0.5.0;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n    /**\n     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n     * by `operator` from `from`, this function is called.\n     *\n     * It must return its Solidity selector to confirm the token transfer.\n     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n     * reverted.\n     *\n     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n     */\n    function onERC721Received(\n        address operator,\n        address from,\n        uint256 tokenId,\n        bytes calldata data\n    ) external returns (bytes4);\n}\n",
      "keccak256": "0x88cd5e3bee2e8c36b8d9058fbcaa81ad5704281b25634122234b55ea853d8055"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC721/utils/ERC721Holder.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\n\n/**\n * @dev Implementation of the {IERC721Receiver} interface.\n *\n * Accepts all token transfers.\n * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or\n * {IERC721-setApprovalForAll}.\n *\n * @custom:stateless\n */\nabstract contract ERC721Holder is IERC721Receiver {\n    /**\n     * @dev See {IERC721Receiver-onERC721Received}.\n     *\n     * Always returns `IERC721Receiver.onERC721Received.selector`.\n     */\n    function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n        return this.onERC721Received.selector;\n    }\n}\n",
      "keccak256": "0x33656a25fdb287ade5fed13274e8512dddcb54758702f4360c59ce4c9138c3fa"
    },
    "lib/openzeppelin-contracts/contracts/utils/Address.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\nimport {LowLevelCall} from \"./LowLevelCall.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n        if (LowLevelCall.callNoReturn(recipient, amount, \"\")) {\n            // call successful, nothing to do\n            return;\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\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 or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\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    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\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    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        bool success = LowLevelCall.callNoReturn(target, value, data);\n        if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {\n            return LowLevelCall.returnData();\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        bool success = LowLevelCall.staticcallNoReturn(target, data);\n        if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {\n            return LowLevelCall.returnData();\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        bool success = LowLevelCall.delegatecallNoReturn(target, data);\n        if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {\n            return LowLevelCall.returnData();\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     *\n     * NOTE: This function is DEPRECATED and may be removed in the next major release.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        // only check if target is a contract if the call was successful and the return data is empty\n        // otherwise we already know that it was a contract\n        if (success && (returndata.length > 0 || target.code.length > 0)) {\n            return returndata;\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (returndata.length > 0) {\n            LowLevelCall.bubbleRevert(returndata);\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else if (returndata.length > 0) {\n            LowLevelCall.bubbleRevert(returndata);\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n",
      "keccak256": "0x0fa9e0d3a859900b5a46f70a03c73adf259603d5e05027a37fe0b45529d85346"
    },
    "lib/openzeppelin-contracts/contracts/utils/Context.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n",
      "keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2"
    },
    "lib/openzeppelin-contracts/contracts/utils/Errors.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n",
      "keccak256": "0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123"
    },
    "lib/openzeppelin-contracts/contracts/utils/LowLevelCall.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/LowLevelCall.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library of low level call functions that implement different calling strategies to deal with the return data.\n *\n * WARNING: Using this library requires an advanced understanding of Solidity and how the EVM works. It is recommended\n * to use the {Address} library instead.\n */\nlibrary LowLevelCall {\n    /// @dev Performs a Solidity function call using a low level `call` and ignoring the return data.\n    function callNoReturn(address target, bytes memory data) internal returns (bool success) {\n        return callNoReturn(target, 0, data);\n    }\n\n    /// @dev Same as {callNoReturn}, but allows to specify the value to be sent in the call.\n    function callNoReturn(address target, uint256 value, bytes memory data) internal returns (bool success) {\n        assembly (\"memory-safe\") {\n            success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x00)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `call` and returns the first 64 bytes of the result\n    /// in the scratch space of memory. Useful for functions that return a tuple of single-word values.\n    ///\n    /// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated\n    /// and this function doesn't zero it out.\n    function callReturn64Bytes(\n        address target,\n        bytes memory data\n    ) internal returns (bool success, bytes32 result1, bytes32 result2) {\n        return callReturn64Bytes(target, 0, data);\n    }\n\n    /// @dev Same as {callReturnBytes32Pair}, but allows to specify the value to be sent in the call.\n    function callReturn64Bytes(\n        address target,\n        uint256 value,\n        bytes memory data\n    ) internal returns (bool success, bytes32 result1, bytes32 result2) {\n        assembly (\"memory-safe\") {\n            success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x40)\n            result1 := mload(0x00)\n            result2 := mload(0x20)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `staticcall` and ignoring the return data.\n    function staticcallNoReturn(address target, bytes memory data) internal view returns (bool success) {\n        assembly (\"memory-safe\") {\n            success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `staticcall` and returns the first 64 bytes of the result\n    /// in the scratch space of memory. Useful for functions that return a tuple of single-word values.\n    ///\n    /// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated\n    /// and this function doesn't zero it out.\n    function staticcallReturn64Bytes(\n        address target,\n        bytes memory data\n    ) internal view returns (bool success, bytes32 result1, bytes32 result2) {\n        assembly (\"memory-safe\") {\n            success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x40)\n            result1 := mload(0x00)\n            result2 := mload(0x20)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `delegatecall` and ignoring the return data.\n    function delegatecallNoReturn(address target, bytes memory data) internal returns (bool success) {\n        assembly (\"memory-safe\") {\n            success := delegatecall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `delegatecall` and returns the first 64 bytes of the result\n    /// in the scratch space of memory. Useful for functions that return a tuple of single-word values.\n    ///\n    /// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated\n    /// and this function doesn't zero it out.\n    function delegatecallReturn64Bytes(\n        address target,\n        bytes memory data\n    ) internal returns (bool success, bytes32 result1, bytes32 result2) {\n        assembly (\"memory-safe\") {\n            success := delegatecall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x40)\n            result1 := mload(0x00)\n            result2 := mload(0x20)\n        }\n    }\n\n    /// @dev Returns the size of the return data buffer.\n    function returnDataSize() internal pure returns (uint256 size) {\n        assembly (\"memory-safe\") {\n            size := returndatasize()\n        }\n    }\n\n    /// @dev Returns a buffer containing the return data from the last call.\n    function returnData() internal pure returns (bytes memory result) {\n        assembly (\"memory-safe\") {\n            result := mload(0x40)\n            mstore(result, returndatasize())\n            returndatacopy(add(result, 0x20), 0x00, returndatasize())\n            mstore(0x40, add(result, add(0x20, returndatasize())))\n        }\n    }\n\n    /// @dev Revert with the return data from the last call.\n    function bubbleRevert() internal pure {\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            returndatacopy(fmp, 0x00, returndatasize())\n            revert(fmp, returndatasize())\n        }\n    }\n\n    function bubbleRevert(bytes memory returndata) internal pure {\n        assembly (\"memory-safe\") {\n            revert(add(returndata, 0x20), mload(returndata))\n        }\n    }\n}\n",
      "keccak256": "0x5b4802a4352474792df3107e961d1cc593e47b820c14f69d3505cb28f5a6a583"
    },
    "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n",
      "keccak256": "0x2d9dc2fe26180f74c11c13663647d38e259e45f95eb88f57b61d2160b0109d3e"
    },
    "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n",
      "keccak256": "0x8891738ffe910f0cf2da09566928589bf5d63f4524dd734fd9cedbac3274dd5c"
    },
    "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n    /*\n     * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n     * 0xb0202a11 ===\n     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n     */\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @param data Additional data with no specified format, sent in call to `spender`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n",
      "keccak256": "0xd5ea07362ab630a6a3dee4285a74cf2377044ca2e4be472755ad64d7c5d4b69d"
    },
    "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n",
      "keccak256": "0x0afcb7e740d1537b252cb2676f600465ce6938398569f09ba1b9ca240dde2dfc"
    },
    "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n",
      "keccak256": "0x1a6221315ce0307746c2c4827c125d821ee796c74a676787762f4778671d4f44"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) 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 a `value` amount of tokens as the allowance of `spender` over the\n     * 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 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n",
      "keccak256": "0x74ed01eb66b923d0d0cfe3be84604ac04b76482a55f9dd655e1ef4d367f95bc2"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 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    /**\n     * @dev An operation with an ERC-20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        if (!_safeTransfer(token, to, value, true)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        if (!_safeTransferFrom(token, from, to, value, true)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\n        return _safeTransfer(token, to, value, false);\n    }\n\n    /**\n     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\n        return _safeTransferFrom(token, from, to, value, false);\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        forceApprove(token, spender, oldAllowance + value);\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n     * value, non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n        unchecked {\n            uint256 currentAllowance = token.allowance(address(this), spender);\n            if (currentAllowance < requestedDecrease) {\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n            }\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     *\n     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n     * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n     * set here.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        if (!_safeApprove(token, spender, value, false)) {\n            if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));\n            if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            safeTransfer(token, to, value);\n        } else if (!token.transferAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferFromAndCallRelaxed(\n        IERC1363 token,\n        address from,\n        address to,\n        uint256 value,\n        bytes memory data\n    ) internal {\n        if (to.code.length == 0) {\n            safeTransferFrom(token, from, to, value);\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n     * Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n     * once without retrying, and relies on the returned value to be true.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            forceApprove(token, to, value);\n        } else if (!token.approveAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity `token.transfer(to, value)` call, relaxing the requirement on the return value: the\n     * return value is optional (but if data is returned, it must not be false).\n     *\n     * @param token The token targeted by the call.\n     * @param to The recipient of the tokens\n     * @param value The amount of token to transfer\n     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.\n     */\n    function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {\n        bytes4 selector = IERC20.transfer.selector;\n\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            mstore(0x00, selector)\n            mstore(0x04, and(to, shr(96, not(0))))\n            mstore(0x24, value)\n            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)\n            // if call success and return is true, all is good.\n            // otherwise (not success or return is not true), we need to perform further checks\n            if iszero(and(success, eq(mload(0x00), 1))) {\n                // if the call was a failure and bubble is enabled, bubble the error\n                if and(iszero(success), bubble) {\n                    returndatacopy(fmp, 0x00, returndatasize())\n                    revert(fmp, returndatasize())\n                }\n                // if the return value is not true, then the call is only successful if:\n                // - the token address has code\n                // - the returndata is empty\n                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))\n            }\n            mstore(0x40, fmp)\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, relaxing the requirement on the return\n     * value: the return value is optional (but if data is returned, it must not be false).\n     *\n     * @param token The token targeted by the call.\n     * @param from The sender of the tokens\n     * @param to The recipient of the tokens\n     * @param value The amount of token to transfer\n     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.\n     */\n    function _safeTransferFrom(\n        IERC20 token,\n        address from,\n        address to,\n        uint256 value,\n        bool bubble\n    ) private returns (bool success) {\n        bytes4 selector = IERC20.transferFrom.selector;\n\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            mstore(0x00, selector)\n            mstore(0x04, and(from, shr(96, not(0))))\n            mstore(0x24, and(to, shr(96, not(0))))\n            mstore(0x44, value)\n            success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)\n            // if call success and return is true, all is good.\n            // otherwise (not success or return is not true), we need to perform further checks\n            if iszero(and(success, eq(mload(0x00), 1))) {\n                // if the call was a failure and bubble is enabled, bubble the error\n                if and(iszero(success), bubble) {\n                    returndatacopy(fmp, 0x00, returndatasize())\n                    revert(fmp, returndatasize())\n                }\n                // if the return value is not true, then the call is only successful if:\n                // - the token address has code\n                // - the returndata is empty\n                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))\n            }\n            mstore(0x40, fmp)\n            mstore(0x60, 0)\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity `token.approve(spender, value)` call, relaxing the requirement on the return value:\n     * the return value is optional (but if data is returned, it must not be false).\n     *\n     * @param token The token targeted by the call.\n     * @param spender The spender of the tokens\n     * @param value The amount of token to transfer\n     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.\n     */\n    function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {\n        bytes4 selector = IERC20.approve.selector;\n\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            mstore(0x00, selector)\n            mstore(0x04, and(spender, shr(96, not(0))))\n            mstore(0x24, value)\n            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)\n            // if call success and return is true, all is good.\n            // otherwise (not success or return is not true), we need to perform further checks\n            if iszero(and(success, eq(mload(0x00), 1))) {\n                // if the call was a failure and bubble is enabled, bubble the error\n                if and(iszero(success), bubble) {\n                    returndatacopy(fmp, 0x00, returndatasize())\n                    revert(fmp, returndatasize())\n                }\n                // if the return value is not true, then the call is only successful if:\n                // - the token address has code\n                // - the returndata is empty\n                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))\n            }\n            mstore(0x40, fmp)\n        }\n    }\n}\n",
      "keccak256": "0x304d732678032a9781ae85c8f204c8fba3d3a5e31c02616964e75cfdc5049098"
    },
    "lib/openzeppelin-contracts/contracts/utils/Panic.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n",
      "keccak256": "0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a"
    },
    "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,\n * consider using {ReentrancyGuardTransient} instead.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n *\n * IMPORTANT: Deprecated. This storage-based reentrancy guard will be removed and replaced\n * by the {ReentrancyGuardTransient} variant in v6.0.\n *\n * @custom:stateless\n */\nabstract contract ReentrancyGuard {\n    using StorageSlot for bytes32;\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ReentrancyGuard\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant REENTRANCY_GUARD_STORAGE =\n        0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;\n\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    constructor() {\n        _reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    /**\n     * @dev A `view` only version of {nonReentrant}. Use to block view functions\n     * from being called, preventing reading from inconsistent contract state.\n     *\n     * CAUTION: This is a \"view\" modifier and does not change the reentrancy\n     * status. Use it only on view functions. For payable or non-payable functions,\n     * use the standard {nonReentrant} modifier instead.\n     */\n    modifier nonReentrantView() {\n        _nonReentrantBeforeView();\n        _;\n    }\n\n    function _nonReentrantBeforeView() private view {\n        if (_reentrancyGuardEntered()) {\n            revert ReentrancyGuardReentrantCall();\n        }\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        _nonReentrantBeforeView();\n\n        // Any calls to nonReentrant after this point will fail\n        _reentrancyGuardStorageSlot().getUint256Slot().value = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _reentrancyGuardStorageSlot().getUint256Slot().value == ENTERED;\n    }\n\n    function _reentrancyGuardStorageSlot() internal pure virtual returns (bytes32) {\n        return REENTRANCY_GUARD_STORAGE;\n    }\n}\n",
      "keccak256": "0xa516cbf1c7d15d3517c2d668601ce016c54395bf5171918a14e2686977465f53"
    },
    "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct Int256Slot {\n        int256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n",
      "keccak256": "0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97"
    },
    "lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n        // variables such that product = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `condition ? a : b`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `condition ? a : b`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from high into low.\n            low |= high * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n            // is no longer required.\n            result = low * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n\n    /**\n     * @dev Counts the number of leading zero bits in a uint256.\n     */\n    function clz(uint256 x) internal pure returns (uint256) {\n        return ternary(x == 0, 256, 255 - log2(x));\n    }\n}\n",
      "keccak256": "0x09e3f1c72d4c5cbe8e2644ab7313f8f7177533ae2f4c24cdcbbeaf520a73734c"
    },
    "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool 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 */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(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        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(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        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(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        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\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        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(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        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(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        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(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        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(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        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\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        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\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        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\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    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\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    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\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    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\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    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\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    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\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        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n",
      "keccak256": "0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54"
    },
    "src/talon/rewards/CouponDistributor.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/// @notice Funded, time-weighted rewards for three independently controlled participant pools.\n/// @dev Funding enters the next hourly epoch. Checkpoints precede every weight change.\n/// No token minting, unfunded promises, administrator withdrawal or participant enumeration.\ncontract CouponDistributor is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n    uint256 public constant EPOCH = 1 hours;\n    uint256 private constant PRECISION = 1e36;\n    uint256 public constant MAX_WEIGHT = 1e36;\n    address public immutable initializer;\n    address[2] public rewardTokens;\n    address[3] public controllers;\n    bool public initialized;\n    uint256[3] public totalWeight;\n\n    struct Stream {\n        uint256 index;\n        uint256 pending;\n        uint256 active;\n        uint256 released;\n        uint256 epochStart;\n        uint256 funded;\n        uint256 claimed;\n    }\n\n    struct Participant {\n        uint256 weight;\n        uint256[2] paidIndex;\n        uint256[2] accrued;\n    }\n    Stream[2][3] private _streams;\n    mapping(uint8 => mapping(bytes32 => Participant)) private _participants;\n\n    error Coupons__Unauthorized();\n    error Coupons__InvalidConfiguration();\n    error Coupons__BalanceMismatch();\n    event Funded(uint8 indexed pool, uint8 indexed token, uint256 amount, uint256 firstEpoch);\n    event WeightChanged(uint8 indexed pool, bytes32 indexed participant, uint256 weight);\n    event Claimed(\n        uint8 indexed pool,\n        bytes32 indexed participant,\n        address indexed recipient,\n        uint256 cash,\n        uint256 token\n    );\n\n    constructor(address settlement, address protocolToken) {\n        if (settlement.code.length == 0 || protocolToken.code.length == 0 || settlement == protocolToken) {\n            revert Coupons__InvalidConfiguration();\n        }\n        initializer = msg.sender;\n        rewardTokens = [settlement, protocolToken];\n        uint256 start = block.timestamp / EPOCH * EPOCH;\n        for (uint8 p; p < 3; ++p) {\n            for (uint8 t; t < 2; ++t) {\n                _streams[p][t].epochStart = start;\n            }\n        }\n    }\n\n    /// @notice Bind controllers once during deployment; each may only manage its own participant pool.\n    function initialize(address[3] calldata poolControllers) external {\n        if (msg.sender != initializer || initialized) revert Coupons__Unauthorized();\n        for (uint8 p; p < 3; ++p) {\n            if (poolControllers[p].code.length == 0) revert Coupons__InvalidConfiguration();\n            controllers[p] = poolControllers[p];\n        }\n        initialized = true;\n    }\n\n    /// @notice Any sponsor may fund a pool. Fee-on-transfer rewards are rejected atomically.\n    function fund(uint8 pool, uint8 token, uint256 amount) external nonReentrant {\n        _valid(pool, token);\n        if (!initialized || amount == 0 || amount > MAX_WEIGHT) revert Coupons__InvalidConfiguration();\n        _sync(pool, token);\n        IERC20 asset = IERC20(rewardTokens[token]);\n        uint256 beforeBalance = asset.balanceOf(address(this));\n        asset.safeTransferFrom(msg.sender, address(this), amount);\n        if (asset.balanceOf(address(this)) != beforeBalance + amount) revert Coupons__BalanceMismatch();\n        Stream storage s = _streams[pool][token];\n        s.pending += amount;\n        s.funded += amount;\n        emit Funded(pool, token, amount, s.epochStart + EPOCH);\n    }\n\n    /// @notice Controllers must checkpoint before mint/burn, principal change or lock-weight change.\n    function setWeight(uint8 pool, bytes32 key, uint256 weight) external nonReentrant {\n        _controller(pool);\n        if (key == bytes32(0) || weight > MAX_WEIGHT) revert Coupons__InvalidConfiguration();\n        Participant storage p = _participants[pool][key];\n        _checkpoint(pool, p);\n        uint256 total = totalWeight[pool] - p.weight + weight;\n        if (total > MAX_WEIGHT) revert Coupons__InvalidConfiguration();\n        totalWeight[pool] = total;\n        p.weight = weight;\n        emit WeightChanged(pool, key, weight);\n    }\n\n    /// @notice Ownership checks belong to the immutable pool controller, not to a stale wallet snapshot.\n    function claim(uint8 pool, bytes32 key, address recipient)\n        external\n        nonReentrant\n        returns (uint256[2] memory amounts)\n    {\n        _controller(pool);\n        if (recipient == address(0) || recipient == address(this)) revert Coupons__InvalidConfiguration();\n        Participant storage p = _participants[pool][key];\n        _checkpoint(pool, p);\n        for (uint8 t; t < 2; ++t) {\n            amounts[t] = p.accrued[t];\n            p.accrued[t] = 0;\n            _streams[pool][t].claimed += amounts[t];\n            if (amounts[t] != 0) IERC20(rewardTokens[t]).safeTransfer(recipient, amounts[t]);\n        }\n        emit Claimed(pool, key, recipient, amounts[0], amounts[1]);\n    }\n\n    function checkpoint(uint8 pool) external nonReentrant {\n        if (pool >= 3) revert Coupons__InvalidConfiguration();\n        for (uint8 t; t < 2; ++t) {\n            _sync(pool, t);\n        }\n    }\n\n    /// @notice Claim one reward asset without depending on transfers of the other reward asset.\n    function claimToken(uint8 pool, bytes32 key, uint8 token, address recipient)\n        external\n        nonReentrant\n        returns (uint256 amount)\n    {\n        _controller(pool);\n        _valid(pool, token);\n        if (recipient == address(0) || recipient == address(this)) revert Coupons__InvalidConfiguration();\n        Participant storage p = _participants[pool][key];\n        _checkpoint(pool, p);\n        amount = p.accrued[token];\n        p.accrued[token] = 0;\n        _streams[pool][token].claimed += amount;\n        if (amount != 0) IERC20(rewardTokens[token]).safeTransfer(recipient, amount);\n        emit Claimed(pool, key, recipient, token == 0 ? amount : 0, token == 1 ? amount : 0);\n    }\n\n    function stream(uint8 pool, uint8 token) external view returns (Stream memory) {\n        _valid(pool, token);\n        return _streams[pool][token];\n    }\n\n    function participant(uint8 pool, bytes32 key) external view returns (Participant memory) {\n        if (pool >= 3) revert Coupons__InvalidConfiguration();\n        return _participants[pool][key];\n    }\n\n    /// @notice Preview claimable rewards using exactly the same epoch transition as a checkpoint.\n    function earned(uint8 pool, bytes32 key) external view returns (uint256[2] memory amounts) {\n        if (pool >= 3) revert Coupons__InvalidConfiguration();\n        Participant storage p = _participants[pool][key];\n        for (uint8 t; t < 2; ++t) {\n            Stream memory s = _advanced(_streams[pool][t], totalWeight[pool]);\n            amounts[t] = p.accrued[t] + Math.mulDiv(p.weight, s.index - p.paidIndex[t], PRECISION);\n        }\n    }\n\n    function _checkpoint(uint8 pool, Participant storage p) private {\n        for (uint8 t; t < 2; ++t) {\n            _sync(pool, t);\n            uint256 index = _streams[pool][t].index;\n            p.accrued[t] += Math.mulDiv(p.weight, index - p.paidIndex[t], PRECISION);\n            p.paidIndex[t] = index;\n        }\n    }\n\n    function _sync(uint8 pool, uint8 token) private {\n        _streams[pool][token] = _advanced(_streams[pool][token], totalWeight[pool]);\n    }\n\n    // At most two funded epochs need processing. Empty elapsed hours carry no new emission.\n    function _advanced(Stream memory s, uint256 weight) private view returns (Stream memory) {\n        uint256 end = s.epochStart + EPOCH;\n        uint256 elapsed = Math.min(block.timestamp, end) - s.epochStart;\n        uint256 release = Math.mulDiv(s.active, elapsed, EPOCH);\n        s = _distribute(s, release - s.released, weight);\n        s.released = release;\n        if (block.timestamp >= end) {\n            s.active = s.pending;\n            s.pending = 0;\n            s.released = 0;\n            s.epochStart = end;\n            elapsed = Math.min(block.timestamp - end, EPOCH);\n            release = Math.mulDiv(s.active, elapsed, EPOCH);\n            s = _distribute(s, release, weight);\n            s.released = release;\n            if (elapsed == EPOCH) {\n                s.active = 0;\n                s.released = 0;\n                s.epochStart = block.timestamp / EPOCH * EPOCH;\n            }\n        }\n        return s;\n    }\n\n    function _distribute(Stream memory s, uint256 amount, uint256 weight)\n        private\n        pure\n        returns (Stream memory)\n    {\n        if (weight == 0) s.pending += amount;\n        else s.index += Math.mulDiv(amount, PRECISION, weight);\n        return s;\n    }\n\n    function _controller(uint8 pool) private view {\n        if (pool >= 3 || !initialized || msg.sender != controllers[pool]) revert Coupons__Unauthorized();\n    }\n\n    function _valid(uint8 pool, uint8 token) private pure {\n        if (pool >= 3 || token >= 2) revert Coupons__InvalidConfiguration();\n    }\n}\n",
      "keccak256": "0xa638d854c1eece592c77aa0834532e2f1a964b8ea66a3f82d70220939b8d399f"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n",
      "keccak256": "0xd6fa4088198f04eef10c5bce8a2f4d60554b7ec4b987f684393c01bf79b94d9f"
    },
    "src/talon/Executor.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\n\ninterface ITalonSwapAdapter {\n    /// @notice Spend an exact input and send output directly to the specified account.\n    function swap(address tokenIn, address tokenOut, uint256 amountIn, uint256 minOut, address recipient)\n        external\n        returns (uint256);\n}\n\n/// @title Executor\n/// @notice Exact-input execution through one immutable, reviewed adapter; output returns to the caller.\n/// @dev No arbitrary calldata or recipient. Balance deltas are checked, approvals cleared. T-03, T-04.\ncontract Executor is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n    error Executor__InvalidAdapter();\n    error Executor__InvalidSwap();\n    error Executor__BalanceMismatch();\n    ITalonSwapAdapter public immutable adapter;\n    event Executed(address indexed account, address indexed tokenOut, uint256 amountIn, uint256 amountOut);\n\n    constructor(address adapter_) {\n        if (adapter_.code.length == 0) revert Executor__InvalidAdapter();\n        adapter = ITalonSwapAdapter(adapter_);\n    }\n\n    /// @notice Execute one clip with output measured at the caller, never inferred from a router return value.\n    function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minOut)\n        external\n        nonReentrant\n        returns (uint256 received)\n    {\n        if (tokenIn == tokenOut || amountIn == 0 || minOut == 0) revert Executor__InvalidSwap();\n        IERC20 input = IERC20(tokenIn);\n        uint256 beforeIn = input.balanceOf(address(this));\n        uint256 beforeOut = IERC20(tokenOut).balanceOf(msg.sender);\n        input.safeTransferFrom(msg.sender, address(this), amountIn);\n        if (input.balanceOf(address(this)) != beforeIn + amountIn) revert Executor__BalanceMismatch();\n        input.forceApprove(address(adapter), amountIn);\n        adapter.swap(tokenIn, tokenOut, amountIn, minOut, msg.sender);\n        input.forceApprove(address(adapter), 0);\n        if (input.balanceOf(address(this)) != beforeIn) revert Executor__BalanceMismatch();\n        received = IERC20(tokenOut).balanceOf(msg.sender) - beforeOut;\n        if (received < minOut) revert Executor__BalanceMismatch();\n        emit Executed(msg.sender, tokenOut, amountIn, received);\n    }\n}\n",
      "keccak256": "0x41cb79c238482ffc6a9c0cc9b8212b195def0473edcd7de7dbd8ce4b8998580c"
    },
    "src/talon/NavOracle.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface ITalonAggregator {\n    function decimals() external view returns (uint8);\n    function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80);\n}\n\ninterface ITalonTwap {\n    function settlement() external view returns (address);\n    function quoteTwap(address tokenIn, address tokenOut, uint256 amountIn) external view returns (uint256);\n}\n\ninterface ITalonIssuerStatus {\n    function oraclePaused() external view returns (bool);\n}\n\n/// @notice Immutable dual-source token valuation. An unavailable source fails closed.\n/// @dev Equity feeds must report token total-return values; their multipliers are already included.\n/// This contract does not guarantee that a DEX can execute a trade at its indicative NAV.\ncontract NavOracle {\n    // Robinhood equity feeds publish on 0.5% deviation or a 24-hour heartbeat during sessions.\n    // Deployment uses a 26-hour bound; issuer pauses and 1.5% reference/DEX divergence still fail closed.\n    struct FeedInput {\n        address asset;\n        address aggregator;\n        uint32 maxAge;\n        bool checkIssuerPause;\n    }\n\n    struct Feed {\n        ITalonAggregator aggregator;\n        uint256 tokenUnit;\n        uint256 feedUnit;\n        uint32 maxAge;\n        bool checkIssuerPause;\n    }\n    error NAV__InvalidConfiguration();\n    error NAV__PriceUnavailable();\n    error NAV__IssuerPaused();\n    error NAV__SequencerUnavailable();\n    error NAV__Divergence();\n\n    uint256 public constant MAX_DIVERGENCE_BPS = 150;\n    uint256 public constant SEQUENCER_GRACE = 1 hours;\n    address public immutable settlement;\n    ITalonTwap public immutable dex;\n    ITalonAggregator public immutable sequencer;\n    bool public immutable priceChecksOnly;\n    mapping(address => Feed) public feeds;\n\n    /// @dev Robinhood may explicitly opt into price checks without an uptime feed. This does not detect\n    /// sequencer outages or enforce a recovery grace period. Reference/DEX/freshness checks still apply.\n    constructor(ITalonTwap dex_, address sequencer_, FeedInput[] memory inputs, bool priceChecksOnly_) {\n        if (address(dex_).code.length == 0 || inputs.length < 2 || inputs.length > 21) {\n            revert NAV__InvalidConfiguration();\n        }\n        if (priceChecksOnly_ && (block.chainid != 4663 || sequencer_ != address(0))) {\n            revert NAV__InvalidConfiguration();\n        }\n        if (\n            sequencer_.code.length == 0\n                && !(sequencer_ == address(0) && (block.chainid == 31_337 || priceChecksOnly_))\n        ) {\n            revert NAV__InvalidConfiguration();\n        }\n        priceChecksOnly = priceChecksOnly_;\n        dex = dex_;\n        settlement = dex_.settlement();\n        sequencer = ITalonAggregator(sequencer_);\n        for (uint256 i; i < inputs.length; ++i) {\n            FeedInput memory f = inputs[i];\n            if (\n                f.asset.code.length == 0 || f.aggregator.code.length == 0 || f.maxAge == 0\n                    || f.maxAge > 2 days || address(feeds[f.asset].aggregator) != address(0)\n                    || (f.asset != settlement && (!f.checkIssuerPause || f.maxAge > 26 hours))\n            ) {\n                revert NAV__InvalidConfiguration();\n            }\n            uint8 tokenDecimals = IERC20Metadata(f.asset).decimals();\n            uint8 priceDecimals = ITalonAggregator(f.aggregator).decimals();\n            if (tokenDecimals > 18 || priceDecimals > 18) revert NAV__InvalidConfiguration();\n            feeds[f.asset] = Feed(\n                ITalonAggregator(f.aggregator),\n                10 ** tokenDecimals,\n                10 ** priceDecimals,\n                f.maxAge,\n                f.checkIssuerPause\n            );\n        }\n        if (address(feeds[settlement].aggregator) == address(0)) revert NAV__InvalidConfiguration();\n    }\n\n    /// @notice Lower of the reference and DEX values, expressed in raw USDG units.\n    function value(address asset, uint256 amount) external view returns (uint256) {\n        return quote(asset, settlement, amount);\n    }\n\n    /// @notice Conservative raw-unit quote after staleness, issuer, sequencer and divergence checks.\n    function quote(address tokenIn, address tokenOut, uint256 amount) public view returns (uint256) {\n        _sequencer();\n        if (tokenIn != settlement && tokenOut != settlement) revert NAV__InvalidConfiguration();\n        uint256 cashPrice = _price(settlement);\n        if (tokenIn == tokenOut) return amount;\n        address asset = tokenIn == settlement ? tokenOut : tokenIn;\n        uint256 assetPrice = _price(asset);\n        uint256 assetUnit = feeds[asset].tokenUnit;\n        uint256 cashUnit = feeds[settlement].tokenUnit;\n        uint256 referenceValue = Math.mulDiv(assetPrice, cashUnit, cashPrice);\n        uint256 dexValue = dex.quoteTwap(asset, settlement, assetUnit);\n        if (referenceValue == 0 || dexValue == 0) revert NAV__PriceUnavailable();\n        uint256 difference = referenceValue > dexValue ? referenceValue - dexValue : dexValue - referenceValue;\n        if (difference > Math.mulDiv(referenceValue, MAX_DIVERGENCE_BPS, 10_000)) revert NAV__Divergence();\n        uint256 referenceQuote = tokenIn == settlement\n            ? Math.mulDiv(amount, assetUnit, referenceValue)\n            : Math.mulDiv(amount, referenceValue, assetUnit);\n        uint256 dexQuote = dex.quoteTwap(tokenIn, tokenOut, amount);\n        return Math.min(referenceQuote, dexQuote);\n    }\n\n    /// @notice Live rolling DEX valuation for owner-authorized execution, in output token units.\n    /// @dev Independent equity reference feeds are deliberately not execution prices. The immutable\n    /// adapter enforces a 30-minute observation window, live spot/TWAP deviation, and active liquidity.\n    /// Issuer freezes and sequencer checks still apply. Actual fills must also meet the owner's minimum.\n    function quoteExecution(address tokenIn, address tokenOut, uint256 amount)\n        external\n        view\n        returns (uint256)\n    {\n        _sequencer();\n        if (tokenIn != settlement && tokenOut != settlement) revert NAV__InvalidConfiguration();\n        if (tokenIn == tokenOut) return amount;\n        address asset = tokenIn == settlement ? tokenOut : tokenIn;\n        Feed storage f = feeds[asset];\n        if (address(f.aggregator) == address(0)) revert NAV__InvalidConfiguration();\n        if (f.checkIssuerPause && ITalonIssuerStatus(asset).oraclePaused()) revert NAV__IssuerPaused();\n        uint256 output = dex.quoteTwap(tokenIn, tokenOut, amount);\n        if (amount != 0 && output == 0) revert NAV__PriceUnavailable();\n        return output;\n    }\n\n    uint256 public constant EXECUTION_PRICE_VERSION = 1;\n\n    function _price(address asset) private view returns (uint256 price) {\n        Feed storage f = feeds[asset];\n        if (address(f.aggregator) == address(0)) revert NAV__InvalidConfiguration();\n        if (f.checkIssuerPause && ITalonIssuerStatus(asset).oraclePaused()) revert NAV__IssuerPaused();\n        (uint80 round, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredRound) =\n            f.aggregator.latestRoundData();\n        if (\n            round == 0 || answer <= 0 || startedAt == 0 || startedAt > updatedAt\n                || updatedAt > block.timestamp || updatedAt == 0 || block.timestamp - updatedAt > f.maxAge\n                || answeredRound < round\n        ) {\n            revert NAV__PriceUnavailable();\n        }\n        price = Math.mulDiv(uint256(answer), 1e18, f.feedUnit);\n        // Bound normalization and later quote arithmetic; unsupported feeds fail closed.\n        if (price == 0 || price > 1e36) revert NAV__PriceUnavailable();\n    }\n\n    function _sequencer() private view {\n        if (address(sequencer) == address(0)) return;\n        (, int256 answer, uint256 startedAt, uint256 updatedAt,) = sequencer.latestRoundData();\n        if (\n            answer != 0 || startedAt == 0 || startedAt > block.timestamp || updatedAt < startedAt\n                || updatedAt > block.timestamp || block.timestamp - startedAt <= SEQUENCER_GRACE\n        ) {\n            revert NAV__SequencerUnavailable();\n        }\n    }\n}\n",
      "keccak256": "0xf8dd05136277badaccc47a9d2e8df1bb5ecc976d17986d1288c3c2cc2d432f91"
    },
    "src/talon/UniswapV3Adapter.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {TickMath} from \"../vendor/uniswap-v4/TickMath.sol\";\nimport {ITalonSwapAdapter} from \"./Executor.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface ITalonV3Factory {\n    function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address);\n}\n\ninterface ITalonV3Pool {\n    function liquidity() external view returns (uint128);\n    function slot0() external view returns (uint160, int24, uint16, uint16, uint16, uint8, bool);\n    function observe(uint32[] calldata secondsAgos) external view returns (int56[] memory, uint160[] memory);\n}\n\ninterface ITalonV3Router {\n    struct ExactInputParams {\n        bytes path;\n        address recipient;\n        uint256 amountIn;\n        uint256 amountOutMinimum;\n    }\n    function factory() external view returns (address);\n    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);\n}\n\ninterface ITalonNativeRouter {\n    function WETH9() external view returns (address);\n}\n\ninterface ITalonWrappedPayment {\n    function deposit() external payable;\n}\n\n/// @notice Fixed USDG purchase and sale routes through Uniswap V3, with no administrator or arbitrary calldata.\n/// @dev The deployment must independently verify router/factory bytecode and each token's provenance.\ncontract UniswapV3Adapter is ITalonSwapAdapter, ReentrancyGuard {\n    using SafeERC20 for IERC20;\n\n    struct RouteInput {\n        address asset;\n        address bridge;\n        uint24 firstFee;\n        uint24 secondFee;\n    }\n\n    struct Route {\n        bytes path;\n        address firstPool;\n        address secondPool;\n        bytes reversePath;\n        address bridge;\n        uint24 firstFee;\n        uint24 secondFee;\n    }\n    error V3Adapter__InvalidConfiguration();\n    error V3Adapter__InvalidSwap();\n    error V3Adapter__BalanceMismatch();\n    error V3Adapter__OracleUnavailable();\n    error V3Adapter__PriceDeviation();\n    error V3Adapter__ExpiredPayment();\n\n    uint256 public constant paymentVersion = 2;\n\n    uint32 public constant TWAP_WINDOW = 30 minutes;\n    // 100 ticks is approximately 1% in price, checked separately on every hop.\n    int24 public constant MAX_TICK_DEVIATION = 100;\n    address public immutable settlement;\n    ITalonV3Router public immutable router;\n    ITalonV3Factory public immutable factory;\n    mapping(address => Route) internal _routes;\n\n    constructor(address settlement_, address router_, address expectedFactory, RouteInput[] memory inputs) {\n        if (\n            settlement_.code.length == 0 || router_.code.length == 0 || expectedFactory.code.length == 0\n                || inputs.length == 0 || inputs.length > 20\n        ) revert V3Adapter__InvalidConfiguration();\n        settlement = settlement_;\n        router = ITalonV3Router(router_);\n        if (router.factory() != expectedFactory) revert V3Adapter__InvalidConfiguration();\n        factory = ITalonV3Factory(expectedFactory);\n        for (uint256 i; i < inputs.length; ++i) {\n            RouteInput memory input = inputs[i];\n            if (\n                input.asset.code.length == 0 || input.asset == settlement_\n                    || _routes[input.asset].path.length != 0 || input.firstFee == 0\n                    || input.firstFee >= 1_000_000 || input.secondFee >= 1_000_000\n            ) revert V3Adapter__InvalidConfiguration();\n            Route storage route_ = _routes[input.asset];\n            route_.bridge = input.bridge;\n            route_.firstFee = input.firstFee;\n            route_.secondFee = input.secondFee;\n            if (input.bridge == address(0)) {\n                if (input.secondFee != 0) revert V3Adapter__InvalidConfiguration();\n                route_.firstPool = _pool(settlement_, input.asset, input.firstFee);\n                route_.path = abi.encodePacked(settlement_, input.firstFee, input.asset);\n                route_.reversePath = abi.encodePacked(input.asset, input.firstFee, settlement_);\n            } else {\n                if (\n                    input.bridge.code.length == 0 || input.bridge == settlement_\n                        || input.bridge == input.asset || input.secondFee == 0\n                ) revert V3Adapter__InvalidConfiguration();\n                route_.firstPool = _pool(settlement_, input.bridge, input.firstFee);\n                route_.secondPool = _pool(input.bridge, input.asset, input.secondFee);\n                route_.path =\n                    abi.encodePacked(settlement_, input.firstFee, input.bridge, input.secondFee, input.asset);\n                route_.reversePath =\n                    abi.encodePacked(input.asset, input.secondFee, input.bridge, input.firstFee, settlement_);\n            }\n        }\n    }\n\n    function route(address asset) external view returns (Route memory) {\n        return _routes[asset];\n    }\n\n    /// @notice Reverts if the route is missing, illiquid, lacks observation history or diverges from its TWAP.\n    function checkRoute(address asset) public view {\n        Route storage selected = _routes[asset];\n        if (selected.path.length == 0) revert V3Adapter__InvalidSwap();\n        _checkPool(selected.firstPool);\n        if (selected.secondPool != address(0)) _checkPool(selected.secondPool);\n    }\n\n    function swap(address tokenIn, address tokenOut, uint256 amountIn, uint256 minOut, address recipient)\n        public\n        virtual\n        nonReentrant\n        returns (uint256 received)\n    {\n        return _swap(tokenIn, tokenOut, amountIn, minOut, recipient, 0);\n    }\n\n    /// @notice Converts an approved payment token to USDG in the caller's own wallet.\n    /// @dev A subsequent mint is a separate transaction; cancellation leaves USDG with the buyer.\n    function payToken(address tokenIn, uint256 amountIn, uint256 minUSDG, uint256 deadline)\n        external\n        nonReentrant\n        returns (uint256)\n    {\n        _paymentDeadline(deadline);\n        return _swap(tokenIn, settlement, amountIn, minUSDG, msg.sender, 0);\n    }\n\n    /// @notice Wraps exactly msg.value using the verified venue's WETH, then pays USDG to the caller.\n    function payNative(uint256 minUSDG, uint256 deadline) external payable nonReentrant returns (uint256) {\n        _paymentDeadline(deadline);\n        address wrapped = ITalonNativeRouter(address(router)).WETH9();\n        checkRoute(wrapped);\n        uint256 beforeWrapped = IERC20(wrapped).balanceOf(address(this));\n        ITalonWrappedPayment(wrapped).deposit{value: msg.value}();\n        if (IERC20(wrapped).balanceOf(address(this)) != beforeWrapped + msg.value) {\n            revert V3Adapter__BalanceMismatch();\n        }\n        return _swap(wrapped, settlement, msg.value, minUSDG, msg.sender, 1);\n    }\n\n    /// @notice User-authorized spot conversion. Never used for portfolio valuation or protocol buybacks.\n    /// @dev The caller supplies a reviewed minimum output and short deadline; no historical-price dependency.\n    function payQuotedToken(address tokenIn, uint256 amountIn, uint256 minUSDG, uint256 deadline)\n        external\n        nonReentrant\n        returns (uint256)\n    {\n        _paymentDeadline(deadline);\n        return _swap(tokenIn, settlement, amountIn, minUSDG, msg.sender, 2);\n    }\n\n    function payQuotedNative(uint256 minUSDG, uint256 deadline)\n        external\n        payable\n        nonReentrant\n        returns (uint256)\n    {\n        _paymentDeadline(deadline);\n        address wrapped = ITalonNativeRouter(address(router)).WETH9();\n        _checkPaymentRoute(wrapped);\n        uint256 beforeWrapped = IERC20(wrapped).balanceOf(address(this));\n        ITalonWrappedPayment(wrapped).deposit{value: msg.value}();\n        if (IERC20(wrapped).balanceOf(address(this)) != beforeWrapped + msg.value) {\n            revert V3Adapter__BalanceMismatch();\n        }\n        return _swap(wrapped, settlement, msg.value, minUSDG, msg.sender, 3);\n    }\n\n    function _checkPaymentRoute(address asset) private view {\n        Route storage selected = _routes[asset];\n        if (selected.path.length == 0) revert V3Adapter__InvalidSwap();\n        _paymentSpot(selected.firstPool);\n        if (selected.secondPool != address(0)) _paymentSpot(selected.secondPool);\n    }\n\n    function _paymentSpot(address pool) private view returns (int24 tick) {\n        bool unlocked;\n        (, tick,,,,, unlocked) = ITalonV3Pool(pool).slot0();\n        if (!unlocked || ITalonV3Pool(pool).liquidity() == 0) revert V3Adapter__OracleUnavailable();\n    }\n\n    /// @notice UI preflight limits each quoted payment hop's impact to about 1% of its current spot.\n    /// @dev Actual payment is protected by the buyer's minimum output, not this informational preflight.\n    function checkSpotPaymentQuote(address asset, uint160[] calldata pricesAfter) external view {\n        Route storage selected = _routes[asset];\n        if (selected.path.length == 0 || pricesAfter.length != (selected.secondPool == address(0) ? 1 : 2)) {\n            revert V3Adapter__InvalidSwap();\n        }\n        if (selected.secondPool == address(0)) {\n            _checkPriceBand(_paymentSpot(selected.firstPool), pricesAfter[0]);\n        } else {\n            _checkPriceBand(_paymentSpot(selected.secondPool), pricesAfter[0]);\n            _checkPriceBand(_paymentSpot(selected.firstPool), pricesAfter[1]);\n        }\n    }\n\n    function _paymentDeadline(uint256 deadline) private view {\n        if (deadline <= block.timestamp || deadline > block.timestamp + 15 minutes) {\n            revert V3Adapter__ExpiredPayment();\n        }\n    }\n\n    /// @notice Preflights the post-swap pool prices returned by QuoterV2 for a payment-to-USDG path.\n    /// @dev The real swap independently repeats its guards; this view does not authorize execution.\n    function checkPaymentQuote(address asset, uint160[] calldata pricesAfter) external view {\n        Route storage selected = _routes[asset];\n        if (selected.path.length == 0 || pricesAfter.length != (selected.secondPool == address(0) ? 1 : 2)) {\n            revert V3Adapter__InvalidSwap();\n        }\n        if (selected.secondPool == address(0)) {\n            _checkQuotedPool(selected.firstPool, pricesAfter[0]);\n        } else {\n            // A payment follows the reverse path: token/bridge, then bridge/USDG.\n            _checkQuotedPool(selected.secondPool, pricesAfter[0]);\n            _checkQuotedPool(selected.firstPool, pricesAfter[1]);\n        }\n    }\n\n    function _checkQuotedPool(address pool, uint160 priceAfter) private view {\n        _checkPriceBand(_checkPool(pool), priceAfter);\n    }\n\n    function _checkPriceBand(int24 mean, uint160 priceAfter) private pure {\n        int24 lower =\n            mean < TickMath.MIN_TICK + MAX_TICK_DEVIATION ? TickMath.MIN_TICK : mean - MAX_TICK_DEVIATION;\n        int24 upper =\n            mean > TickMath.MAX_TICK - MAX_TICK_DEVIATION ? TickMath.MAX_TICK : mean + MAX_TICK_DEVIATION;\n        if (\n            priceAfter < TickMath.getSqrtPriceAtTick(lower) || priceAfter > TickMath.getSqrtPriceAtTick(upper)\n        ) {\n            revert V3Adapter__PriceDeviation();\n        }\n    }\n\n    function _swap(\n        address tokenIn,\n        address tokenOut,\n        uint256 amountIn,\n        uint256 minOut,\n        address recipient,\n        uint8 mode\n    ) private returns (uint256 received) {\n        if (amountIn == 0 || minOut == 0 || recipient == address(0)) {\n            revert V3Adapter__InvalidSwap();\n        }\n        address asset = _asset(tokenIn, tokenOut);\n        if (mode & 2 != 0) _checkPaymentRoute(asset);\n        else checkRoute(asset);\n        IERC20 input = IERC20(tokenIn);\n        uint256 beforeIn = input.balanceOf(address(this)) - (mode & 1 != 0 ? amountIn : 0);\n        uint256 beforeOut = IERC20(tokenOut).balanceOf(recipient);\n        if (mode & 1 == 0) input.safeTransferFrom(msg.sender, address(this), amountIn);\n        if (input.balanceOf(address(this)) != beforeIn + amountIn) revert V3Adapter__BalanceMismatch();\n        input.forceApprove(address(router), amountIn);\n        router.exactInput(\n            ITalonV3Router.ExactInputParams(\n                tokenIn == settlement ? _routes[asset].path : _routes[asset].reversePath,\n                recipient,\n                amountIn,\n                minOut\n            )\n        );\n        input.forceApprove(address(router), 0);\n        if (input.balanceOf(address(this)) != beforeIn) revert V3Adapter__BalanceMismatch();\n        received = IERC20(tokenOut).balanceOf(recipient) - beforeOut;\n        if (received < minOut) revert V3Adapter__BalanceMismatch();\n        // A quote alone does not limit impact. The completed swap must also stay inside the oracle band.\n        if (mode & 2 == 0) checkRoute(asset);\n    }\n\n    /// @notice Fee-exclusive 30-minute price quote in raw output units, with both pool guards enforced.\n    function quoteTwap(address tokenIn, address tokenOut, uint256 amountIn) public view returns (uint256) {\n        address asset = _asset(tokenIn, tokenOut);\n        Route storage selected = _routes[asset];\n        int24 first = _checkPool(selected.firstPool);\n        if (selected.bridge == address(0)) return _quote(first, tokenIn, tokenOut, amountIn);\n        int24 second = _checkPool(selected.secondPool);\n        if (tokenIn == settlement) {\n            return\n                _quote(second, selected.bridge, asset, _quote(first, settlement, selected.bridge, amountIn));\n        }\n        return _quote(first, selected.bridge, settlement, _quote(second, asset, selected.bridge, amountIn));\n    }\n\n    /// @notice Floors include each venue fee and a maximum aggregate 1% execution allowance.\n    function minimumOutput(address tokenIn, address tokenOut, uint256 amountIn)\n        public\n        view\n        returns (uint256)\n    {\n        Route storage selected = _routes[_asset(tokenIn, tokenOut)];\n        uint256 quoted = quoteTwap(tokenIn, tokenOut, amountIn);\n        quoted = Math.mulDiv(quoted, 1_000_000 - selected.firstFee, 1_000_000);\n        if (selected.secondPool != address(0)) {\n            quoted = Math.mulDiv(quoted, 1_000_000 - selected.secondFee, 1_000_000);\n        }\n        return Math.mulDiv(quoted, 9900, 10_000);\n    }\n\n    function _asset(address tokenIn, address tokenOut) private view returns (address asset) {\n        if (tokenIn == settlement && tokenOut != settlement) asset = tokenOut;\n        else if (tokenOut == settlement && tokenIn != settlement) asset = tokenIn;\n        else revert V3Adapter__InvalidSwap();\n        if (_routes[asset].path.length == 0) revert V3Adapter__InvalidSwap();\n    }\n\n    function _quote(int24 tick, address tokenIn, address tokenOut, uint256 amount)\n        private\n        pure\n        returns (uint256)\n    {\n        uint160 sqrtPrice = TickMath.getSqrtPriceAtTick(tick);\n        if (sqrtPrice <= type(uint128).max) {\n            uint256 ratioX192 = uint256(sqrtPrice) * sqrtPrice;\n            return tokenIn < tokenOut\n                ? Math.mulDiv(amount, ratioX192, uint256(1) << 192)\n                : Math.mulDiv(amount, uint256(1) << 192, ratioX192);\n        }\n        uint256 ratioX128 = Math.mulDiv(sqrtPrice, sqrtPrice, uint256(1) << 64);\n        return tokenIn < tokenOut\n            ? Math.mulDiv(amount, ratioX128, uint256(1) << 128)\n            : Math.mulDiv(amount, uint256(1) << 128, ratioX128);\n    }\n\n    function _pool(address a, address b, uint24 fee) private view returns (address pool) {\n        pool = factory.getPool(a, b, fee);\n        if (pool.code.length == 0) revert V3Adapter__InvalidConfiguration();\n    }\n\n    function _checkPool(address pool) private view returns (int24) {\n        (, int24 tick,, uint16 cardinality, uint16 cardinalityNext,, bool unlocked) =\n            ITalonV3Pool(pool).slot0();\n        // A single old observation can cover this entire window when no trades changed the tick.\n        // Capacity for the next observation is mandatory so a fill does not overwrite that history.\n        // observe(), rather than the number of allocated slots, proves the actual 30-minute window.\n        if (!unlocked || cardinality == 0 || cardinalityNext < 2 || ITalonV3Pool(pool).liquidity() == 0) {\n            revert V3Adapter__OracleUnavailable();\n        }\n        uint32[] memory secondsAgos = new uint32[](2);\n        secondsAgos[0] = TWAP_WINDOW;\n        try ITalonV3Pool(pool).observe(secondsAgos) returns (int56[] memory ticks, uint160[] memory) {\n            if (ticks.length != 2) revert V3Adapter__OracleUnavailable();\n            int56 delta = ticks[1] - ticks[0];\n            int56 window = int56(uint56(TWAP_WINDOW));\n            int56 mean = delta / window;\n            // Solidity truncates toward zero; Uniswap arithmetic mean ticks round toward negative infinity.\n            if (delta < 0 && delta % window != 0) --mean;\n            int56 difference = int56(tick) - mean;\n            if (difference > MAX_TICK_DEVIATION || difference < -MAX_TICK_DEVIATION) {\n                revert V3Adapter__PriceDeviation();\n            }\n            if (mean < TickMath.MIN_TICK || mean > TickMath.MAX_TICK) revert V3Adapter__OracleUnavailable();\n            return int24(mean);\n        } catch {\n            revert V3Adapter__OracleUnavailable();\n        }\n    }\n}\n",
      "keccak256": "0xefd7f783178c21d83f05ebf10287f22dda71652a08f170141ff25052ebaa25a4"
    },
    "src/talon/rewards/FeeRouter.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {NavOracle} from \"../NavOracle.sol\";\nimport {UniswapV3Adapter} from \"../UniswapV3Adapter.sol\";\nimport {CouponDistributor} from \"./CouponDistributor.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/// @notice Segregates actual USDG receipts into 40/40/15/5 percent fee destinations.\n/// @dev No accounting of quoted NAV, unreceived fees or slippage as revenue.\ncontract FeeRouter is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n    IERC20 public immutable settlement;\n    CouponDistributor public immutable coupons;\n    address public immutable treasury;\n    address public immutable initializer;\n    address public buybackEngine;\n    address public liquidityEngine;\n    uint256 public buybackBudget;\n    uint256 public liquidityBudget;\n    uint256 public reserveBudget;\n    uint256 public totalRouted;\n    NavOracle public feeOracle;\n    UniswapV3Adapter public feeAdapter;\n    uint256 public conversionCap;\n    error Fees__Unauthorized();\n    error Fees__InvalidConfiguration();\n    error Fees__InvalidAmount();\n    event FeesRouted(\n        uint256 amount, uint256 buyback, uint256 directCoupons, uint256 liquidity, uint256 reserve\n    );\n    event BudgetSpent(uint8 indexed destination, uint256 amount);\n    event AssetFeesConverted(address indexed asset, uint256 sold, uint256 received);\n\n    constructor(CouponDistributor coupons_, address treasury_) {\n        if (address(coupons_).code.length == 0 || treasury_ == address(0)) {\n            revert Fees__InvalidConfiguration();\n        }\n        coupons = coupons_;\n        settlement = IERC20(coupons_.rewardTokens(0));\n        treasury = treasury_;\n        initializer = msg.sender;\n    }\n\n    function initialize(address buyback, address liquidity) external {\n        if (msg.sender != initializer || buybackEngine != address(0)) revert Fees__Unauthorized();\n        if (buyback.code.length == 0 || liquidity.code.length == 0) revert Fees__InvalidConfiguration();\n        buybackEngine = buyback;\n        liquidityEngine = liquidity;\n    }\n\n    /// @notice Bind the fee conversion route once. Received equities count as revenue only after sale.\n    function initializeConverter(NavOracle oracle_, UniswapV3Adapter adapter_, uint256 cap) external {\n        if (msg.sender != initializer || address(feeOracle) != address(0)) revert Fees__Unauthorized();\n        if (\n            address(oracle_).code.length == 0 || address(adapter_).code.length == 0 || cap == 0\n                || oracle_.settlement() != address(settlement) || adapter_.settlement() != address(settlement)\n                || address(oracle_.dex()) != address(adapter_)\n        ) revert Fees__InvalidConfiguration();\n        feeOracle = oracle_;\n        feeAdapter = adapter_;\n        conversionCap = cap;\n    }\n\n    /// @notice Anyone can sell actually received stock fees into USDG, subject to both oracle guards.\n    function convertAssetFees(address asset, uint256 amount)\n        external\n        nonReentrant\n        returns (uint256 received)\n    {\n        if (\n            address(feeOracle) == address(0) || asset == address(settlement) || amount == 0\n                || amount > IERC20(asset).balanceOf(address(this))\n        ) revert Fees__InvalidAmount();\n        uint256 quote = feeOracle.value(asset, amount);\n        if (quote == 0 || quote > conversionCap) revert Fees__InvalidAmount();\n        uint256 floor = Math.max(\n            Math.mulDiv(quote, 9850, 10_000), feeAdapter.minimumOutput(asset, address(settlement), amount)\n        );\n        uint256 before = settlement.balanceOf(address(this));\n        IERC20(asset).forceApprove(address(feeAdapter), amount);\n        feeAdapter.swap(asset, address(settlement), amount, floor, address(this));\n        IERC20(asset).forceApprove(address(feeAdapter), 0);\n        received = settlement.balanceOf(address(this)) - before;\n        if (received < floor) revert Fees__InvalidAmount();\n        emit AssetFeesConverted(asset, amount, received);\n    }\n\n    function undistributed() public view returns (uint256) {\n        return settlement.balanceOf(address(this)) - buybackBudget - liquidityBudget - reserveBudget;\n    }\n\n    /// @notice Anyone can route received fees. Tiny rounding residuals stay for a later batch.\n    function distribute() external nonReentrant returns (uint256 amount) {\n        if (buybackEngine == address(0) || !coupons.initialized()) revert Fees__InvalidConfiguration();\n        // Batch in 100 raw-unit increments, preserving exact 40/40/15/5 splits.\n        amount = undistributed() / 100 * 100;\n        if (amount == 0) return 0;\n        uint256 buyback = (amount / 100) * 40;\n        uint256 direct = (amount / 100) * 40;\n        uint256 liquidity = (amount / 100) * 15;\n        uint256 reserve = amount - buyback - direct - liquidity;\n        buybackBudget += buyback;\n        liquidityBudget += liquidity;\n        reserveBudget += reserve;\n        totalRouted += amount;\n        _fundCoupons(direct);\n        emit FeesRouted(amount, buyback, direct, liquidity, reserve);\n    }\n\n    function takeBuyback(uint256 amount) external nonReentrant {\n        if (msg.sender != buybackEngine) revert Fees__Unauthorized();\n        if (amount == 0 || amount > buybackBudget) revert Fees__InvalidAmount();\n        buybackBudget -= amount;\n        settlement.safeTransfer(msg.sender, amount);\n        emit BudgetSpent(0, amount);\n    }\n\n    function takeLiquidity(uint256 amount) external nonReentrant {\n        if (msg.sender != liquidityEngine) revert Fees__Unauthorized();\n        if (amount == 0 || amount > liquidityBudget) revert Fees__InvalidAmount();\n        liquidityBudget -= amount;\n        settlement.safeTransfer(msg.sender, amount);\n        emit BudgetSpent(1, amount);\n    }\n\n    /// @notice Only the configured treasury may withdraw its segregated reserve; this contract imposes no delay.\n    function withdrawReserve(uint256 amount, address recipient) external nonReentrant {\n        if (msg.sender != treasury) revert Fees__Unauthorized();\n        if (amount == 0 || amount > reserveBudget || recipient == address(0)) revert Fees__InvalidAmount();\n        reserveBudget -= amount;\n        settlement.safeTransfer(recipient, amount);\n        emit BudgetSpent(2, amount);\n    }\n\n    function _fundCoupons(uint256 amount) private {\n        uint256 holders = Math.mulDiv(amount, 50, 100);\n        uint256 stakers = Math.mulDiv(amount, 30, 100);\n        uint256 lp = amount - holders - stakers;\n        settlement.forceApprove(address(coupons), amount);\n        if (holders != 0) coupons.fund(0, 0, holders);\n        if (stakers != 0) coupons.fund(1, 0, stakers);\n        if (lp != 0) coupons.fund(2, 0, lp);\n        settlement.forceApprove(address(coupons), 0);\n    }\n}\n",
      "keccak256": "0x63b8d06ac8417eaf7a1d03250db507d99f6008b073e86d466d7ce3cc9510255d"
    },
    "src/vendor/uniswap-v4/BitMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title BitMath\n/// @dev This library provides functionality for computing bit properties of an unsigned integer\n/// @author Solady (https://github.com/Vectorized/solady/blob/8200a70e8dc2a77ecb074fc2e99a2a0d36547522/src/utils/LibBit.sol)\nlibrary BitMath {\n    /// @notice Returns the index of the most significant bit of the number,\n    ///     where the least significant bit is at index 0 and the most significant bit is at index 255\n    /// @param x the value for which to compute the most significant bit, must be greater than 0\n    /// @return r the index of the most significant bit\n    function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {\n        require(x > 0);\n\n        assembly (\"memory-safe\") {\n            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))\n            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))\n            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n            r := or(r, shl(4, lt(0xffff, shr(r, x))))\n            r := or(r, shl(3, lt(0xff, shr(r, x))))\n            // forgefmt: disable-next-item\n            r := or(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),\n                0x0706060506020500060203020504000106050205030304010505030400000000))\n        }\n    }\n\n    /// @notice Returns the index of the least significant bit of the number,\n    ///     where the least significant bit is at index 0 and the most significant bit is at index 255\n    /// @param x the value for which to compute the least significant bit, must be greater than 0\n    /// @return r the index of the least significant bit\n    function leastSignificantBit(uint256 x) internal pure returns (uint8 r) {\n        require(x > 0);\n\n        assembly (\"memory-safe\") {\n            // Isolate the least significant bit.\n            x := and(x, sub(0, x))\n            // For the upper 3 bits of the result, use a De Bruijn-like lookup.\n            // Credit to adhusson: https://blog.adhusson.com/cheap-find-first-set-evm/\n            // forgefmt: disable-next-item\n            r := shl(5, shr(252, shl(shl(2, shr(250, mul(x,\n                0xb6db6db6ddddddddd34d34d349249249210842108c6318c639ce739cffffffff))),\n                0x8040405543005266443200005020610674053026020000107506200176117077)))\n            // For the lower 5 bits of the result, use a De Bruijn lookup.\n            // forgefmt: disable-next-item\n            r := or(r, byte(and(div(0xd76453e0, shr(r, x)), 0x1f),\n                0x001f0d1e100c1d070f090b19131c1706010e11080a1a141802121b1503160405))\n        }\n    }\n}\n",
      "keccak256": "0x51b9be4f5c4fd3e80cbc9631a65244a2eb2be250b6b7f128a2035080e18aee8d"
    },
    "src/vendor/uniswap-v4/CustomRevert.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Library for reverting with custom errors efficiently\n/// @notice Contains functions for reverting with custom errors with different argument types efficiently\n/// @dev To use this library, declare `using CustomRevert for bytes4;` and replace `revert CustomError()` with\n/// `CustomError.selector.revertWith()`\n/// @dev The functions may tamper with the free memory pointer but it is fine since the call context is exited immediately\nlibrary CustomRevert {\n    /// @dev ERC-7751 error for wrapping bubbled up reverts\n    error WrappedError(address target, bytes4 selector, bytes reason, bytes details);\n\n    /// @dev Reverts with the selector of a custom error in the scratch space\n    function revertWith(bytes4 selector) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0, selector)\n            revert(0, 0x04)\n        }\n    }\n\n    /// @dev Reverts with a custom error with an address argument in the scratch space\n    function revertWith(bytes4 selector, address addr) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0, selector)\n            mstore(0x04, and(addr, 0xffffffffffffffffffffffffffffffffffffffff))\n            revert(0, 0x24)\n        }\n    }\n\n    /// @dev Reverts with a custom error with an int24 argument in the scratch space\n    function revertWith(bytes4 selector, int24 value) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0, selector)\n            mstore(0x04, signextend(2, value))\n            revert(0, 0x24)\n        }\n    }\n\n    /// @dev Reverts with a custom error with a uint160 argument in the scratch space\n    function revertWith(bytes4 selector, uint160 value) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0, selector)\n            mstore(0x04, and(value, 0xffffffffffffffffffffffffffffffffffffffff))\n            revert(0, 0x24)\n        }\n    }\n\n    /// @dev Reverts with a custom error with two int24 arguments\n    function revertWith(bytes4 selector, int24 value1, int24 value2) internal pure {\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            mstore(fmp, selector)\n            mstore(add(fmp, 0x04), signextend(2, value1))\n            mstore(add(fmp, 0x24), signextend(2, value2))\n            revert(fmp, 0x44)\n        }\n    }\n\n    /// @dev Reverts with a custom error with two uint160 arguments\n    function revertWith(bytes4 selector, uint160 value1, uint160 value2) internal pure {\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            mstore(fmp, selector)\n            mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))\n            mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))\n            revert(fmp, 0x44)\n        }\n    }\n\n    /// @dev Reverts with a custom error with two address arguments\n    function revertWith(bytes4 selector, address value1, address value2) internal pure {\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            mstore(fmp, selector)\n            mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))\n            mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))\n            revert(fmp, 0x44)\n        }\n    }\n\n    /// @notice bubble up the revert message returned by a call and revert with a wrapped ERC-7751 error\n    /// @dev this method can be vulnerable to revert data bombs\n    function bubbleUpAndRevertWith(\n        address revertingContract,\n        bytes4 revertingFunctionSelector,\n        bytes4 additionalContext\n    ) internal pure {\n        bytes4 wrappedErrorSelector = WrappedError.selector;\n        assembly (\"memory-safe\") {\n            // Ensure the size of the revert data is a multiple of 32 bytes\n            let encodedDataSize := mul(div(add(returndatasize(), 31), 32), 32)\n\n            let fmp := mload(0x40)\n\n            // Encode wrapped error selector, address, function selector, offset, additional context, size, revert reason\n            mstore(fmp, wrappedErrorSelector)\n            mstore(add(fmp, 0x04), and(revertingContract, 0xffffffffffffffffffffffffffffffffffffffff))\n            mstore(\n                add(fmp, 0x24),\n                and(\n                    revertingFunctionSelector,\n                    0xffffffff00000000000000000000000000000000000000000000000000000000\n                )\n            )\n            // offset revert reason\n            mstore(add(fmp, 0x44), 0x80)\n            // offset additional context\n            mstore(add(fmp, 0x64), add(0xa0, encodedDataSize))\n            // size revert reason\n            mstore(add(fmp, 0x84), returndatasize())\n            // revert reason\n            returndatacopy(add(fmp, 0xa4), 0, returndatasize())\n            // size additional context\n            mstore(add(fmp, add(0xa4, encodedDataSize)), 0x04)\n            // additional context\n            mstore(\n                add(fmp, add(0xc4, encodedDataSize)),\n                and(additionalContext, 0xffffffff00000000000000000000000000000000000000000000000000000000)\n            )\n            revert(fmp, add(0xe4, encodedDataSize))\n        }\n    }\n}\n",
      "keccak256": "0x72f3e0ff2c55b4fd43f00e12860daeda4872cc8c1854d57d65d6d9857fbd98a2"
    },
    "src/vendor/uniswap-v4/TickMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {BitMath} from \"./BitMath.sol\";\nimport {CustomRevert} from \"./CustomRevert.sol\";\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n    using CustomRevert for bytes4;\n\n    /// @notice Thrown when the tick passed to #getSqrtPriceAtTick is not between MIN_TICK and MAX_TICK\n    error InvalidTick(int24 tick);\n    /// @notice Thrown when the price passed to #getTickAtSqrtPrice does not correspond to a price between MIN_TICK and MAX_TICK\n    error InvalidSqrtPrice(uint160 sqrtPriceX96);\n\n    /// @dev The minimum tick that may be passed to #getSqrtPriceAtTick computed from log base 1.0001 of 2**-128\n    /// @dev If ever MIN_TICK and MAX_TICK are not centered around 0, the absTick logic in getSqrtPriceAtTick cannot be used\n    int24 internal constant MIN_TICK = -887_272;\n    /// @dev The maximum tick that may be passed to #getSqrtPriceAtTick computed from log base 1.0001 of 2**128\n    /// @dev If ever MIN_TICK and MAX_TICK are not centered around 0, the absTick logic in getSqrtPriceAtTick cannot be used\n    int24 internal constant MAX_TICK = 887_272;\n\n    /// @dev The minimum tick spacing value drawn from the range of type int16 that is greater than 0, i.e. min from the range [1, 32767]\n    int24 internal constant MIN_TICK_SPACING = 1;\n    /// @dev The maximum tick spacing value drawn from the range of type int16, i.e. max from the range [1, 32767]\n    int24 internal constant MAX_TICK_SPACING = type(int16).max;\n\n    /// @dev The minimum value that can be returned from #getSqrtPriceAtTick. Equivalent to getSqrtPriceAtTick(MIN_TICK)\n    uint160 internal constant MIN_SQRT_PRICE = 4_295_128_739;\n    /// @dev The maximum value that can be returned from #getSqrtPriceAtTick. Equivalent to getSqrtPriceAtTick(MAX_TICK)\n    uint160 internal constant MAX_SQRT_PRICE =\n        1_461_446_703_485_210_103_287_273_052_203_988_822_378_723_970_342;\n    /// @dev A threshold used for optimized bounds check, equals `MAX_SQRT_PRICE - MIN_SQRT_PRICE - 1`\n    uint160 internal constant MAX_SQRT_PRICE_MINUS_MIN_SQRT_PRICE_MINUS_ONE =\n        1_461_446_703_485_210_103_287_273_052_203_988_822_378_723_970_342 - 4_295_128_739 - 1;\n\n    /// @notice Given a tickSpacing, compute the maximum usable tick\n    function maxUsableTick(int24 tickSpacing) internal pure returns (int24) {\n        unchecked {\n            return (MAX_TICK / tickSpacing) * tickSpacing;\n        }\n    }\n\n    /// @notice Given a tickSpacing, compute the minimum usable tick\n    function minUsableTick(int24 tickSpacing) internal pure returns (int24) {\n        unchecked {\n            return (MIN_TICK / tickSpacing) * tickSpacing;\n        }\n    }\n\n    /// @notice Calculates sqrt(1.0001^tick) * 2^96\n    /// @dev Throws if |tick| > max tick\n    /// @param tick The input tick for the above formula\n    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the price of the two assets (currency1/currency0)\n    /// at the given tick\n    function getSqrtPriceAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {\n        unchecked {\n            uint256 absTick;\n            assembly (\"memory-safe\") {\n                tick := signextend(2, tick)\n                // mask = 0 if tick >= 0 else -1 (all 1s)\n                let mask := sar(255, tick)\n                // if tick >= 0, |tick| = tick = 0 ^ tick\n                // if tick < 0, |tick| = ~~|tick| = ~(-|tick| - 1) = ~(tick - 1) = (-1) ^ (tick - 1)\n                // either way, |tick| = mask ^ (tick + mask)\n                absTick := xor(mask, add(mask, tick))\n            }\n\n            if (absTick > uint256(int256(MAX_TICK))) InvalidTick.selector.revertWith(tick);\n\n            // The tick is decomposed into bits, and for each bit with index i that is set, the product of 1/sqrt(1.0001^(2^i))\n            // is calculated (using Q128.128). The constants used for this calculation are rounded to the nearest integer\n\n            // Equivalent to:\n            //     price = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;\n            //     or price = int(2**128 / sqrt(1.0001)) if (absTick & 0x1) else 1 << 128\n            uint256 price;\n            assembly (\"memory-safe\") {\n                price := xor(\n                    shl(128, 1),\n                    mul(xor(shl(128, 1), 0xfffcb933bd6fad37aa2d162d1a594001), and(absTick, 0x1))\n                )\n            }\n            if (absTick & 0x2 != 0) price = (price * 0xfff97272373d413259a46990580e213a) >> 128;\n            if (absTick & 0x4 != 0) price = (price * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n            if (absTick & 0x8 != 0) price = (price * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n            if (absTick & 0x10 != 0) price = (price * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n            if (absTick & 0x20 != 0) price = (price * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n            if (absTick & 0x40 != 0) price = (price * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n            if (absTick & 0x80 != 0) price = (price * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n            if (absTick & 0x100 != 0) price = (price * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n            if (absTick & 0x200 != 0) price = (price * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n            if (absTick & 0x400 != 0) price = (price * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n            if (absTick & 0x800 != 0) price = (price * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n            if (absTick & 0x1000 != 0) price = (price * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n            if (absTick & 0x2000 != 0) price = (price * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n            if (absTick & 0x4000 != 0) price = (price * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n            if (absTick & 0x8000 != 0) price = (price * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n            if (absTick & 0x10000 != 0) price = (price * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n            if (absTick & 0x20000 != 0) price = (price * 0x5d6af8dedb81196699c329225ee604) >> 128;\n            if (absTick & 0x40000 != 0) price = (price * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n            if (absTick & 0x80000 != 0) price = (price * 0x48a170391f7dc42444e8fa2) >> 128;\n\n            assembly (\"memory-safe\") {\n                // if (tick > 0) price = type(uint256).max / price;\n                if sgt(tick, 0) { price := div(not(0), price) }\n\n                // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n                // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n                // we round up in the division so getTickAtSqrtPrice of the output price is always consistent\n                // `sub(shl(32, 1), 1)` is `type(uint32).max`\n                // `price + type(uint32).max` will not overflow because `price` fits in 192 bits\n                sqrtPriceX96 := shr(32, add(price, sub(shl(32, 1), 1)))\n            }\n        }\n    }\n\n    /// @notice Calculates the greatest tick value such that getSqrtPriceAtTick(tick) <= sqrtPriceX96\n    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_PRICE, as MIN_SQRT_PRICE is the lowest value getSqrtPriceAtTick may\n    /// ever return.\n    /// @param sqrtPriceX96 The sqrt price for which to compute the tick as a Q64.96\n    /// @return tick The greatest tick for which the getSqrtPriceAtTick(tick) is less than or equal to the input sqrtPriceX96\n    function getTickAtSqrtPrice(uint160 sqrtPriceX96) internal pure returns (int24 tick) {\n        unchecked {\n            // Equivalent: if (sqrtPriceX96 < MIN_SQRT_PRICE || sqrtPriceX96 >= MAX_SQRT_PRICE) revert InvalidSqrtPrice();\n            // second inequality must be >= because the price can never reach the price at the max tick\n            // if sqrtPriceX96 < MIN_SQRT_PRICE, the `sub` underflows and `gt` is true\n            // if sqrtPriceX96 >= MAX_SQRT_PRICE, sqrtPriceX96 - MIN_SQRT_PRICE > MAX_SQRT_PRICE - MIN_SQRT_PRICE - 1\n            if ((sqrtPriceX96 - MIN_SQRT_PRICE) > MAX_SQRT_PRICE_MINUS_MIN_SQRT_PRICE_MINUS_ONE) {\n                InvalidSqrtPrice.selector.revertWith(sqrtPriceX96);\n            }\n\n            uint256 price = uint256(sqrtPriceX96) << 32;\n\n            uint256 r = price;\n            uint256 msb = BitMath.mostSignificantBit(r);\n\n            if (msb >= 128) r = price >> (msb - 127);\n            else r = price << (127 - msb);\n\n            int256 log_2 = (int256(msb) - 128) << 64;\n\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(63, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(62, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(61, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(60, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(59, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(58, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(57, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(56, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(55, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(54, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(53, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(52, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(51, f))\n                r := shr(f, r)\n            }\n            assembly (\"memory-safe\") {\n                r := shr(127, mul(r, r))\n                let f := shr(128, r)\n                log_2 := or(log_2, shl(50, f))\n            }\n\n            int256 log_sqrt10001 = log_2 * 255_738_958_999_603_826_347_141; // Q22.128 number\n\n            // Magic number represents the ceiling of the maximum value of the error when approximating log_sqrt10001(x)\n            int24 tickLow = int24((log_sqrt10001 - 3_402_992_956_809_132_418_596_140_100_660_247_210) >> 128);\n\n            // Magic number represents the minimum value of the error when approximating log_sqrt10001(x), when\n            // sqrtPrice is from the range (2^-64, 2^64). This is safe as MIN_SQRT_PRICE is more than 2^-64. If MIN_SQRT_PRICE\n            // is changed, this may need to be changed too\n            int24 tickHi = int24((log_sqrt10001 + 291_339_464_771_989_622_907_027_621_153_398_088_495) >> 128);\n\n            tick = tickLow == tickHi ? tickLow : getSqrtPriceAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;\n        }\n    }\n}\n",
      "keccak256": "0xb71136139a7d4ed3809467bc2acf8bd63a7d3a163b9b6c5a58885a1db3622573"
    },
    "lib/openzeppelin-contracts/contracts/access/Ownable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    constructor(address initialOwner) {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n",
      "keccak256": "0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb"
    },
    "src/talon/BasketRegistry.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/// @title BasketRegistry\n/// @notice Versioned basket templates and capped V1 configuration, owned by a 48-hour timelock.\ncontract BasketRegistry is Ownable {\n    struct Basket {\n        string name;\n        address[] assets;\n        uint16[] weights;\n        bool enabled;\n        uint32 version;\n    }\n    error BasketRegistry__InvalidConfiguration();\n    error BasketRegistry__Unauthorized();\n    error BasketRegistry__UnknownBasket();\n    address public immutable settlement;\n    address public immutable feeRecipient;\n    address public immutable guardian;\n    uint256 public immutable depositCap;\n    uint256 public immutable positionCap;\n    uint16 public constant MINT_FEE_BPS = 20;\n    bool public paused;\n    bool public restrictedDeposits;\n    bool public salesOpen = true;\n    mapping(bytes32 => Basket) private _baskets;\n    mapping(address => bool) public allowedAsset;\n    mapping(address => bool) public allowedDepositor;\n    event BasketConfigured(\n        bytes32 indexed id, uint32 version, string name, address[] assets, uint16[] weights\n    );\n    event AssetPermissionChanged(address indexed asset, bool allowed);\n    event PauseChanged(bool paused);\n    event DepositRestrictionChanged(bool restricted);\n    event DepositorPermissionChanged(address indexed depositor, bool allowed);\n    event SalesOpenChanged(bool open);\n\n    constructor(\n        address timelock,\n        address guardian_,\n        address settlement_,\n        address feeRecipient_,\n        uint256 cap,\n        uint256 perPosition\n    ) Ownable(timelock) {\n        if (\n            guardian_ == address(0) || settlement_.code.length == 0 || feeRecipient_ == address(0) || cap == 0\n                || perPosition == 0 || perPosition > cap\n        ) revert BasketRegistry__InvalidConfiguration();\n        guardian = guardian_;\n        settlement = settlement_;\n        feeRecipient = feeRecipient_;\n        depositCap = cap;\n        positionCap = perPosition;\n    }\n\n    /// @notice Set a template; changes affect new positions only. Weights are basis points summing to 10,000.\n    function setBasket(bytes32 id, string calldata name, address[] calldata assets, uint16[] calldata weights)\n        external\n        onlyOwner\n    {\n        if (id == bytes32(0) || bytes(name).length == 0 || bytes(name).length > 32) {\n            revert BasketRegistry__InvalidConfiguration();\n        }\n        validate(assets, weights);\n        Basket storage b = _baskets[id];\n        b.name = name;\n        b.assets = assets;\n        b.weights = weights;\n        b.enabled = true;\n        ++b.version;\n        emit BasketConfigured(id, b.version, name, assets, weights);\n    }\n\n    /// @notice Allow or remove an asset for new deposits; existing exits remain available.\n    function setAsset(address asset, bool allowed) external onlyOwner {\n        if (asset.code.length == 0 || asset == settlement) revert BasketRegistry__InvalidConfiguration();\n        allowedAsset[asset] = allowed;\n        emit AssetPermissionChanged(asset, allowed);\n    }\n\n    /// @notice Pause new deposits and clips immediately; only the timelock can resume.\n    function setPaused(bool value) external {\n        if (msg.sender != owner() && (msg.sender != guardian || !value)) {\n            revert BasketRegistry__Unauthorized();\n        }\n        paused = value;\n        emit PauseChanged(value);\n    }\n\n    /// @notice Limit a pilot to named depositors. Governance cannot restrict transfers or withdrawals.\n    function setRestrictedDeposits(bool restricted) external onlyOwner {\n        restrictedDeposits = restricted;\n        emit DepositRestrictionChanged(restricted);\n    }\n\n    function setDepositor(address depositor, bool allowed) external onlyOwner {\n        if (depositor == address(0)) revert BasketRegistry__InvalidConfiguration();\n        allowedDepositor[depositor] = allowed;\n        emit DepositorPermissionChanged(depositor, allowed);\n    }\n\n    function canDeposit(address depositor) external view returns (bool) {\n        return salesOpen && (!restrictedDeposits || allowedDepositor[depositor]);\n    }\n\n    /// @notice Launch control affects new deposits only. It cannot resume a protocol emergency pause.\n    function setSalesOpen(bool open) external {\n        if (msg.sender != guardian && msg.sender != owner()) revert BasketRegistry__Unauthorized();\n        salesOpen = open;\n        emit SalesOpenChanged(open);\n    }\n\n    /// @notice Disable a template without touching accounts already created from it.\n    function disableBasket(bytes32 id) external onlyOwner {\n        Basket storage b = _baskets[id];\n        if (b.version == 0) revert BasketRegistry__UnknownBasket();\n        b.enabled = false;\n        ++b.version;\n        emit BasketConfigured(id, b.version, b.name, b.assets, b.weights);\n    }\n\n    /// @notice Return the current complete template, including its version.\n    function basket(bytes32 id) external view returns (Basket memory b) {\n        b = _baskets[id];\n        if (!b.enabled) revert BasketRegistry__UnknownBasket();\n    }\n\n    /// @notice Validate a custom or preset allocation without modifying state.\n    function validate(address[] memory assets, uint16[] memory weights) public view {\n        if (assets.length == 0 || assets.length > 10 || weights.length != assets.length) {\n            revert BasketRegistry__InvalidConfiguration();\n        }\n        uint256 sum;\n        for (uint256 i; i < assets.length; ++i) {\n            if (!allowedAsset[assets[i]] || weights[i] == 0) revert BasketRegistry__InvalidConfiguration();\n            for (uint256 j; j < i; ++j) {\n                if (assets[j] == assets[i]) revert BasketRegistry__InvalidConfiguration();\n            }\n            sum += weights[i];\n        }\n        if (sum != 10_000) revert BasketRegistry__InvalidConfiguration();\n    }\n}\n",
      "keccak256": "0xe8d3f6b05d4a762f9cdcb302dbf4e17ab8426048d37ac9aac3f183a17fea4904"
    },
    "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1271.sol)\n\npragma solidity >=0.5.0;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n    /**\n     * @dev Should return whether the signature provided is valid for the provided data\n     * @param hash      Hash of the data to be signed\n     * @param signature Signature byte array associated with `hash`\n     */\n    function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue);\n}\n",
      "keccak256": "0x66c7ec42c6c43712be2107a50ab4529379bc76a632b425babec698d9da921ac6"
    },
    "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC7913.sol)\n\npragma solidity >=0.5.0;\n\n/**\n * @dev Signature verifier interface.\n */\ninterface IERC7913SignatureVerifier {\n    /**\n     * @dev Verifies `signature` as a valid signature of `hash` by `key`.\n     *\n     * MUST return the bytes4 magic value IERC7913SignatureVerifier.verify.selector if the signature is valid.\n     * SHOULD return 0xffffffff or revert if the signature is not valid.\n     * SHOULD return 0xffffffff or revert if the key is empty\n     */\n    function verify(bytes calldata key, bytes32 hash, bytes calldata signature) external view returns (bytes4);\n}\n",
      "keccak256": "0xe5a126930df1d54e4a6dd5fea09010c4a7db0ea974c6c17a1e6082879f5a032b"
    },
    "lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/draft-IERC6093.sol)\n\npragma solidity >=0.8.4;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-721.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n",
      "keccak256": "0x1b88b3fb3d85ba5496d7d5f396f83ee1fddcdd6762059ff65992655b67920998"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.24;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n    using Strings for uint256;\n\n    // Token name\n    string private _name;\n\n    // Token symbol\n    string private _symbol;\n\n    mapping(uint256 tokenId => address) private _owners;\n\n    mapping(address owner => uint256) private _balances;\n\n    mapping(uint256 tokenId => address) private _tokenApprovals;\n\n    mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n    /**\n     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n        return\n            interfaceId == type(IERC721).interfaceId ||\n            interfaceId == type(IERC721Metadata).interfaceId ||\n            super.supportsInterface(interfaceId);\n    }\n\n    /// @inheritdoc IERC721\n    function balanceOf(address owner) public view virtual returns (uint256) {\n        if (owner == address(0)) {\n            revert ERC721InvalidOwner(address(0));\n        }\n        return _balances[owner];\n    }\n\n    /// @inheritdoc IERC721\n    function ownerOf(uint256 tokenId) public view virtual returns (address) {\n        return _requireOwned(tokenId);\n    }\n\n    /// @inheritdoc IERC721Metadata\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /// @inheritdoc IERC721Metadata\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /// @inheritdoc IERC721Metadata\n    function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n        _requireOwned(tokenId);\n\n        string memory baseURI = _baseURI();\n        return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n    }\n\n    /**\n     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n     * by default, can be overridden in child contracts.\n     */\n    function _baseURI() internal view virtual returns (string memory) {\n        return \"\";\n    }\n\n    /// @inheritdoc IERC721\n    function approve(address to, uint256 tokenId) public virtual {\n        _approve(to, tokenId, _msgSender());\n    }\n\n    /// @inheritdoc IERC721\n    function getApproved(uint256 tokenId) public view virtual returns (address) {\n        _requireOwned(tokenId);\n\n        return _getApproved(tokenId);\n    }\n\n    /// @inheritdoc IERC721\n    function setApprovalForAll(address operator, bool approved) public virtual {\n        _setApprovalForAll(_msgSender(), operator, approved);\n    }\n\n    /// @inheritdoc IERC721\n    function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n        return _operatorApprovals[owner][operator];\n    }\n\n    /// @inheritdoc IERC721\n    function transferFrom(address from, address to, uint256 tokenId) public virtual {\n        if (to == address(0)) {\n            revert ERC721InvalidReceiver(address(0));\n        }\n        // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n        address previousOwner = _update(to, tokenId, _msgSender());\n        if (previousOwner != from) {\n            revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n        }\n    }\n\n    /// @inheritdoc IERC721\n    function safeTransferFrom(address from, address to, uint256 tokenId) public {\n        safeTransferFrom(from, to, tokenId, \"\");\n    }\n\n    /// @inheritdoc IERC721\n    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n        transferFrom(from, to, tokenId);\n        ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n    }\n\n    /**\n     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n     *\n     * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n     * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n     * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n     * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n     */\n    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n        return _owners[tokenId];\n    }\n\n    /**\n     * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n     */\n    function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n        return _tokenApprovals[tokenId];\n    }\n\n    /**\n     * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n     * particular (ignoring whether it is owned by `owner`).\n     *\n     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n     * assumption.\n     */\n    function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n        return\n            spender != address(0) &&\n            (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n    }\n\n    /**\n     * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n     * Reverts if:\n     * - `spender` does not have approval from `owner` for `tokenId`.\n     * - `spender` does not have approval to manage all of `owner`'s assets.\n     *\n     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n     * assumption.\n     */\n    function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n        if (!_isAuthorized(owner, spender, tokenId)) {\n            if (owner == address(0)) {\n                revert ERC721NonexistentToken(tokenId);\n            } else {\n                revert ERC721InsufficientApproval(spender, tokenId);\n            }\n        }\n    }\n\n    /**\n     * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n     *\n     * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n     * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n     *\n     * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n     * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n     * remain consistent with one another.\n     */\n    function _increaseBalance(address account, uint128 value) internal virtual {\n        unchecked {\n            _balances[account] += value;\n        }\n    }\n\n    /**\n     * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n     * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n     *\n     * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n     * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n     */\n    function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n        address from = _ownerOf(tokenId);\n\n        // Perform (optional) operator check\n        if (auth != address(0)) {\n            _checkAuthorized(from, auth, tokenId);\n        }\n\n        // Execute the update\n        if (from != address(0)) {\n            // Clear approval. No need to re-authorize or emit the Approval event\n            _approve(address(0), tokenId, address(0), false);\n\n            unchecked {\n                _balances[from] -= 1;\n            }\n        }\n\n        if (to != address(0)) {\n            unchecked {\n                _balances[to] += 1;\n            }\n        }\n\n        _owners[tokenId] = to;\n\n        emit Transfer(from, to, tokenId);\n\n        return from;\n    }\n\n    /**\n     * @dev Mints `tokenId` and transfers it to `to`.\n     *\n     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n     *\n     * Requirements:\n     *\n     * - `tokenId` must not exist.\n     * - `to` cannot be the zero address.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _mint(address to, uint256 tokenId) internal {\n        if (to == address(0)) {\n            revert ERC721InvalidReceiver(address(0));\n        }\n        address previousOwner = _update(to, tokenId, address(0));\n        if (previousOwner != address(0)) {\n            revert ERC721InvalidSender(address(0));\n        }\n    }\n\n    /**\n     * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must not exist.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _safeMint(address to, uint256 tokenId) internal {\n        _safeMint(to, tokenId, \"\");\n    }\n\n    /**\n     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n     */\n    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n        _mint(to, tokenId);\n        ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n    }\n\n    /**\n     * @dev Destroys `tokenId`.\n     * The approval is cleared when the token is burned.\n     * This is an internal function that does not check if the sender is authorized to operate on the token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _burn(uint256 tokenId) internal {\n        address previousOwner = _update(address(0), tokenId, address(0));\n        if (previousOwner == address(0)) {\n            revert ERC721NonexistentToken(tokenId);\n        }\n    }\n\n    /**\n     * @dev Transfers `tokenId` from `from` to `to`.\n     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _transfer(address from, address to, uint256 tokenId) internal {\n        if (to == address(0)) {\n            revert ERC721InvalidReceiver(address(0));\n        }\n        address previousOwner = _update(to, tokenId, address(0));\n        if (previousOwner == address(0)) {\n            revert ERC721NonexistentToken(tokenId);\n        } else if (previousOwner != from) {\n            revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n        }\n    }\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n     * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n     *\n     * `data` is additional data, it has no specified format and it is sent in call to `to`.\n     *\n     * This internal function is like {safeTransferFrom} in the sense that it invokes\n     * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n     * implement alternative mechanisms to perform token transfer, such as signature-based.\n     *\n     * Requirements:\n     *\n     * - `tokenId` token must exist and be owned by `from`.\n     * - `to` cannot be the zero address.\n     * - `from` cannot be the zero address.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _safeTransfer(address from, address to, uint256 tokenId) internal {\n        _safeTransfer(from, to, tokenId, \"\");\n    }\n\n    /**\n     * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n     */\n    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n        _transfer(from, to, tokenId);\n        ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n    }\n\n    /**\n     * @dev Approve `to` to operate on `tokenId`\n     *\n     * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n     * either the owner of the token, or approved to operate on all tokens held by this owner.\n     *\n     * Emits an {Approval} event.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address to, uint256 tokenId, address auth) internal {\n        _approve(to, tokenId, auth, true);\n    }\n\n    /**\n     * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n     * emitted in the context of transfers.\n     */\n    function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n        // Avoid reading the owner unless necessary\n        if (emitEvent || auth != address(0)) {\n            address owner = _requireOwned(tokenId);\n\n            // We do not use _isAuthorized because single-token approvals should not be able to call approve\n            if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n                revert ERC721InvalidApprover(auth);\n            }\n\n            if (emitEvent) {\n                emit Approval(owner, to, tokenId);\n            }\n        }\n\n        _tokenApprovals[tokenId] = to;\n    }\n\n    /**\n     * @dev Approve `operator` to operate on all of `owner` tokens\n     *\n     * Requirements:\n     * - operator can't be the address zero.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n        if (operator == address(0)) {\n            revert ERC721InvalidOperator(operator);\n        }\n        _operatorApprovals[owner][operator] = approved;\n        emit ApprovalForAll(owner, operator, approved);\n    }\n\n    /**\n     * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n     * Returns the owner.\n     *\n     * Overrides to ownership logic should be done to {_ownerOf}.\n     */\n    function _requireOwned(uint256 tokenId) internal view returns (address) {\n        address owner = _ownerOf(tokenId);\n        if (owner == address(0)) {\n            revert ERC721NonexistentToken(tokenId);\n        }\n        return owner;\n    }\n}\n",
      "keccak256": "0x0a5edd019f899b88982213d19339419578276a3f398eec03084b295cc1994039"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/IERC721.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n     *   a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n     *   {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n     *   a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n     * understand this adds an external call which potentially creates a reentrancy vulnerability.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the address zero.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool approved) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n",
      "keccak256": "0xf78f05f3b8c9f75570e85300d7b4600d7f6f6a198449273f31d44c1641adb46f"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.24;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n    mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n    mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n    uint256[] private _allTokens;\n    mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n    /**\n     * @dev An `owner`'s token query was out of bounds for `index`.\n     *\n     * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n     */\n    error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n    /**\n     * @dev Batch mint is not allowed.\n     */\n    error ERC721EnumerableForbiddenBatchMint();\n\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /// @inheritdoc IERC721Enumerable\n    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n        if (index >= balanceOf(owner)) {\n            revert ERC721OutOfBoundsIndex(owner, index);\n        }\n        return _ownedTokens[owner][index];\n    }\n\n    /// @inheritdoc IERC721Enumerable\n    function totalSupply() public view virtual returns (uint256) {\n        return _allTokens.length;\n    }\n\n    /// @inheritdoc IERC721Enumerable\n    function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n        if (index >= totalSupply()) {\n            revert ERC721OutOfBoundsIndex(address(0), index);\n        }\n        return _allTokens[index];\n    }\n\n    /// @inheritdoc ERC721\n    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n        address previousOwner = super._update(to, tokenId, auth);\n\n        if (previousOwner == address(0)) {\n            _addTokenToAllTokensEnumeration(tokenId);\n        } else if (previousOwner != to) {\n            _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n        }\n        if (to == address(0)) {\n            _removeTokenFromAllTokensEnumeration(tokenId);\n        } else if (previousOwner != to) {\n            _addTokenToOwnerEnumeration(to, tokenId);\n        }\n\n        return previousOwner;\n    }\n\n    /**\n     * @dev Private function to add a token to this extension's ownership-tracking data structures.\n     * @param to address representing the new owner of the given token ID\n     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n     */\n    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n        uint256 length = balanceOf(to) - 1;\n        _ownedTokens[to][length] = tokenId;\n        _ownedTokensIndex[tokenId] = length;\n    }\n\n    /**\n     * @dev Private function to add a token to this extension's token tracking data structures.\n     * @param tokenId uint256 ID of the token to be added to the tokens list\n     */\n    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n        _allTokensIndex[tokenId] = _allTokens.length;\n        _allTokens.push(tokenId);\n    }\n\n    /**\n     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n     * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n     * @param from address representing the previous owner of the given token ID\n     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n     */\n    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n        // then delete the last slot (swap and pop).\n\n        uint256 lastTokenIndex = balanceOf(from);\n        uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n        mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n        // When the token to delete is the last token, the swap operation is unnecessary\n        if (tokenIndex != lastTokenIndex) {\n            uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n            _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n        }\n\n        // This also deletes the contents at the last position of the array\n        delete _ownedTokensIndex[tokenId];\n        delete _ownedTokensByOwner[lastTokenIndex];\n    }\n\n    /**\n     * @dev Private function to remove a token from this extension's token tracking data structures.\n     * This has O(1) time complexity, but alters the order of the _allTokens array.\n     * @param tokenId uint256 ID of the token to be removed from the tokens list\n     */\n    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n        // then delete the last slot (swap and pop).\n\n        uint256 lastTokenIndex = _allTokens.length - 1;\n        uint256 tokenIndex = _allTokensIndex[tokenId];\n\n        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n        uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n        // This also deletes the contents at the last position of the array\n        delete _allTokensIndex[tokenId];\n        _allTokens.pop();\n    }\n\n    /**\n     * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n     */\n    function _increaseBalance(address account, uint128 amount) internal virtual override {\n        if (amount > 0) {\n            revert ERC721EnumerableForbiddenBatchMint();\n        }\n        super._increaseBalance(account, amount);\n    }\n}\n",
      "keccak256": "0x9bb3a1de95df5b276ff853f85ed5581466b72928ca90cd2704712bb47f3f1e66"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n    /**\n     * @dev Returns the total amount of tokens stored by the contract.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n     */\n    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n    /**\n     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n     * Use along with {totalSupply} to enumerate all tokens.\n     */\n    function tokenByIndex(uint256 index) external view returns (uint256);\n}\n",
      "keccak256": "0xaa3852717be1903bf8b8a66c7ce323f70ac93227769c450f2b332fdd16bd9198"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n    /**\n     * @dev Returns the token collection name.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the token collection symbol.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n     */\n    function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n",
      "keccak256": "0xf46268c37522320bb2119a5a394bc5c739a95c0c574c8d08e8c643f4d06e5c76"
    },
    "lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Utils.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provides common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n    /**\n     * @dev Performs an acceptance check for the provided `operator` by calling {IERC721Receiver-onERC721Received}\n     * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n     *\n     * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n     * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n     * the transfer.\n     */\n    function checkOnERC721Received(\n        address operator,\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory data\n    ) internal {\n        if (to.code.length > 0) {\n            try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n                if (retval != IERC721Receiver.onERC721Received.selector) {\n                    // Token rejected\n                    revert IERC721Errors.ERC721InvalidReceiver(to);\n                }\n            } catch (bytes memory reason) {\n                if (reason.length == 0) {\n                    // non-IERC721Receiver implementer\n                    revert IERC721Errors.ERC721InvalidReceiver(to);\n                } else {\n                    assembly (\"memory-safe\") {\n                        revert(add(reason, 0x20), mload(reason))\n                    }\n                }\n            }\n        }\n    }\n}\n",
      "keccak256": "0xc7efbc23214ad7dced8bf2249460f4bda114d57f6a0079f84040654280f455bd"
    },
    "lib/openzeppelin-contracts/contracts/utils/Base64.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Base64.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./math/SafeCast.sol\";\n\n/**\n * @dev Provides a set of functions to operate with Base64 strings.\n */\nlibrary Base64 {\n    using SafeCast for bool;\n\n    error InvalidBase64Char(bytes1);\n\n    /**\n     * @dev Converts a `bytes` to its Base64 `string` representation.\n     */\n    function encode(bytes memory data) internal pure returns (string memory) {\n        return string(_encode(data, false));\n    }\n\n    /**\n     * @dev Converts a `bytes` to its Base64Url `string` representation.\n     * Output is not padded with `=` as specified in https://www.rfc-editor.org/rfc/rfc4648[rfc4648].\n     */\n    function encodeURL(bytes memory data) internal pure returns (string memory) {\n        return string(_encode(data, true));\n    }\n\n    /**\n     * @dev Converts a Base64 `string` to the `bytes` it represents.\n     *\n     * * Supports padded and unpadded inputs.\n     * * Supports both encoding ({encode} and {encodeURL}) seamlessly.\n     * * Does NOT revert if the input is not a valid Base64 string.\n     */\n    function decode(string memory data) internal pure returns (bytes memory) {\n        return _decode(bytes(data));\n    }\n\n    /**\n     * @dev Internal table-agnostic encoding\n     *\n     * Padding is enabled when using the Base64 table, and disabled when using the Base64Url table.\n     * See sections 4 and 5 of https://datatracker.ietf.org/doc/html/rfc4648\n     */\n    function _encode(bytes memory data, bool urlAndFilenameSafe) private pure returns (bytes memory result) {\n        /**\n         * Inspired by Brecht Devos (Brechtpd) implementation - MIT license\n         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\n         */\n        if (data.length == 0) return \"\";\n\n        // Padding is enabled by default, but disabled when the \"urlAndFilenameSafe\" alphabet is used\n        //\n        // If padding is enabled, the final length should be `bytes` data length divided by 3 rounded up and then\n        // multiplied by 4 so that it leaves room for padding the last chunk\n        // - `data.length + 2`  -> Prepare for division rounding up\n        // - `/ 3`              -> Number of 3-bytes chunks (rounded up)\n        // - `4 *`              -> 4 characters for each chunk\n        // This is equivalent to: 4 * Math.ceil(data.length / 3)\n        //\n        // If padding is disabled, the final length should be `bytes` data length multiplied by 4/3 rounded up as\n        // opposed to when padding is required to fill the last chunk.\n        // - `4 * data.length`  -> 4 characters for each chunk\n        // - ` + 2`             -> Prepare for division rounding up\n        // - `/ 3`              -> Number of 3-bytes chunks (rounded up)\n        // This is equivalent to: Math.ceil((4 * data.length) / 3)\n        uint256 resultLength = urlAndFilenameSafe ? (4 * data.length + 2) / 3 : 4 * ((data.length + 2) / 3);\n\n        assembly (\"memory-safe\") {\n            result := mload(0x40)\n\n            // Store the encoding table in the scratch space (and fmp ptr) to avoid memory allocation\n            //\n            // Base64    (ascii)  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + /\n            // Base64    (hex)   4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f\n            // Base64Url (ascii)  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 - _\n            // Base64Url (hex)   4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f\n            // xor       (hex)   00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000670\n            mstore(0x1f, \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef\")\n            mstore(0x3f, xor(\"ghijklmnopqrstuvwxyz0123456789+/\", mul(urlAndFilenameSafe, 0x670)))\n\n            // Prepare result pointer, jump over length\n            let resultPtr := add(result, 0x20)\n            let resultEnd := add(resultPtr, resultLength)\n            let dataPtr := data\n            let endPtr := add(data, mload(data))\n\n            // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and\n            // set it to zero to make sure no dirty bytes are read in that section.\n            let afterPtr := add(endPtr, 0x20)\n            let afterCache := mload(afterPtr)\n            mstore(afterPtr, 0x00)\n\n            // Run over the input, 3 bytes at a time\n            for {} lt(dataPtr, endPtr) {} {\n                // Advance 3 bytes\n                dataPtr := add(dataPtr, 3)\n                let input := mload(dataPtr)\n\n                // To write each character, shift the 3 byte (24 bits) chunk\n                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\n                // and apply logical AND with 0x3F to bitmask the least significant 6 bits.\n                // Use this as an index into the lookup table, mload an entire word\n                // so the desired character is in the least significant byte, and\n                // mstore8 this least significant byte into the result and continue.\n                mstore8(resultPtr, mload(and(shr(18, input), 0x3F)))\n                resultPtr := add(resultPtr, 1) // Advance\n                mstore8(resultPtr, mload(and(shr(12, input), 0x3F)))\n                resultPtr := add(resultPtr, 1) // Advance\n                mstore8(resultPtr, mload(and(shr(6, input), 0x3F)))\n                resultPtr := add(resultPtr, 1) // Advance\n                mstore8(resultPtr, mload(and(input, 0x3F)))\n                resultPtr := add(resultPtr, 1) // Advance\n            }\n\n            // Reset the value that was cached\n            mstore(afterPtr, afterCache)\n\n            if iszero(urlAndFilenameSafe) {\n                // When data `bytes` is not exactly 3 bytes long\n                // it is padded with `=` characters at the end\n                switch mod(mload(data), 3)\n                case 1 {\n                    mstore8(sub(resultPtr, 1), 0x3d)\n                    mstore8(sub(resultPtr, 2), 0x3d)\n                }\n                case 2 {\n                    mstore8(sub(resultPtr, 1), 0x3d)\n                }\n            }\n\n            // Store result length and update FMP to reserve allocated space\n            mstore(result, resultLength)\n            mstore(0x40, resultEnd)\n        }\n    }\n\n    /**\n     * @dev Internal decoding\n     */\n    function _decode(bytes memory data) private pure returns (bytes memory result) {\n        bytes4 errorSelector = InvalidBase64Char.selector;\n\n        uint256 dataLength = data.length;\n        if (dataLength == 0) return \"\";\n\n        uint256 resultLength = (dataLength / 4) * 3;\n        if (dataLength % 4 == 0) {\n            resultLength -= (data[dataLength - 1] == \"=\").toUint() + (data[dataLength - 2] == \"=\").toUint();\n        } else {\n            resultLength += (dataLength % 4) - 1;\n        }\n\n        assembly (\"memory-safe\") {\n            result := mload(0x40)\n\n            // Temporarily store the reverse lookup table between in memory. This spans from 0x00 to 0x50, Using:\n            // - all 64bytes of scratch space\n            // - part of the FMP (at location 0x40)\n            mstore(0x30, 0x2425262728292a2b2c2d2e2f30313233)\n            mstore(0x20, 0x0a0b0c0d0e0f10111213141516171819ffffffff3fff1a1b1c1d1e1f20212223)\n            mstore(0x00, 0x3eff3eff3f3435363738393a3b3c3dffffff00ffffff00010203040506070809)\n\n            // Prepare result pointer, jump over length\n            let dataPtr := data\n            let resultPtr := add(result, 0x20)\n            let endPtr := add(resultPtr, resultLength)\n\n            // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and\n            // set it to \"==\" (fake padding) to make sure no dirty bytes are read in that section.\n            let afterPtr := add(add(data, 0x20), dataLength)\n            let afterCache := mload(afterPtr)\n            mstore(afterPtr, shl(240, 0x3d3d))\n\n            // loop while not everything is decoded\n            for {} lt(resultPtr, endPtr) {} {\n                dataPtr := add(dataPtr, 4)\n\n                // Read a 4 bytes chunk of data\n                let input := mload(dataPtr)\n\n                // Decode each byte in the chunk as a 6 bit block, and align them to form a block of 3 bytes\n                let a := sub(byte(28, input), 43)\n                // slither-disable-next-line incorrect-shift\n                if iszero(and(shl(a, 1), 0xffffffd0ffffffc47ff5)) {\n                    mstore(0, errorSelector)\n                    mstore(4, shl(248, add(a, 43)))\n                    revert(0, 0x24)\n                }\n                let b := sub(byte(29, input), 43)\n                // slither-disable-next-line incorrect-shift\n                if iszero(and(shl(b, 1), 0xffffffd0ffffffc47ff5)) {\n                    mstore(0, errorSelector)\n                    mstore(4, shl(248, add(b, 43)))\n                    revert(0, 0x24)\n                }\n                let c := sub(byte(30, input), 43)\n                // slither-disable-next-line incorrect-shift\n                if iszero(and(shl(c, 1), 0xffffffd0ffffffc47ff5)) {\n                    mstore(0, errorSelector)\n                    mstore(4, shl(248, add(c, 43)))\n                    revert(0, 0x24)\n                }\n                let d := sub(byte(31, input), 43)\n                // slither-disable-next-line incorrect-shift\n                if iszero(and(shl(d, 1), 0xffffffd0ffffffc47ff5)) {\n                    mstore(0, errorSelector)\n                    mstore(4, add(d, 43))\n                    revert(0, 0x24)\n                }\n\n                mstore(\n                    resultPtr,\n                    or(\n                        or(shl(250, byte(0, mload(a))), shl(244, byte(0, mload(b)))),\n                        or(shl(238, byte(0, mload(c))), shl(232, byte(0, mload(d))))\n                    )\n                )\n\n                resultPtr := add(resultPtr, 3)\n            }\n\n            // Reset the value that was cached\n            mstore(afterPtr, afterCache)\n\n            // Store result length and update FMP to reserve allocated space\n            mstore(result, resultLength)\n            mstore(0x40, endPtr)\n        }\n    }\n}\n",
      "keccak256": "0xa9a2b6d1d2ac91c368d6c50dbda465211b2e64562688add951f2d5a1cca9cc4e"
    },
    "lib/openzeppelin-contracts/contracts/utils/Bytes.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Bytes.sol)\n\npragma solidity ^0.8.24;\n\nimport {Math} from \"./math/Math.sol\";\n\n/**\n * @dev Bytes operations.\n */\nlibrary Bytes {\n    /**\n     * @dev Forward search for `s` in `buffer`\n     * * If `s` is present in the buffer, returns the index of the first instance\n     * * If `s` is not present in the buffer, returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf[Javascript's `Array.indexOf`]\n     */\n    function indexOf(bytes memory buffer, bytes1 s) internal pure returns (uint256) {\n        return indexOf(buffer, s, 0);\n    }\n\n    /**\n     * @dev Forward search for `s` in `buffer` starting at position `pos`\n     * * If `s` is present in the buffer (at or after `pos`), returns the index of the next instance\n     * * If `s` is not present in the buffer (at or after `pos`), returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf[Javascript's `Array.indexOf`]\n     */\n    function indexOf(bytes memory buffer, bytes1 s, uint256 pos) internal pure returns (uint256) {\n        uint256 length = buffer.length;\n        for (uint256 i = pos; i < length; ++i) {\n            if (bytes1(_unsafeReadBytesOffset(buffer, i)) == s) {\n                return i;\n            }\n        }\n        return type(uint256).max;\n    }\n\n    /**\n     * @dev Backward search for `s` in `buffer`\n     * * If `s` is present in the buffer, returns the index of the last instance\n     * * If `s` is not present in the buffer, returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf[Javascript's `Array.lastIndexOf`]\n     */\n    function lastIndexOf(bytes memory buffer, bytes1 s) internal pure returns (uint256) {\n        return lastIndexOf(buffer, s, type(uint256).max);\n    }\n\n    /**\n     * @dev Backward search for `s` in `buffer` starting at position `pos`\n     * * If `s` is present in the buffer (at or before `pos`), returns the index of the previous instance\n     * * If `s` is not present in the buffer (at or before `pos`), returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf[Javascript's `Array.lastIndexOf`]\n     */\n    function lastIndexOf(bytes memory buffer, bytes1 s, uint256 pos) internal pure returns (uint256) {\n        unchecked {\n            uint256 length = buffer.length;\n            for (uint256 i = Math.min(Math.saturatingAdd(pos, 1), length); i > 0; --i) {\n                if (bytes1(_unsafeReadBytesOffset(buffer, i - 1)) == s) {\n                    return i - 1;\n                }\n            }\n            return type(uint256).max;\n        }\n    }\n\n    /**\n     * @dev Copies the content of `buffer`, from `start` (included) to the end of `buffer` into a new bytes object in\n     * memory.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(bytes memory buffer, uint256 start) internal pure returns (bytes memory) {\n        return slice(buffer, start, buffer.length);\n    }\n\n    /**\n     * @dev Copies the content of `buffer`, from `start` (included) to `end` (excluded) into a new bytes object in\n     * memory. The `end` argument is truncated to the length of the `buffer`.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(bytes memory buffer, uint256 start, uint256 end) internal pure returns (bytes memory) {\n        // sanitize\n        end = Math.min(end, buffer.length);\n        start = Math.min(start, end);\n\n        // allocate and copy\n        bytes memory result = new bytes(end - start);\n        assembly (\"memory-safe\") {\n            mcopy(add(result, 0x20), add(add(buffer, 0x20), start), sub(end, start))\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Moves the content of `buffer`, from `start` (included) to the end of `buffer` to the start of that buffer.\n     *\n     * NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]\n     */\n    function splice(bytes memory buffer, uint256 start) internal pure returns (bytes memory) {\n        return splice(buffer, start, buffer.length);\n    }\n\n    /**\n     * @dev Moves the content of `buffer`, from `start` (included) to end (excluded) to the start of that buffer. The\n     * `end` argument is truncated to the length of the `buffer`.\n     *\n     * NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]\n     */\n    function splice(bytes memory buffer, uint256 start, uint256 end) internal pure returns (bytes memory) {\n        // sanitize\n        end = Math.min(end, buffer.length);\n        start = Math.min(start, end);\n\n        // allocate and copy\n        assembly (\"memory-safe\") {\n            mcopy(add(buffer, 0x20), add(add(buffer, 0x20), start), sub(end, start))\n            mstore(buffer, sub(end, start))\n        }\n\n        return buffer;\n    }\n\n    /**\n     * @dev Concatenate an array of bytes into a single bytes object.\n     *\n     * For fixed bytes types, we recommend using the solidity built-in `bytes.concat` or (equivalent)\n     * `abi.encodePacked`.\n     *\n     * NOTE: this could be done in assembly with a single loop that expands starting at the FMP, but that would be\n     * significantly less readable. It might be worth benchmarking the savings of the full-assembly approach.\n     */\n    function concat(bytes[] memory buffers) internal pure returns (bytes memory) {\n        uint256 length = 0;\n        for (uint256 i = 0; i < buffers.length; ++i) {\n            length += buffers[i].length;\n        }\n\n        bytes memory result = new bytes(length);\n\n        uint256 offset = 0x20;\n        for (uint256 i = 0; i < buffers.length; ++i) {\n            bytes memory input = buffers[i];\n            assembly (\"memory-safe\") {\n                mcopy(add(result, offset), add(input, 0x20), mload(input))\n            }\n            unchecked {\n                offset += input.length;\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Returns true if the two byte buffers are equal.\n     */\n    function equal(bytes memory a, bytes memory b) internal pure returns (bool) {\n        return a.length == b.length && keccak256(a) == keccak256(b);\n    }\n\n    /**\n     * @dev Reverses the byte order of a bytes32 value, converting between little-endian and big-endian.\n     * Inspired by https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel[Reverse Parallel]\n     */\n    function reverseBytes32(bytes32 value) internal pure returns (bytes32) {\n        value = // swap bytes\n            ((value >> 8) & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) |\n            ((value & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\n        value = // swap 2-byte long pairs\n            ((value >> 16) & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) |\n            ((value & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\n        value = // swap 4-byte long pairs\n            ((value >> 32) & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) |\n            ((value & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) << 32);\n        value = // swap 8-byte long pairs\n            ((value >> 64) & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) |\n            ((value & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) << 64);\n        return (value >> 128) | (value << 128); // swap 16-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 128-bit values.\n    function reverseBytes16(bytes16 value) internal pure returns (bytes16) {\n        value = // swap bytes\n            ((value & 0xFF00FF00FF00FF00FF00FF00FF00FF00) >> 8) |\n            ((value & 0x00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\n        value = // swap 2-byte long pairs\n            ((value & 0xFFFF0000FFFF0000FFFF0000FFFF0000) >> 16) |\n            ((value & 0x0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\n        value = // swap 4-byte long pairs\n            ((value & 0xFFFFFFFF00000000FFFFFFFF00000000) >> 32) |\n            ((value & 0x00000000FFFFFFFF00000000FFFFFFFF) << 32);\n        return (value >> 64) | (value << 64); // swap 8-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 64-bit values.\n    function reverseBytes8(bytes8 value) internal pure returns (bytes8) {\n        value = ((value & 0xFF00FF00FF00FF00) >> 8) | ((value & 0x00FF00FF00FF00FF) << 8); // swap bytes\n        value = ((value & 0xFFFF0000FFFF0000) >> 16) | ((value & 0x0000FFFF0000FFFF) << 16); // swap 2-byte long pairs\n        return (value >> 32) | (value << 32); // swap 4-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 32-bit values.\n    function reverseBytes4(bytes4 value) internal pure returns (bytes4) {\n        value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); // swap bytes\n        return (value >> 16) | (value << 16); // swap 2-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 16-bit values.\n    function reverseBytes2(bytes2 value) internal pure returns (bytes2) {\n        return (value >> 8) | (value << 8);\n    }\n\n    /**\n     * @dev Counts the number of leading zero bits a bytes array. Returns `8 * buffer.length`\n     * if the buffer is all zeros.\n     */\n    function clz(bytes memory buffer) internal pure returns (uint256) {\n        for (uint256 i = 0; i < buffer.length; i += 0x20) {\n            bytes32 chunk = _unsafeReadBytesOffset(buffer, i);\n            if (chunk != bytes32(0)) {\n                return Math.min(8 * i + Math.clz(uint256(chunk)), 8 * buffer.length);\n            }\n        }\n        return 8 * buffer.length;\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(add(buffer, 0x20), offset))\n        }\n    }\n}\n",
      "keccak256": "0x8140d608316521b1fd71167c3b708ebb8659da070723fc8807609553b296ee33"
    },
    "lib/openzeppelin-contracts/contracts/utils/Strings.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Strings.sol)\n\npragma solidity ^0.8.24;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\nimport {Bytes} from \"./Bytes.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    using SafeCast for *;\n\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n    uint256 private constant SPECIAL_CHARS_LOOKUP =\n        (1 << 0x08) | // backspace\n            (1 << 0x09) | // tab\n            (1 << 0x0a) | // newline\n            (1 << 0x0c) | // form feed\n            (1 << 0x0d) | // carriage return\n            (1 << 0x22) | // double quote\n            (1 << 0x5c); // backslash\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev The string being parsed contains characters that are not in scope of the given base.\n     */\n    error StringsInvalidChar();\n\n    /**\n     * @dev The string being parsed is not a properly formatted address.\n     */\n    error StringsInvalidAddressFormat();\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            assembly (\"memory-safe\") {\n                ptr := add(add(buffer, 0x20), length)\n            }\n            while (true) {\n                ptr--;\n                assembly (\"memory-safe\") {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        uint256 localValue = value;\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n     * representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n     * representation, according to EIP-55.\n     */\n    function toChecksumHexString(address addr) internal pure returns (string memory) {\n        bytes memory buffer = bytes(toHexString(addr));\n\n        // hash the hex part of buffer (skip length + 2 bytes, length 40)\n        uint256 hashValue;\n        assembly (\"memory-safe\") {\n            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n        }\n\n        for (uint256 i = 41; i > 1; --i) {\n            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n                // case shift by xoring with 0x20\n                buffer[i] ^= 0x20;\n            }\n            hashValue >>= 4;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `bytes` buffer to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(bytes memory input) internal pure returns (string memory) {\n        unchecked {\n            bytes memory buffer = new bytes(2 * input.length + 2);\n            buffer[0] = \"0\";\n            buffer[1] = \"x\";\n            for (uint256 i = 0; i < input.length; ++i) {\n                uint8 v = uint8(input[i]);\n                buffer[2 * i + 2] = HEX_DIGITS[v >> 4];\n                buffer[2 * i + 3] = HEX_DIGITS[v & 0xf];\n            }\n            return string(buffer);\n        }\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return Bytes.equal(bytes(a), bytes(b));\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input) internal pure returns (uint256) {\n        return parseUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        uint256 result = 0;\n        for (uint256 i = begin; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 9) return (false, 0);\n            result *= 10;\n            result += chr;\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `int256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input) internal pure returns (int256) {\n        return parseInt(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\n        (bool success, int256 value) = tryParseInt(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n     * the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\n        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    uint256 private constant ABS_MIN_INT256 = 2 ** 255;\n\n    /**\n     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character or if the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, int256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseIntUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseIntUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, int256 value) {\n        bytes memory buffer = bytes(input);\n\n        // Check presence of a negative sign.\n        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        bool positiveSign = sign == bytes1(\"+\");\n        bool negativeSign = sign == bytes1(\"-\");\n        uint256 offset = (positiveSign || negativeSign).toUint();\n\n        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\n\n        if (absSuccess && absValue < ABS_MIN_INT256) {\n            return (true, negativeSign ? -int256(absValue) : int256(absValue));\n        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\n            return (true, type(int256).min);\n        } else return (false, 0);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input) internal pure returns (uint256) {\n        return parseHexUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseHexUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n     * invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseHexUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseHexUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        // skip 0x prefix if present\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 offset = hasPrefix.toUint() * 2;\n\n        uint256 result = 0;\n        for (uint256 i = begin + offset; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 15) return (false, 0);\n            result *= 16;\n            unchecked {\n                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\n                // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.\n                result += chr;\n            }\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input) internal pure returns (address) {\n        return parseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\n        (bool success, address value) = tryParseAddress(input, begin, end);\n        if (!success) revert StringsInvalidAddressFormat();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n     * formatted address. See {parseAddress-string} requirements.\n     */\n    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\n        return tryParseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n     * formatted address. See {parseAddress-string-uint256-uint256} requirements.\n     */\n    function tryParseAddress(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, address value) {\n        if (end > bytes(input).length || begin > end) return (false, address(0));\n\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\n\n        // check that input is the correct length\n        if (end - begin == expectedLength) {\n            // length guarantees that this does not overflow, and value is at most type(uint160).max\n            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\n            return (s, address(uint160(v)));\n        } else {\n            return (false, address(0));\n        }\n    }\n\n    function _tryParseChr(bytes1 chr) private pure returns (uint8) {\n        uint8 value = uint8(chr);\n\n        // Try to parse `chr`:\n        // - Case 1: [0-9]\n        // - Case 2: [a-f]\n        // - Case 3: [A-F]\n        // - otherwise not supported\n        unchecked {\n            if (value > 47 && value < 58) value -= 48;\n            else if (value > 96 && value < 103) value -= 87;\n            else if (value > 64 && value < 71) value -= 55;\n            else return type(uint8).max;\n        }\n\n        return value;\n    }\n\n    /**\n     * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\n     *\n     * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\n     *\n     * NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of\n     * RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode\n     * characters that are not in this range, but other tooling may provide different results.\n     */\n    function escapeJSON(string memory input) internal pure returns (string memory) {\n        bytes memory buffer = bytes(input);\n        bytes memory output = new bytes(2 * buffer.length); // worst case scenario\n        uint256 outputLength = 0;\n\n        for (uint256 i = 0; i < buffer.length; ++i) {\n            bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));\n            if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {\n                output[outputLength++] = \"\\\\\";\n                if (char == 0x08) output[outputLength++] = \"b\";\n                else if (char == 0x09) output[outputLength++] = \"t\";\n                else if (char == 0x0a) output[outputLength++] = \"n\";\n                else if (char == 0x0c) output[outputLength++] = \"f\";\n                else if (char == 0x0d) output[outputLength++] = \"r\";\n                else if (char == 0x5c) output[outputLength++] = \"\\\\\";\n                else if (char == 0x22) {\n                    // solhint-disable-next-line quotes\n                    output[outputLength++] = '\"';\n                }\n            } else {\n                output[outputLength++] = char;\n            }\n        }\n        // write the actual length and deallocate unused memory\n        assembly (\"memory-safe\") {\n            mstore(output, outputLength)\n            mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))\n        }\n\n        return string(output);\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(add(buffer, 0x20), offset))\n        }\n    }\n}\n",
      "keccak256": "0x36d1750bf1aa5fee9c52adb2f7857ab652daca722fc05dff533b364f67a1139a"
    },
    "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS\n    }\n\n    /**\n     * @dev The signature derives the `address(0)`.\n     */\n    error ECDSAInvalidSignature();\n\n    /**\n     * @dev The signature has an invalid length.\n     */\n    error ECDSAInvalidSignatureLength(uint256 length);\n\n    /**\n     * @dev The signature has an S value that is in the upper half order.\n     */\n    error ECDSAInvalidSignatureS(bytes32 s);\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n     * and a bytes32 providing additional information about the error.\n     *\n     * If no error is returned, then the address can be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * NOTE: This function only supports 65-byte signatures. ERC-2098 short signatures are rejected. This restriction\n     * is DEPRECATED and will be removed in v6.0. Developers SHOULD NOT use signatures as unique identifiers; use hash\n     * invalidation or nonces for replay protection.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     *\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes memory signature\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly (\"memory-safe\") {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Variant of {tryRecover} that takes a signature in calldata\n     */\n    function tryRecoverCalldata(\n        bytes32 hash,\n        bytes calldata signature\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, calldata slices would work here, but are\n            // significantly more expensive (length check) than using calldataload in assembly.\n            assembly (\"memory-safe\") {\n                r := calldataload(signature.offset)\n                s := calldataload(add(signature.offset, 0x20))\n                v := byte(0, calldataload(add(signature.offset, 0x40)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * NOTE: This function only supports 65-byte signatures. ERC-2098 short signatures are rejected. This restriction\n     * is DEPRECATED and will be removed in v6.0. Developers SHOULD NOT use signatures as unique identifiers; use hash\n     * invalidation or nonces for replay protection.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Variant of {recover} that takes a signature in calldata\n     */\n    function recoverCalldata(bytes32 hash, bytes calldata signature) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecoverCalldata(hash, signature);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        unchecked {\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\n            return tryRecover(hash, v, r, s);\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS, s);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\n        }\n\n        return (signer, RecoverError.NoError, bytes32(0));\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Parse a signature into its `v`, `r` and `s` components. Supports 65-byte and 64-byte (ERC-2098)\n     * formats. Returns (0,0,0) for invalid signatures.\n     *\n     * For 64-byte signatures, `v` is automatically normalized to 27 or 28.\n     * For 65-byte signatures, `v` is returned as-is and MUST already be 27 or 28 for use with ecrecover.\n     *\n     * Consider validating the result before use, or use {tryRecover}/{recover} which perform full validation.\n     */\n    function parse(bytes memory signature) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\n        assembly (\"memory-safe\") {\n            // Check the signature length\n            switch mload(signature)\n            // - case 65: r,s,v signature (standard)\n            case 65 {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098)\n            case 64 {\n                let vs := mload(add(signature, 0x40))\n                r := mload(add(signature, 0x20))\n                s := and(vs, shr(1, not(0)))\n                v := add(shr(255, vs), 27)\n            }\n            default {\n                r := 0\n                s := 0\n                v := 0\n            }\n        }\n    }\n\n    /**\n     * @dev Variant of {parse} that takes a signature in calldata\n     */\n    function parseCalldata(bytes calldata signature) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\n        assembly (\"memory-safe\") {\n            // Check the signature length\n            switch signature.length\n            // - case 65: r,s,v signature (standard)\n            case 65 {\n                r := calldataload(signature.offset)\n                s := calldataload(add(signature.offset, 0x20))\n                v := byte(0, calldataload(add(signature.offset, 0x40)))\n            }\n            // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098)\n            case 64 {\n                let vs := calldataload(add(signature.offset, 0x20))\n                r := calldataload(signature.offset)\n                s := and(vs, shr(1, not(0)))\n                v := add(shr(255, vs), 27)\n            }\n            default {\n                r := 0\n                s := 0\n                v := 0\n            }\n        }\n    }\n\n    /**\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n     */\n    function _throwError(RecoverError error, bytes32 errorArg) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert ECDSAInvalidSignature();\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert ECDSAInvalidSignatureS(errorArg);\n        }\n    }\n}\n",
      "keccak256": "0x360cf86214a764694dae1522a38200b1737fe90e46dcf56a0f89de143071cc20"
    },
    "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.24;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\nimport {IERC7913SignatureVerifier} from \"../../interfaces/IERC7913.sol\";\nimport {Bytes} from \"../Bytes.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support:\n *\n * * ECDSA signatures from externally owned accounts (EOAs)\n * * ERC-1271 signatures from smart contract wallets like Argent and Safe Wallet (previously Gnosis Safe)\n * * ERC-7913 signatures from keys that do not have an Ethereum address of their own\n *\n * See https://eips.ethereum.org/EIPS/eip-1271[ERC-1271] and https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].\n */\nlibrary SignatureChecker {\n    using Bytes for bytes;\n\n    /**\n     * @dev Checks if a signature is valid for a given signer and data hash. If the signer has code, the\n     * signature is validated against it using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     *\n     * NOTE: For an extended version of this function that supports ERC-7913 signatures, see {isValidSignatureNow-bytes-bytes32-bytes-}.\n     */\n    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n        if (signer.code.length == 0) {\n            (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n            return err == ECDSA.RecoverError.NoError && recovered == signer;\n        } else {\n            return isValidERC1271SignatureNow(signer, hash, signature);\n        }\n    }\n\n    /**\n     * @dev Variant of {isValidSignatureNow} that takes a signature in calldata\n     */\n    function isValidSignatureNowCalldata(\n        address signer,\n        bytes32 hash,\n        bytes calldata signature\n    ) internal view returns (bool) {\n        if (signer.code.length == 0) {\n            (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecoverCalldata(hash, signature);\n            return err == ECDSA.RecoverError.NoError && recovered == signer;\n        } else {\n            return isValidERC1271SignatureNow(signer, hash, signature);\n        }\n    }\n\n    /**\n     * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n     * against the signer smart contract using ERC-1271.\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function isValidERC1271SignatureNow(\n        address signer,\n        bytes32 hash,\n        bytes memory signature\n    ) internal view returns (bool result) {\n        bytes4 selector = IERC1271.isValidSignature.selector;\n        uint256 length = signature.length;\n\n        assembly (\"memory-safe\") {\n            // Encoded calldata is :\n            // [ 0x00 - 0x03 ] <selector>\n            // [ 0x04 - 0x23 ] <hash>\n            // [ 0x24 - 0x44 ] <signature offset> (0x40)\n            // [ 0x44 - 0x64 ] <signature length>\n            // [ 0x64 - ...  ] <signature data>\n            let ptr := mload(0x40)\n            mstore(ptr, selector)\n            mstore(add(ptr, 0x04), hash)\n            mstore(add(ptr, 0x24), 0x40)\n            mcopy(add(ptr, 0x44), signature, add(length, 0x20))\n\n            let success := staticcall(gas(), signer, ptr, add(length, 0x64), 0x00, 0x20)\n            result := and(success, and(gt(returndatasize(), 0x1f), eq(mload(0x00), selector)))\n        }\n    }\n\n    /**\n     * @dev Verifies a signature for a given ERC-7913 signer and hash.\n     *\n     * The signer is a `bytes` object that is the concatenation of an address and optionally a key:\n     * `verifier || key`. A signer must be at least 20 bytes long.\n     *\n     * Verification is done as follows:\n     *\n     * * If `signer.length < 20`: verification fails\n     * * If `signer.length == 20`: verification is done using {isValidSignatureNow}\n     * * Otherwise: verification is done using {IERC7913SignatureVerifier}\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function isValidSignatureNow(\n        bytes memory signer,\n        bytes32 hash,\n        bytes memory signature\n    ) internal view returns (bool) {\n        if (signer.length < 20) {\n            return false;\n        } else if (signer.length == 20) {\n            return isValidSignatureNow(address(bytes20(signer)), hash, signature);\n        } else {\n            (bool success, bytes memory result) = address(bytes20(signer)).staticcall(\n                abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature))\n            );\n            return (success &&\n                result.length >= 32 &&\n                abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector));\n        }\n    }\n\n    /**\n     * @dev Verifies multiple ERC-7913 `signatures` for a given `hash` using a set of `signers`.\n     * Returns `false` if the number of signers and signatures is not the same.\n     *\n     * The signers should be ordered by their `keccak256` hash to ensure efficient duplication check. Unordered\n     * signers are supported, but the uniqueness check will be more expensive.\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function areValidSignaturesNow(\n        bytes32 hash,\n        bytes[] memory signers,\n        bytes[] memory signatures\n    ) internal view returns (bool) {\n        if (signers.length != signatures.length) return false;\n\n        bytes32 lastId = bytes32(0);\n\n        for (uint256 i = 0; i < signers.length; ++i) {\n            bytes memory signer = signers[i];\n\n            // If one of the signatures is invalid, reject the batch\n            if (!isValidSignatureNow(signer, hash, signatures[i])) return false;\n\n            bytes32 id = keccak256(signer);\n            // If the current signer ID is greater than all previous IDs, then this is a new signer.\n            if (lastId < id) {\n                lastId = id;\n            } else {\n                // If this signer id is not greater than all the previous ones, verify that it is not a duplicate of a previous one\n                // This loop is never executed if the signers are ordered by id.\n                for (uint256 j = 0; j < i; ++j) {\n                    if (id == keccak256(signers[j])) return false;\n                }\n            }\n        }\n\n        return true;\n    }\n}\n",
      "keccak256": "0x445455b8be33e09cf1db14e59c0d1c5aa5d312b5e754e8ae751e42313a0cae88"
    },
    "lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n            // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n            int256 mask = n >> 255;\n\n            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n            return uint256((n + mask) ^ mask);\n        }\n    }\n}\n",
      "keccak256": "0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3"
    },
    "src/talon/AccountRegistry.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\n/// @title AccountRegistry\n/// @notice Ownerless ERC-6551 registry using the standard proxy bytecode and CREATE2 addressing.\n/// @dev Local deployments are not the canonical registry address. Production uses the canonical registry.\ncontract AccountRegistry {\n    error AccountCreationFailed();\n    event ERC6551AccountCreated(\n        address account,\n        address indexed implementation,\n        bytes32 salt,\n        uint256 chainId,\n        address indexed tokenContract,\n        uint256 indexed tokenId\n    );\n\n    /// @notice Create an account, or return it if it already exists.\n    function createAccount(\n        address implementation,\n        bytes32 salt,\n        uint256 chainId,\n        address tokenContract,\n        uint256 tokenId\n    ) external returns (address result) {\n        bytes memory code = _code(implementation, salt, chainId, tokenContract, tokenId);\n        result = account(implementation, salt, chainId, tokenContract, tokenId);\n        if (result.code.length != 0) return result;\n        assembly (\"memory-safe\") { result := create2(0, add(code, 32), mload(code), salt) }\n        if (result == address(0)) revert AccountCreationFailed();\n        emit ERC6551AccountCreated(result, implementation, salt, chainId, tokenContract, tokenId);\n    }\n\n    /// @notice Compute the ERC-6551 address before deployment.\n    function account(\n        address implementation,\n        bytes32 salt,\n        uint256 chainId,\n        address tokenContract,\n        uint256 tokenId\n    ) public view returns (address) {\n        return address(\n            uint160(\n                uint256(\n                    keccak256(\n                        abi.encodePacked(\n                            bytes1(0xff),\n                            address(this),\n                            salt,\n                            keccak256(_code(implementation, salt, chainId, tokenContract, tokenId))\n                        )\n                    )\n                )\n            )\n        );\n    }\n\n    function _code(\n        address implementation,\n        bytes32 salt,\n        uint256 chainId,\n        address tokenContract,\n        uint256 tokenId\n    ) private pure returns (bytes memory) {\n        return abi.encodePacked(\n            hex\"3d60ad80600a3d3981f3\",\n            hex\"363d3d373d3d3d363d73\",\n            implementation,\n            hex\"5af43d82803e903d91602b57fd5bf3\",\n            abi.encode(salt, chainId, tokenContract, tokenId)\n        );\n    }\n}\n",
      "keccak256": "0xd613bb1fe2138359a86696518864e7b45c01e06d3d87d151ec01046bb45bad4b"
    },
    "src/talon/ITalonExtensions.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\ninterface ITalonExtensions {\n    function portfolioManager() external view returns (address);\n    function holderRewards() external view returns (address);\n}\n\ninterface ITalonHolderRewards {\n    function collection() external view returns (address);\n    function enroll(uint256 id, uint256 capital) external;\n    function exit(uint256 id) external;\n    function reduce(uint256 id, address asset, uint256 amount) external returns (uint256 ageAnchor);\n}\n\ninterface ITalonPortfolioManager {\n    function collection() external view returns (address);\n    function validatePurchase(address asset, uint256 amount) external view returns (uint256 minimum);\n    function validateDirectPurchase(address asset, uint256 amount) external view returns (uint256 minimum);\n}\n\ninterface ITalonExecutionReserve {\n    function collection() external view returns (address);\n    function fundUSDG(uint256 id, uint256 amount, uint256 minimumETH, uint256 actionFee, uint256 deadline)\n        external\n        returns (uint256 credited);\n}\n",
      "keccak256": "0x88afa38b4a1b4a06eb5b1ade4e1ef6fdfbad13164d4b15e0bdc0f0ab51fa0b84"
    },
    "src/talon/MintRouter.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {BasketRegistry} from \"./BasketRegistry.sol\";\nimport {ITalonExecutionReserve, ITalonPortfolioManager} from \"./ITalonExtensions.sol\";\nimport {TalonAccount} from \"./TalonAccount.sol\";\nimport {TalonNFT} from \"./TalonNFT.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/// @title MintRouter\n/// @notice USDG goes directly to the personal account and disclosed fee recipient. No pooled balance.\ncontract MintRouter is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n    error MintRouter__Paused();\n    error MintRouter__InvalidDeposit();\n    error MintRouter__CapExceeded();\n    error MintRouter__StaleTemplate();\n    error MintRouter__TransferMismatch();\n    error MintRouter__DepositorNotAllowed();\n    error MintRouter__InvalidExecutionReserve();\n\n    struct ExecutionFunding {\n        uint256 amount;\n        uint256 minimumETH;\n        uint256 actionFee;\n        uint256 deadline;\n    }\n    TalonNFT public immutable collection;\n    BasketRegistry public immutable config;\n    uint256 public constant directExecutionVersion = 1;\n    uint256 public cumulativeDeposits;\n    ITalonExecutionReserve public executionReserve;\n    event Deposited(address indexed owner, uint256 indexed tokenId, uint256 amount, uint256 fee);\n\n    constructor(TalonNFT collection_, BasketRegistry config_) {\n        collection = collection_;\n        config = config_;\n    }\n\n    /// @notice Fixed before the first mint. There is no replacement or admin sweep path.\n    function configureExecutionReserve(ITalonExecutionReserve reserve) external {\n        if (\n            msg.sender != collection.extensionInitializer() || address(executionReserve) != address(0)\n                || collection.nextTokenId() != 1 || address(reserve).code.length == 0\n                || reserve.collection() != address(collection)\n        ) revert MintRouter__InvalidExecutionReserve();\n        executionReserve = reserve;\n    }\n\n    /// @notice Portfolio deposit and an explicitly separate execution reserve, paid by the buyer.\n    function mintFunded(\n        bytes32 basketId,\n        uint32 expectedVersion,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline,\n        ExecutionFunding calldata funding\n    ) external nonReentrant returns (uint256 id, address account) {\n        BasketRegistry.Basket memory b = config.basket(basketId);\n        if (b.version != expectedVersion) revert MintRouter__StaleTemplate();\n        (id, account) = _mint(basketId, b.version, b.assets, b.weights, amount, minimums, deadline);\n        _fundExecution(id, funding);\n        collection.completeMint(msg.sender, id);\n    }\n\n    function mintCustomFunded(\n        address[] calldata assets,\n        uint16[] calldata weights,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline,\n        ExecutionFunding calldata funding\n    ) external nonReentrant returns (uint256 id, address account) {\n        config.validate(assets, weights);\n        (id, account) = _mint(bytes32(0), 0, assets, weights, amount, minimums, deadline);\n        _fundExecution(id, funding);\n        collection.completeMint(msg.sender, id);\n    }\n\n    function _fundExecution(uint256 id, ExecutionFunding calldata funding) private {\n        if (address(executionReserve) == address(0) || funding.amount == 0 || funding.actionFee == 0) {\n            revert MintRouter__InvalidExecutionReserve();\n        }\n        IERC20 cash = IERC20(config.settlement());\n        uint256 beforeCash = cash.balanceOf(address(this));\n        cash.safeTransferFrom(msg.sender, address(this), funding.amount);\n        if (cash.balanceOf(address(this)) != beforeCash + funding.amount) {\n            revert MintRouter__TransferMismatch();\n        }\n        cash.forceApprove(address(executionReserve), funding.amount);\n        executionReserve.fundUSDG(id, funding.amount, funding.minimumETH, funding.actionFee, funding.deadline);\n        cash.forceApprove(address(executionReserve), 0);\n        if (cash.balanceOf(address(this)) != beforeCash) revert MintRouter__TransferMismatch();\n    }\n\n    /// @notice Mint from a version-pinned template with a minimum raw output for each entire purchase lot.\n    function mint(\n        bytes32 basketId,\n        uint32 expectedVersion,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline\n    ) external nonReentrant returns (uint256 id, address account) {\n        BasketRegistry.Basket memory b = config.basket(basketId);\n        if (b.version != expectedVersion) revert MintRouter__StaleTemplate();\n        (id, account) = _mint(basketId, b.version, b.assets, b.weights, amount, minimums, deadline);\n        collection.completeMint(msg.sender, id);\n    }\n\n    /// @notice Create an individual allocation from allowed assets. Custom allocations have no template version.\n    function mintCustom(\n        address[] calldata assets,\n        uint16[] calldata weights,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline\n    ) external nonReentrant returns (uint256 id, address account) {\n        config.validate(assets, weights);\n        (id, account) = _mint(bytes32(0), 0, assets, weights, amount, minimums, deadline);\n        collection.completeMint(msg.sender, id);\n    }\n\n    /// @notice Creates and fully buys a portfolio atomically. The caller pays transaction gas.\n    function mintDirect(\n        bytes32 basketId,\n        uint32 expectedVersion,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline\n    ) external nonReentrant returns (uint256 id, address account) {\n        BasketRegistry.Basket memory b = config.basket(basketId);\n        if (b.version != expectedVersion) revert MintRouter__StaleTemplate();\n        (id, account) = _mint(basketId, b.version, b.assets, b.weights, amount, minimums, deadline);\n        TalonAccount(payable(account)).executeInitialPurchase();\n        collection.completeMint(msg.sender, id);\n    }\n\n    function mintCustomDirect(\n        address[] calldata assets,\n        uint16[] calldata weights,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline\n    ) external nonReentrant returns (uint256 id, address account) {\n        config.validate(assets, weights);\n        (id, account) = _mint(bytes32(0), 0, assets, weights, amount, minimums, deadline);\n        TalonAccount(payable(account)).executeInitialPurchase();\n        collection.completeMint(msg.sender, id);\n    }\n\n    function _mint(\n        bytes32 basketId,\n        uint32 version,\n        address[] memory assets,\n        uint16[] memory weights,\n        uint256 amount,\n        uint256[] calldata minimums,\n        uint256 deadline\n    ) private returns (uint256 id, address account) {\n        if (config.paused()) revert MintRouter__Paused();\n        if (!config.canDeposit(msg.sender)) revert MintRouter__DepositorNotAllowed();\n        if (amount < 10_000 || minimums.length != assets.length) revert MintRouter__InvalidDeposit();\n        if (amount > config.positionCap() || amount + cumulativeDeposits > config.depositCap()) {\n            revert MintRouter__CapExceeded();\n        }\n        // Revalidate asset eligibility after a template was configured.\n        config.validate(assets, weights);\n        cumulativeDeposits += amount; // Conservative lifetime launch cap, never reopened by redeeming.\n        uint256 fee = Math.mulDiv(amount, config.MINT_FEE_BPS(), 10_000, Math.Rounding.Ceil);\n        uint256 net = amount - fee;\n        uint256[] memory budgets = new uint256[](assets.length);\n        for (uint256 i; i < assets.length; ++i) {\n            budgets[i] = Math.mulDiv(net, weights[i], 10_000);\n            if (collection.portfolioManager() != address(0)) {\n                // Only the atomic entry points use execution pricing. Queued purchases retain reference guards.\n                ITalonPortfolioManager manager = ITalonPortfolioManager(collection.portfolioManager());\n                if (msg.sig == this.mintDirect.selector || msg.sig == this.mintCustomDirect.selector) {\n                    manager.validateDirectPurchase(assets[i], budgets[i]);\n                } else {\n                    manager.validatePurchase(assets[i], budgets[i]);\n                }\n            }\n        }\n        (id, account) =\n            collection.createPosition(msg.sender, basketId, version, assets, budgets, minimums, deadline);\n        IERC20 cash = IERC20(config.settlement());\n        uint256 beforeAccount = cash.balanceOf(account);\n        cash.safeTransferFrom(msg.sender, account, net);\n        uint256 beforeFee = cash.balanceOf(config.feeRecipient());\n        cash.safeTransferFrom(msg.sender, config.feeRecipient(), fee);\n        uint256 creditedFee = msg.sender == config.feeRecipient() ? 0 : fee;\n        if (\n            cash.balanceOf(account) != beforeAccount + net\n                || cash.balanceOf(config.feeRecipient()) != beforeFee + creditedFee\n        ) {\n            revert MintRouter__TransferMismatch();\n        }\n        emit Deposited(msg.sender, id, amount, fee);\n    }\n}\n",
      "keccak256": "0x3028a47dce8d4d4586fd92ea7a1c64c750c99fc32249a62c4f94814e30f2c82a"
    },
    "src/talon/StreamingFees.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/// @notice Asset-denominated streaming fees. Unpaid fees stay backed by tokens in the personal account.\n/// @dev A failed fee transfer reserves only that fee; healthy owner withdrawals remain possible.\nabstract contract StreamingFees {\n    using SafeERC20 for IERC20;\n    uint256 private constant FEE_DENOMINATOR = 1_000_000 * 365 days;\n    mapping(address => uint256) private _feeAt;\n    mapping(address => uint256) private _assetRateIndex;\n    uint256 private _scheduleAt;\n    uint256 private _scheduleIndex;\n    mapping(address => uint256) private _feeDebt;\n    mapping(address => uint256) private _feeReserved;\n    mapping(address => uint256) private _feeRemainder;\n    uint256 internal feeStoppedAt;\n    error Streaming__Unauthorized();\n    error Streaming__InsufficientBalance();\n    event StreamingFeePaid(address indexed asset, uint256 amount);\n    event StreamingFeeDeferred(address indexed asset, uint256 amount);\n\n    function _feesEnabled() internal view virtual returns (bool);\n    function _feeRecipient() internal view virtual returns (address);\n    function _feeAgeAnchor() internal view virtual returns (uint256);\n\n    /// @notice Accrued fee, including reserved fees from previously failed transfers, in raw asset units.\n    function streamingFee(address asset) public view returns (uint256 debt) {\n        if (!_feesEnabled() || asset == address(0)) return 0;\n        (debt,) = _previewFee(asset);\n    }\n\n    /// @notice Owner's current net balance after streaming fees; no oracle dependency.\n    function withdrawable(address asset) public view returns (uint256) {\n        if (asset == address(0)) return address(this).balance;\n        return IERC20(asset).balanceOf(address(this)) - streamingFee(asset);\n    }\n\n    /// @notice Remaining input after its proportional streaming fee. Input is the owner's gross amount.\n    function inputAfterStreamingFee(address asset, uint256 gross) public view returns (uint256) {\n        if (!_feesEnabled() || asset == address(0) || gross == 0) return gross;\n        uint256 ownedGross = IERC20(asset).balanceOf(address(this)) - _feeReserved[asset];\n        if (gross > ownedGross) revert Streaming__InsufficientBalance();\n        uint256 activeDebt = streamingFee(asset) - _feeReserved[asset];\n        return gross - Math.mulDiv(activeDebt, gross, ownedGross, Math.Rounding.Ceil);\n    }\n\n    function _initializeFee(address asset) internal {\n        if (_scheduleAt == 0) _scheduleAt = block.timestamp;\n        _feeAt[asset] = block.timestamp;\n        _assetRateIndex[asset] = _currentRateIndex();\n    }\n\n    /// @dev Checkpoint the rate before changing the age anchor. No external token reads are needed.\n    ///      A broken balanceOf on one equity must not block another asset's withdrawal.\n    function _checkpointFeeSchedule() internal {\n        _scheduleIndex = _currentRateIndex();\n        _scheduleAt = feeStoppedAt == 0 ? block.timestamp : feeStoppedAt;\n    }\n\n    function _currentRateIndex() private view returns (uint256) {\n        uint256 end = feeStoppedAt == 0 ? block.timestamp : feeStoppedAt;\n        uint256 start = _scheduleAt;\n        if (start == 0 || end <= start) return _scheduleIndex;\n        uint256 anchor = _feeAgeAnchor();\n        return _scheduleIndex + _integral(end > anchor ? end - anchor : 0)\n            - _integral(start > anchor ? start - anchor : 0);\n    }\n\n    function _assessFee(address asset) internal {\n        if (!_feesEnabled() || asset == address(0)) return;\n        (uint256 debt, uint256 remainder) = _previewFee(asset);\n        _feeDebt[asset] = debt;\n        _feeRemainder[asset] = remainder;\n        _assetRateIndex[asset] = _currentRateIndex();\n        _feeAt[asset] = feeStoppedAt == 0 ? block.timestamp : feeStoppedAt;\n    }\n\n    /// @dev Charged from this clip, never as an extra debit from a later clip's budget.\n    function _takeStreamingFee(address asset, uint256 gross) internal returns (uint256 net) {\n        if (!_feesEnabled() || asset == address(0) || gross == 0) return gross;\n        _assessFee(asset);\n        uint256 ownedGross = IERC20(asset).balanceOf(address(this)) - _feeReserved[asset];\n        if (gross > ownedGross) revert Streaming__InsufficientBalance();\n        uint256 fee =\n            Math.mulDiv(_feeDebt[asset] - _feeReserved[asset], gross, ownedGross, Math.Rounding.Ceil);\n        if (fee != 0) _sendFee(asset, fee, false);\n        return gross - fee;\n    }\n\n    function _collectStreamingFee(address asset) internal {\n        if (!_feesEnabled() || asset == address(0)) return;\n        _assessFee(asset);\n        uint256 reserved = _feeReserved[asset];\n        if (reserved != 0) _sendFee(asset, reserved, true);\n        uint256 active = _feeDebt[asset] - _feeReserved[asset];\n        if (active != 0) _sendFee(asset, active, false);\n    }\n\n    function _ownedGrossBalance(address asset) internal view returns (uint256) {\n        return IERC20(asset).balanceOf(address(this)) - _feeReserved[asset];\n    }\n\n    /// @dev Isolated self-call. Reverting issuer transfers preserve fee liabilities atomically.\n    function transferStreamingFee(address asset, uint256 amount, bool reserved) external {\n        if (msg.sender != address(this)) revert Streaming__Unauthorized();\n        _feeDebt[asset] -= amount;\n        if (reserved) _feeReserved[asset] -= amount;\n        IERC20(asset).safeTransfer(_feeRecipient(), amount);\n        emit StreamingFeePaid(asset, amount);\n    }\n\n    function _sendFee(address asset, uint256 amount, bool reserved) private {\n        try this.transferStreamingFee(asset, amount, reserved) {}\n        catch {\n            if (!reserved) _feeReserved[asset] += amount;\n            emit StreamingFeeDeferred(asset, amount);\n        }\n    }\n\n    function _previewFee(address asset) private view returns (uint256 debt, uint256 remainder) {\n        debt = _feeDebt[asset];\n        remainder = _feeRemainder[asset];\n        uint256 end = feeStoppedAt == 0 ? block.timestamp : feeStoppedAt;\n        uint256 start = _feeAt[asset];\n        if (start == 0 || start >= end) return (debt, remainder);\n        uint256 integratedRate = _currentRateIndex() - _assetRateIndex[asset];\n        uint256 netBalance = IERC20(asset).balanceOf(address(this)) - debt;\n        uint256 accrued = Math.mulDiv(netBalance, integratedRate, FEE_DENOMINATOR);\n        remainder += mulmod(netBalance, integratedRate, FEE_DENOMINATOR);\n        accrued += remainder / FEE_DENOMINATOR;\n        remainder %= FEE_DENOMINATOR;\n        if (accrued >= netBalance) return (debt + netBalance, 0);\n        return (debt + accrued, remainder);\n    }\n\n    // Annual rates: 0.5%, 0.4375%, 0.375%, then 0.25%. Integrating across grade boundaries\n    // prevents a late checkpoint from applying today's discount to earlier holding periods.\n    function _integral(uint256 age) private pure returns (uint256 result) {\n        result = Math.min(age, 90 days) * 5000;\n        if (age > 90 days) result += Math.min(age - 90 days, 90 days) * 4375;\n        if (age > 180 days) result += Math.min(age - 180 days, 185 days) * 3750;\n        if (age > 365 days) result += (age - 365 days) * 2500;\n    }\n}\n",
      "keccak256": "0xca00b46106c96b0ab1ed608502e7945abe0b260d0f00daa4fb2bc06e90bb6774"
    },
    "src/talon/TalonAccount.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {BasketRegistry} from \"./BasketRegistry.sol\";\nimport {Executor} from \"./Executor.sol\";\nimport {ITalonExtensions, ITalonHolderRewards, ITalonPortfolioManager} from \"./ITalonExtensions.sol\";\nimport {StreamingFees} from \"./StreamingFees.sol\";\nimport {IERC1271} from \"@openzeppelin/contracts/interfaces/IERC1271.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IERC721} from \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {SignatureChecker} from \"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface ITalonCollection is IERC721 {\n    function burnFromAccount(uint256 tokenId) external;\n    function mintRouter() external view returns (address);\n}\n\ninterface IERC6551Account {\n    function token() external view returns (uint256, address, uint256);\n    function state() external view returns (uint256);\n    function isValidSigner(address signer, bytes calldata context) external view returns (bytes4);\n}\n\ninterface ITalonWithdraw {\n    function withdraw(address asset, uint256 amount, address recipient) external;\n}\n\n/// @title TalonAccount\n/// @notice Restricted ERC-6551 account: owner withdrawals and pre-authorized purchases only.\n/// @dev No arbitrary calls, delegatecall, approvals or delegated trading. Non-upgradeable. T-01 through T-07.\ncontract TalonAccount is IERC165, IERC1271, IERC6551Account, ITalonWithdraw, ReentrancyGuard, StreamingFees {\n    using SafeERC20 for IERC20;\n\n    struct Lot {\n        address asset;\n        uint256 budget;\n        uint256 spent;\n        uint256 minOutput;\n        uint256 lastClipAt;\n    }\n    error TalonAccount__Unauthorized();\n    error TalonAccount__InvalidPlan();\n    error TalonAccount__ExecutionUnavailable();\n    error TalonAccount__InvalidClip();\n    error TalonAccount__InvalidReceiver();\n    error TalonAccount__NativeTransferFailed();\n    address public immutable collection;\n    BasketRegistry public immutable config;\n    Executor public immutable executor;\n    uint256 public constant CLIP_INTERVAL = 5 minutes;\n    uint256 public constant MAX_CLIP_BPS = 2500;\n    uint256 public constant MIN_CLIP_BPS = 500;\n    uint256 public state;\n    uint256 public deadline;\n    uint256 public openedAt;\n    bool public initialized;\n    bool public cancelled;\n    bool public busy;\n    address public exitBeneficiary;\n    Lot[] private _lots;\n    address[] private _managedAssets;\n    uint256 public managedDeadline;\n    uint256 public ownershipEpoch;\n    event ClipExecuted(uint256 indexed lot, uint256 spent, uint256 received);\n    event PurchaseCancelled();\n    event Withdrawn(address indexed asset, address indexed recipient, uint256 amount);\n    event InKindRedeemed(address indexed beneficiary);\n    event WithdrawalDeferred(address indexed asset, address indexed beneficiary);\n\n    constructor(address collection_, BasketRegistry config_, Executor executor_) {\n        collection = collection_;\n        config = config_;\n        executor = executor_;\n        initialized = true; // Disable initialization of the implementation itself.\n    }\n\n    receive() external payable {}\n\n    /// @notice Initialize only from the NFT contract, before the account receives its deposit.\n    function initialize(\n        address[] calldata assets,\n        uint256[] calldata budgets,\n        uint256[] calldata minimums,\n        uint256 deadline_\n    ) external {\n        if (msg.sender != collection || initialized) {\n            revert TalonAccount__Unauthorized();\n        }\n        if (\n            assets.length == 0 || assets.length > 10 || budgets.length != assets.length\n                || minimums.length != assets.length || deadline_ <= block.timestamp\n                || deadline_ > block.timestamp + 4 hours\n        ) revert TalonAccount__InvalidPlan();\n        initialized = true;\n        deadline = deadline_;\n        openedAt = block.timestamp;\n        _initializeFee(config.settlement());\n        for (uint256 i; i < assets.length; ++i) {\n            if (budgets[i] == 0 || minimums[i] == 0) revert TalonAccount__InvalidPlan();\n            _lots.push(Lot(assets[i], budgets[i], 0, minimums[i], 0));\n            _initializeFee(assets[i]);\n        }\n        ++state;\n    }\n\n    /// @notice Decode the ERC-6551 proxy footer. No external registry or mutable owner cache is used.\n    function token() public view returns (uint256 chainId, address tokenContract, uint256 tokenId) {\n        bytes memory footer = new bytes(96);\n        assembly (\"memory-safe\") { extcodecopy(address(), add(footer, 32), 77, 96) }\n        return abi.decode(footer, (uint256, address, uint256));\n    }\n\n    /// @notice Current NFT holder; after redemption, the fixed beneficiary of deferred withdrawals.\n    function owner() public view returns (address) {\n        if (exitBeneficiary != address(0)) return exitBeneficiary;\n        (uint256 chainId, address tokenContract, uint256 tokenId) = token();\n        if (chainId != block.chainid || tokenContract != collection) return address(0);\n        try IERC721(tokenContract).ownerOf(tokenId) returns (address holder) {\n            return holder;\n        } catch {\n            return address(0);\n        }\n    }\n\n    /// @notice Signal the ERC-6551 interface and the restricted withdrawal execution interface.\n    function supportsInterface(bytes4 id) external pure returns (bool) {\n        return id == type(IERC165).interfaceId || id == type(IERC6551Account).interfaceId\n            || id == type(IERC1271).interfaceId || id == type(ITalonWithdraw).interfaceId;\n    }\n\n    /// @notice Check the current holder, excluding the zero address and burned positions.\n    function isValidSigner(address signer, bytes calldata) external view returns (bytes4) {\n        return signer != address(0) && signer == owner() && exitBeneficiary == address(0)\n            ? IERC6551Account.isValidSigner.selector\n            : bytes4(0);\n    }\n\n    /// @notice Verify a signature against the current owner; transfer revokes the previous owner's signatures.\n    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4) {\n        address holder = owner();\n        return holder != address(0) && exitBeneficiary == address(0)\n            && SignatureChecker.isValidSignatureNow(holder, hash, signature)\n            ? bytes4(0x1626ba7e)\n            : bytes4(0xffffffff);\n    }\n\n    /// @notice All initial purchase lots, in their immutable order and raw token units.\n    function lots() external view returns (Lot[] memory) {\n        return _lots;\n    }\n\n    /// @notice Revoke the seller's unfilled purchase instruction; portfolio age and balances travel with the NFT.\n    function onOwnershipChanged() external {\n        if (msg.sender != collection) revert TalonAccount__Unauthorized();\n        ++ownershipEpoch;\n        _cancel();\n        ++state;\n    }\n\n    /// @notice Anyone can execute a bounded clip. Each leg is spaced by five minutes.\n    /// @dev Price floor rounds UP; budget and clip limits round DOWN. Unspent USDG stays in this account. T-03.\n    function executeClip(uint256 lotIndex, uint256 amountIn) external nonReentrant {\n        if (\n            !initialized || cancelled || config.paused() || block.timestamp > deadline\n                || exitBeneficiary != address(0)\n        ) {\n            revert TalonAccount__ExecutionUnavailable();\n        }\n        if (lotIndex >= _lots.length) revert TalonAccount__InvalidClip();\n        Lot storage lot = _lots[lotIndex];\n        uint256 clipCap = Math.ceilDiv(lot.budget, 4);\n        uint256 remaining = lot.budget - lot.spent;\n        // A dust clip must not consume a time slot and let a keeper starve the purchase plan.\n        uint256 clipFloor = Math.min(remaining, Math.max(1, Math.mulDiv(lot.budget, MIN_CLIP_BPS, 10_000)));\n        if (\n            amountIn == 0 || amountIn < clipFloor || amountIn > clipCap || amountIn > remaining\n                || (lot.lastClipAt != 0 && block.timestamp < lot.lastClipAt + CLIP_INTERVAL)\n        ) revert TalonAccount__InvalidClip();\n        uint256 minimum = Math.mulDiv(amountIn, lot.minOutput, lot.budget, Math.Rounding.Ceil);\n        busy = true;\n        uint256 tradeAmount = _takeStreamingFee(config.settlement(), amountIn);\n        _assessFee(lot.asset);\n        address manager = ITalonExtensions(collection).portfolioManager();\n        if (manager != address(0)) {\n            minimum =\n                Math.max(minimum, ITalonPortfolioManager(manager).validatePurchase(lot.asset, tradeAmount));\n        }\n        lot.spent += amountIn;\n        lot.lastClipAt = block.timestamp;\n        ++state;\n        busy = true;\n        IERC20 cash = IERC20(config.settlement());\n        cash.forceApprove(address(executor), tradeAmount);\n        uint256 received = executor.execute(address(cash), lot.asset, tradeAmount, minimum);\n        cash.forceApprove(address(executor), 0);\n        busy = false;\n        emit ClipExecuted(lotIndex, amountIn, received);\n    }\n\n    /// @notice Fully execute each initial lot during mint, before the receiver callback.\n    /// @dev Only the immutable router may call. Any failure rolls back the deposit, fees and NFT.\n    function executeInitialPurchase() external nonReentrant {\n        if (msg.sender != ITalonCollection(collection).mintRouter()) revert TalonAccount__Unauthorized();\n        if (\n            !initialized || cancelled || config.paused() || block.timestamp > deadline\n                || exitBeneficiary != address(0)\n        ) revert TalonAccount__ExecutionUnavailable();\n        busy = true;\n        address cash = config.settlement();\n        address manager = ITalonExtensions(collection).portfolioManager();\n        for (uint256 i; i < _lots.length; ++i) {\n            Lot storage lot = _lots[i];\n            if (lot.spent != 0) revert TalonAccount__InvalidClip();\n            uint256 minimum = lot.minOutput;\n            if (manager != address(0)) {\n                minimum = Math.max(\n                    minimum, ITalonPortfolioManager(manager).validateDirectPurchase(lot.asset, lot.budget)\n                );\n            }\n            lot.spent = lot.budget;\n            lot.lastClipAt = block.timestamp;\n            ++state;\n            IERC20(cash).forceApprove(address(executor), lot.budget);\n            uint256 received = executor.execute(cash, lot.asset, lot.budget, minimum);\n            IERC20(cash).forceApprove(address(executor), 0);\n            emit ClipExecuted(i, lot.budget, received);\n        }\n        busy = false;\n    }\n\n    /// @notice Permanently stop the purchase plan. Always available to the holder, including during a pause.\n    function cancelPurchase() external nonReentrant {\n        _onlyOwner();\n        _cancel();\n    }\n\n    /// @notice Withdraw one asset; a frozen token cannot block withdrawals of healthy assets.\n    /// @dev Any withdrawal cancels outstanding purchases. Partial withdrawal conservatively resets the age anchor. T-02, T-05.\n    function withdraw(address asset, uint256 amount, address recipient) external nonReentrant {\n        _onlyOwner();\n        _receiver(recipient);\n        _cancel();\n        busy = true;\n        _checkpointFeeSchedule();\n        address rewards = ITalonExtensions(collection).holderRewards();\n        if (rewards != address(0)) {\n            (,, uint256 id) = token();\n            openedAt = ITalonHolderRewards(rewards).reduce(id, asset, amount);\n        } else {\n            openedAt = block.timestamp;\n        }\n        ++state;\n        busy = true;\n        uint256 net = _takeStreamingFee(asset, amount);\n        if (net != 0) _transfer(asset, net, recipient);\n        busy = false;\n    }\n\n    /// @notice Burn the NFT and return all tracked assets. Failed issuer transfers stay claimable in this account.\n    /// @dev No oracle, router, governance or pause dependency. Recipient is fixed to the current holder. T-02.\n    function redeemInKind() external nonReentrant {\n        _onlyOwner();\n        _redeemInKind();\n    }\n\n    function _redeemInKind() private {\n        if (exitBeneficiary != address(0)) revert TalonAccount__ExecutionUnavailable();\n        address beneficiary = owner();\n        _cancel();\n        _stopRewards();\n        feeStoppedAt = block.timestamp;\n        exitBeneficiary = beneficiary;\n        ++state;\n        busy = true;\n        (,, uint256 id) = token();\n        ITalonCollection(collection).burnFromAccount(id);\n        _tryWithdraw(config.settlement(), beneficiary);\n        for (uint256 i; i < _lots.length; ++i) {\n            _tryWithdraw(_lots[i].asset, beneficiary);\n        }\n        for (uint256 i; i < _managedAssets.length; ++i) {\n            _tryWithdraw(_managedAssets[i], beneficiary);\n        }\n        if (address(this).balance != 0) _tryWithdraw(address(0), beneficiary);\n        busy = false;\n        emit InKindRedeemed(beneficiary);\n    }\n\n    /// @notice Assets acquired through either the initial basket or later managed trades.\n    function trackedAssets() external view returns (address[] memory assets) {\n        assets = new address[](_lots.length + _managedAssets.length);\n        for (uint256 i; i < _lots.length; ++i) {\n            assets[i] = _lots[i].asset;\n        }\n        for (uint256 i; i < _managedAssets.length; ++i) {\n            assets[_lots.length + i] = _managedAssets[i];\n        }\n    }\n\n    /// @dev Called only by the collection's fixed manager after it authenticates the current owner.\n    function beginManagedPlan(uint256 endsAt) external nonReentrant {\n        _onlyManager();\n        _cancel();\n        managedDeadline = endsAt;\n        ++state;\n    }\n\n    function endManagedPlan() external nonReentrant {\n        _onlyManager();\n        managedDeadline = 0;\n    }\n\n    function grossAvailable(address asset) external view returns (uint256) {\n        return asset == address(0) ? address(this).balance : _ownedGrossBalance(asset);\n    }\n\n    function previewManagedInput(address asset, uint256 gross, uint256 feeBps)\n        external\n        view\n        returns (uint256 net)\n    {\n        net = inputAfterStreamingFee(asset, gross);\n        if (asset == config.settlement()) net -= Math.mulDiv(net, feeBps, 10_000, Math.Rounding.Ceil);\n    }\n\n    /// @notice Anyone may collect backed streaming fees when no executable instruction would lose its budget.\n    function collectStreamingFees(address asset) external nonReentrant {\n        if (managedDeadline >= block.timestamp && managedDeadline != 0) {\n            revert TalonAccount__ExecutionUnavailable();\n        }\n        if (!cancelled && block.timestamp <= deadline) {\n            for (uint256 i; i < _lots.length; ++i) {\n                if (_lots[i].spent < _lots[i].budget) revert TalonAccount__ExecutionUnavailable();\n            }\n        }\n        busy = true;\n        _collectStreamingFee(asset);\n        ++state;\n        busy = false;\n    }\n\n    /// @notice Restricted execution into this account; the manager cannot choose a withdrawal recipient.\n    function executeManagedTrade(\n        address tokenIn,\n        address tokenOut,\n        uint256 amount,\n        uint256 minimum,\n        uint256 feeBps\n    ) external nonReentrant returns (uint256 received) {\n        _onlyManager();\n        address cash = config.settlement();\n        if (\n            config.paused() || amount == 0 || minimum == 0 || feeBps > 10 || tokenIn == tokenOut\n                || (tokenIn != cash && tokenOut != cash)\n        ) revert TalonAccount__ExecutionUnavailable();\n        if (tokenOut != cash) {\n            if (!config.allowedAsset(tokenOut)) revert TalonAccount__InvalidPlan();\n            _track(tokenOut);\n        }\n        busy = true;\n        ++state;\n        uint256 tradeAmount = _takeStreamingFee(tokenIn, amount);\n        _assessFee(tokenOut);\n        uint256 fee = tokenIn == cash ? Math.mulDiv(tradeAmount, feeBps, 10_000, Math.Rounding.Ceil) : 0;\n        tradeAmount -= fee;\n        IERC20(tokenIn).forceApprove(address(executor), tradeAmount);\n        // A cash-output floor is specified after the disclosed turnover fee.\n        uint256 grossMinimum = tokenOut == cash && feeBps != 0\n            ? Math.mulDiv(minimum, 10_000, 10_000 - feeBps, Math.Rounding.Ceil)\n            : minimum;\n        received = executor.execute(tokenIn, tokenOut, tradeAmount, grossMinimum);\n        IERC20(tokenIn).forceApprove(address(executor), 0);\n        if (tokenOut == cash) {\n            fee = Math.mulDiv(received, feeBps, 10_000, Math.Rounding.Ceil);\n            received -= fee;\n        }\n        if (received < minimum) revert TalonAccount__InvalidClip();\n        if (fee != 0) IERC20(cash).safeTransfer(config.feeRecipient(), fee);\n        busy = false;\n    }\n\n    function finalizeManagedExit() external nonReentrant {\n        _onlyManager();\n        _redeemInKind();\n    }\n\n    function _onlyManager() private view {\n        address manager = ITalonExtensions(collection).portfolioManager();\n        if (manager == address(0) || msg.sender != manager || exitBeneficiary != address(0)) {\n            revert TalonAccount__Unauthorized();\n        }\n    }\n\n    function _stopRewards() private {\n        address rewards = ITalonExtensions(collection).holderRewards();\n        if (rewards != address(0)) {\n            (,, uint256 id) = token();\n            ITalonHolderRewards(rewards).exit(id);\n        }\n    }\n\n    function _track(address asset) private {\n        for (uint256 i; i < _lots.length; ++i) {\n            if (_lots[i].asset == asset) return;\n        }\n        for (uint256 i; i < _managedAssets.length; ++i) {\n            if (_managedAssets[i] == asset) return;\n        }\n        for (uint256 i; i < _managedAssets.length; ++i) {\n            if (IERC20(_managedAssets[i]).balanceOf(address(this)) == 0) {\n                _managedAssets[i] = asset;\n                _initializeFee(asset);\n                return;\n            }\n        }\n        if (_lots.length + _managedAssets.length >= 20) revert TalonAccount__InvalidPlan();\n        _managedAssets.push(asset);\n        _initializeFee(asset);\n    }\n\n    /// @notice Isolated atomic withdrawal used to preserve a claim when an issuer or recipient rejects transfer.\n    function transferAll(address asset, address recipient) external {\n        if (msg.sender != address(this)) revert TalonAccount__Unauthorized();\n        uint256 amount = asset == address(0) ? address(this).balance : _ownedGrossBalance(asset);\n        uint256 net = _takeStreamingFee(asset, amount);\n        if (net != 0) _transfer(asset, net, recipient);\n    }\n\n    function _tryWithdraw(address asset, address beneficiary) private {\n        try this.transferAll(asset, beneficiary) {}\n        catch {\n            emit WithdrawalDeferred(asset, beneficiary);\n        }\n    }\n\n    function _cancel() private {\n        managedDeadline = 0;\n        if (!cancelled) {\n            cancelled = true;\n            ++state;\n            emit PurchaseCancelled();\n        }\n    }\n\n    function _feesEnabled() internal view override returns (bool) {\n        return ITalonExtensions(collection).holderRewards() != address(0);\n    }\n\n    function _feeRecipient() internal view override returns (address) {\n        return config.feeRecipient();\n    }\n\n    function _feeAgeAnchor() internal view override returns (uint256) {\n        return openedAt;\n    }\n\n    function _onlyOwner() private view {\n        if (msg.sender != owner() || msg.sender == address(0)) revert TalonAccount__Unauthorized();\n    }\n\n    function _receiver(address recipient) private view {\n        if (recipient == address(0) || recipient == address(this)) revert TalonAccount__InvalidReceiver();\n    }\n\n    function _transfer(address asset, uint256 amount, address recipient) private {\n        if (asset == address(0)) {\n            (bool ok,) = recipient.call{value: amount}(\"\");\n            if (!ok) revert TalonAccount__NativeTransferFailed();\n        } else {\n            IERC20(asset).safeTransfer(recipient, amount);\n        }\n        emit Withdrawn(asset, recipient, amount);\n    }\n}\n",
      "keccak256": "0x5211ca6b0885bd8d461611f0d551fb80bf71aef30b71ae8bdbd56f7fd02d97f5"
    },
    "src/talon/TalonNFT.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {AccountRegistry} from \"./AccountRegistry.sol\";\nimport {BasketRegistry} from \"./BasketRegistry.sol\";\nimport {Executor} from \"./Executor.sol\";\nimport {ITalonHolderRewards, ITalonPortfolioManager} from \"./ITalonExtensions.sol\";\nimport {MintRouter} from \"./MintRouter.sol\";\nimport {TalonAccount} from \"./TalonAccount.sol\";\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport {ERC721Enumerable} from \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport {ERC721Utils} from \"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\";\nimport {Base64} from \"@openzeppelin/contracts/utils/Base64.sol\";\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\n/// @title TalonNFT\n/// @notice One transferable NFT for each isolated portfolio account. No upgrade or admin transfer path.\ncontract TalonNFT is ERC721Enumerable {\n    using Strings for uint256;\n    error TalonNFT__Unauthorized();\n    error TalonNFT__AccountBusy();\n    error TalonNFT__OwnershipCycle();\n    AccountRegistry public immutable accountRegistry;\n    address public immutable accountImplementation;\n    MintRouter public immutable mintRouter;\n    uint256 public nextTokenId = 1;\n    uint256 public activeSupply;\n    address public immutable extensionInitializer;\n    address public portfolioManager;\n    address public holderRewards;\n    bool public extensionsConfigured;\n    mapping(uint256 => address) public accountOf;\n    mapping(address => bool) public isTalonAccount;\n    mapping(uint256 => bytes32) public basketOf;\n    mapping(uint256 => uint32) public basketVersion;\n    event PositionCreated(\n        uint256 indexed tokenId, address indexed owner, address account, bytes32 basket, uint32 version\n    );\n    event PositionClosed(uint256 indexed tokenId, address indexed beneficiary);\n\n    constructor(AccountRegistry registry, BasketRegistry config, Executor executor)\n        ERC721(\"Talon Finance\", \"TALON-P\")\n    {\n        accountRegistry = registry;\n        extensionInitializer = msg.sender;\n        accountImplementation = address(new TalonAccount(address(this), config, executor));\n        mintRouter = new MintRouter(this, config);\n    }\n\n    /// @notice Bind immutable release modules once, before the first portfolio is created.\n    function configureExtensions(address manager, address rewards) external {\n        if (\n            msg.sender != extensionInitializer || extensionsConfigured || nextTokenId != 1\n                || manager.code.length == 0 || rewards.code.length == 0\n                || ITalonPortfolioManager(manager).collection() != address(this)\n                || ITalonHolderRewards(rewards).collection() != address(this)\n        ) revert TalonNFT__Unauthorized();\n        portfolioManager = manager;\n        holderRewards = rewards;\n        extensionsConfigured = true;\n    }\n\n    /// @notice Create a portfolio account and position. Called only by the fixed mint router.\n    function createPosition(\n        address recipient,\n        bytes32 basketId,\n        uint32 version,\n        address[] calldata assets,\n        uint256[] calldata budgets,\n        uint256[] calldata minimums,\n        uint256 deadline\n    ) external returns (uint256 id, address account) {\n        if (msg.sender != address(mintRouter)) revert TalonNFT__Unauthorized();\n        id = nextTokenId++;\n        account = accountRegistry.createAccount(\n            accountImplementation, bytes32(0), block.chainid, address(this), id\n        );\n        accountOf[id] = account;\n        isTalonAccount[account] = true;\n        basketOf[id] = basketId;\n        basketVersion[id] = version;\n        TalonAccount(payable(account)).initialize(assets, budgets, minimums, deadline);\n        ++activeSupply;\n        _mint(recipient, id);\n        emit PositionCreated(id, recipient, account, basketId, version);\n    }\n\n    /// @notice Complete safe-mint acceptance after funds arrive. A rejected callback rolls back the whole mint.\n    function completeMint(address recipient, uint256 id) external {\n        if (msg.sender != address(mintRouter)) revert TalonNFT__Unauthorized();\n        if (holderRewards != address(0)) {\n            TalonAccount.Lot[] memory lots = TalonAccount(payable(accountOf[id])).lots();\n            uint256 capital;\n            for (uint256 i; i < lots.length; ++i) {\n                capital += lots[i].budget;\n            }\n            ITalonHolderRewards(holderRewards).enroll(id, capital);\n        }\n        ERC721Utils.checkOnERC721Received(msg.sender, address(0), recipient, id, \"\");\n    }\n\n    /// @notice Only the position's account can burn, after persisting the withdrawal beneficiary.\n    function burnFromAccount(uint256 id) external {\n        if (msg.sender != accountOf[id]) revert TalonNFT__Unauthorized();\n        address beneficiary = ownerOf(id);\n        --activeSupply;\n        _burn(id);\n        emit PositionClosed(id, beneficiary);\n    }\n\n    /// @notice Self-contained metadata with a verifiable account address and no mutable external server.\n    function tokenURI(uint256 id) public view override returns (string memory) {\n        _requireOwned(id);\n        return string.concat(\n            \"data:application/json;base64,\",\n            Base64.encode(\n                bytes(\n                    string.concat(\n                        '{\"name\":\"Talon #',\n                        id.toString(),\n                        '\",\"description\":\"An individually owned, transferable portfolio account.\",\"account\":\"',\n                        Strings.toHexString(accountOf[id]),\n                        '\",\"attributes\":[{\"trait_type\":\"Network\",\"value\":',\n                        block.chainid.toString(),\n                        \"}]}\"\n                    )\n                )\n            )\n        );\n    }\n\n    function _update(address to, uint256 id, address auth) internal override returns (address from) {\n        if (to != address(0) && isTalonAccount[to]) revert TalonNFT__OwnershipCycle();\n        address account = accountOf[id];\n        from = _ownerOf(id);\n        if (from != address(0) && to != address(0) && TalonAccount(payable(account)).busy()) {\n            revert TalonNFT__AccountBusy();\n        }\n        from = super._update(to, id, auth);\n        if (from != address(0) && to != address(0)) TalonAccount(payable(account)).onOwnershipChanged();\n    }\n}\n",
      "keccak256": "0x276dcbc2563d8257513946feb94294cdc65f55c0f405c5f3466587100d82e642"
    },
    "src/talon/AllocationStrategy.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {NavOracle} from \"./NavOracle.sol\";\nimport {TalonAccount} from \"./TalonAccount.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface IAllocationCollection {\n    function ownerOf(uint256 id) external view returns (address);\n    function accountOf(uint256 id) external view returns (address);\n}\n\ninterface IAllocationManager {\n    struct TradeInput {\n        address tokenIn;\n        address tokenOut;\n        uint256 amount;\n        uint256 minOutput;\n    }\n    function startTargetPlan(uint256 id, TradeInput[] calldata trades, uint256 deadline) external;\n}\n\n/// @notice Opt-in weekly target rebalancing. Keepers can execute only the owner's approved allocation.\n/// @dev Transfer permanently invalidates the grant, even if the NFT later returns to its former owner.\ncontract AllocationStrategy is ReentrancyGuard {\n    struct Target {\n        address grantor;\n        uint256 ownershipEpoch;\n        uint256 nextRebalance;\n        bool enabled;\n        address[] assets;\n        uint16[] weights;\n    }\n\n    struct Valuation {\n        address[] assets;\n        uint256[] values;\n        uint256 total;\n        uint256 cashBudget;\n        uint256 cashDebt;\n    }\n    error Strategy__Unauthorized();\n    error Strategy__Unavailable();\n    error Strategy__NoDrift();\n    IAllocationCollection public immutable collection;\n    IAllocationManager public immutable manager;\n    NavOracle public immutable oracle;\n    mapping(uint256 => Target) private _targets;\n    event TargetSet(uint256 indexed id, address indexed owner, address[] assets, uint16[] weights);\n    event TargetDisabled(uint256 indexed id);\n    event RebalanceStarted(uint256 indexed id, uint256 nextRebalance);\n\n    constructor(IAllocationCollection collection_, NavOracle oracle_, IAllocationManager manager_) {\n        collection = collection_;\n        oracle = oracle_;\n        manager = manager_;\n    }\n\n    function target(uint256 id) external view returns (Target memory) {\n        return _targets[id];\n    }\n\n    function setTarget(uint256 id, address[] calldata assets, uint16[] calldata weights)\n        external\n        nonReentrant\n    {\n        if (collection.ownerOf(id) != msg.sender) revert Strategy__Unauthorized();\n        TalonAccount account = TalonAccount(payable(collection.accountOf(id)));\n        account.config().validate(assets, weights);\n        _targets[id] =\n            Target(msg.sender, account.ownershipEpoch(), block.timestamp + 7 days, true, assets, weights);\n        emit TargetSet(id, msg.sender, assets, weights);\n    }\n\n    function disable(uint256 id) external {\n        if (msg.sender != address(manager) && collection.ownerOf(id) != msg.sender) {\n            revert Strategy__Unauthorized();\n        }\n        _targets[id].enabled = false;\n        emit TargetDisabled(id);\n    }\n\n    /// @notice Anyone may request the next approved rebalance after seven days and >3 percentage points of drift.\n    function start(uint256 id) external nonReentrant {\n        Target storage t = _targets[id];\n        if (block.timestamp < t.nextRebalance) revert Strategy__Unavailable();\n        IAllocationManager.TradeInput[] memory trades = quote(id);\n        t.nextRebalance = block.timestamp + 7 days;\n        manager.startTargetPlan(id, trades, block.timestamp + 4 hours);\n        emit RebalanceStarted(id, t.nextRebalance);\n    }\n\n    function quote(uint256 id) public view returns (IAllocationManager.TradeInput[] memory trades) {\n        Target storage t = _targets[id];\n        TalonAccount account = TalonAccount(payable(collection.accountOf(id)));\n        if (!t.enabled || t.grantor != collection.ownerOf(id) || t.ownershipEpoch != account.ownershipEpoch())\n        {\n            revert Strategy__Unavailable();\n        }\n        account.config().validate(t.assets, t.weights);\n        Valuation memory v = _value(account);\n        if (v.total == 0) revert Strategy__NoDrift();\n        uint256 threshold = Math.mulDiv(v.total, 300, 10_000);\n        bool drift;\n        for (uint256 i; i < v.assets.length; ++i) {\n            uint256 targetValue = Math.mulDiv(v.total, _weight(t, v.assets[i]), 10_000);\n            if (_difference(v.values[i], targetValue) > threshold) drift = true;\n        }\n        for (uint256 i; i < t.assets.length; ++i) {\n            uint256 targetValue = Math.mulDiv(v.total, t.weights[i], 10_000);\n            if (_difference(_assetValue(v, t.assets[i]), targetValue) > threshold) drift = true;\n        }\n        if (!drift) revert Strategy__NoDrift();\n        trades = new IAllocationManager.TradeInput[](v.assets.length + t.assets.length);\n        uint256 count = _sales(account, t, v, trades);\n        count = _purchases(t, v, trades, count);\n        if (count == 0) revert Strategy__NoDrift();\n        assembly (\"memory-safe\") { mstore(trades, count) }\n    }\n\n    function _sales(\n        TalonAccount account,\n        Target storage t,\n        Valuation memory v,\n        IAllocationManager.TradeInput[] memory trades\n    ) private view returns (uint256 count) {\n        address cash = oracle.settlement();\n        for (uint256 i; i < v.assets.length; ++i) {\n            uint256 targetValue = Math.mulDiv(v.total, _weight(t, v.assets[i]), 10_000);\n            if (v.values[i] <= targetValue) continue;\n            uint256 amount =\n                Math.mulDiv(account.grossAvailable(v.assets[i]), v.values[i] - targetValue, v.values[i]);\n            if (amount == 0) continue;\n            uint256 input = account.previewManagedInput(v.assets[i], amount, 10);\n            uint256 minimum = Math.mulDiv(oracle.quote(v.assets[i], cash, input), 9800, 10_000);\n            minimum -= Math.mulDiv(minimum, 10, 10_000, Math.Rounding.Ceil);\n            if (minimum == 0) continue;\n            trades[count++] = IAllocationManager.TradeInput(v.assets[i], cash, amount, minimum);\n            v.cashBudget += minimum;\n        }\n    }\n\n    function _purchases(\n        Target storage t,\n        Valuation memory v,\n        IAllocationManager.TradeInput[] memory trades,\n        uint256 count\n    ) private view returns (uint256) {\n        uint256[] memory deficits = new uint256[](t.assets.length);\n        uint256 totalDeficit;\n        for (uint256 i; i < t.assets.length; ++i) {\n            uint256 targetValue = Math.mulDiv(v.total, t.weights[i], 10_000);\n            uint256 current = _assetValue(v, t.assets[i]);\n            if (targetValue > current) {\n                deficits[i] = targetValue - current;\n                totalDeficit += deficits[i];\n            }\n        }\n        if (totalDeficit == 0) return count;\n        address cash = oracle.settlement();\n        for (uint256 i; i < t.assets.length; ++i) {\n            if (deficits[i] == 0) continue;\n            uint256 budget = Math.mulDiv(v.cashBudget, deficits[i], totalDeficit);\n            if (budget == 0) continue;\n            // A 2% planning allowance covers turnover, streaming and per-clip rounding. Execution still\n            // applies its independent, tighter current-price floor. Unspent cash stays with the owner.\n            uint256 input = budget - Math.mulDiv(v.cashDebt, budget, v.cashBudget, Math.Rounding.Ceil);\n            input -= Math.mulDiv(input, 10, 10_000, Math.Rounding.Ceil);\n            uint256 minimum = Math.mulDiv(oracle.quote(cash, t.assets[i], input), 9800, 10_000);\n            if (minimum == 0) continue;\n            trades[count++] = IAllocationManager.TradeInput(cash, t.assets[i], budget, minimum);\n        }\n        return count;\n    }\n\n    function _value(TalonAccount account) private view returns (Valuation memory v) {\n        address cash = oracle.settlement();\n        v.total = oracle.value(cash, account.withdrawable(cash));\n        v.cashBudget = account.grossAvailable(cash);\n        v.cashDebt = v.cashBudget - account.inputAfterStreamingFee(cash, v.cashBudget);\n        v.assets = account.trackedAssets();\n        v.values = new uint256[](v.assets.length);\n        for (uint256 i; i < v.assets.length; ++i) {\n            uint256 balance = account.withdrawable(v.assets[i]);\n            if (balance != 0) {\n                v.values[i] = oracle.value(v.assets[i], balance);\n                v.total += v.values[i];\n            }\n        }\n    }\n\n    function _weight(Target storage t, address asset) private view returns (uint256) {\n        for (uint256 i; i < t.assets.length; ++i) {\n            if (t.assets[i] == asset) return t.weights[i];\n        }\n        return 0;\n    }\n\n    function _assetValue(Valuation memory v, address asset) private pure returns (uint256) {\n        for (uint256 i; i < v.assets.length; ++i) {\n            if (v.assets[i] == asset) return v.values[i];\n        }\n        return 0;\n    }\n\n    function _difference(uint256 a, uint256 b) private pure returns (uint256) {\n        return a > b ? a - b : b - a;\n    }\n}\n",
      "keccak256": "0x006a694a4ecc99cbae171377ec3e2b11cc10cb86b089e58d08d89a9098f50e32"
    },
    "src/talon/PortfolioManager.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {AllocationStrategy, IAllocationCollection, IAllocationManager} from \"./AllocationStrategy.sol\";\nimport {NavOracle} from \"./NavOracle.sol\";\nimport {TalonAccount} from \"./TalonAccount.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface IManagedTalon {\n    function ownerOf(uint256 id) external view returns (address);\n    function accountOf(uint256 id) external view returns (address);\n    function portfolioManager() external view returns (address);\n}\n\n/// @notice Owner-authorized, revocable execution plans. Portfolio assets never enter this contract.\n/// @dev Transfer, withdrawal or replacement invalidates the previous plan by the account's state nonce.\ncontract PortfolioManager is ReentrancyGuard {\n    struct TradeInput {\n        address tokenIn;\n        address tokenOut;\n        uint256 amount;\n        uint256 minOutput;\n    }\n\n    struct Trade {\n        address tokenIn;\n        address tokenOut;\n        uint256 amount;\n        uint256 spent;\n        uint256 minOutput;\n        uint256 lastExecution;\n    }\n\n    struct Plan {\n        uint256 accountState;\n        uint256 deadline;\n        uint256 completed;\n        uint256 firstExecution;\n        bool cashExit;\n        bool active;\n        Trade[] trades;\n    }\n    error Portfolio__Unauthorized();\n    error Portfolio__InvalidPlan();\n    error Portfolio__Unavailable();\n    error Portfolio__InvalidClip();\n    IManagedTalon public immutable collection;\n    NavOracle public immutable oracle;\n    AllocationStrategy public immutable strategy;\n    address public immutable settlement;\n    mapping(uint256 => Plan) private _plans;\n    event PlanCreated(uint256 indexed id, uint256 accountState, uint256 deadline, bool cashExit);\n    event TradeExecuted(uint256 indexed id, uint256 indexed leg, uint256 spent, uint256 received);\n    event PlanCancelled(uint256 indexed id);\n\n    constructor(IManagedTalon collection_, NavOracle oracle_) {\n        if (address(collection_).code.length == 0 || address(oracle_).code.length == 0) {\n            revert Portfolio__InvalidPlan();\n        }\n        collection = collection_;\n        oracle = oracle_;\n        settlement = oracle_.settlement();\n        strategy = new AllocationStrategy(\n            IAllocationCollection(address(collection_)), oracle_, IAllocationManager(address(this))\n        );\n    }\n\n    function plan(uint256 id) external view returns (Plan memory) {\n        return _plans[id];\n    }\n\n    function validatePurchase(address asset, uint256 amount) external view returns (uint256 minimum) {\n        minimum = Math.mulDiv(oracle.quote(settlement, asset, amount), 9850, 10_000);\n        if (minimum == 0) revert Portfolio__Unavailable();\n    }\n\n    function validateDirectPurchase(address asset, uint256 amount) external view returns (uint256 minimum) {\n        minimum = Math.mulDiv(oracle.quoteExecution(settlement, asset, amount), 9850, 10_000);\n        if (minimum == 0) revert Portfolio__Unavailable();\n    }\n\n    /// @notice Rebalance between allowed equities and USDG using a per-leg minimum chosen by the owner.\n    function rebalance(uint256 id, TradeInput[] calldata trades, uint256 deadline) external nonReentrant {\n        _rebalance(id, trades, deadline, false);\n    }\n\n    function rebalanceDirect(uint256 id, TradeInput[] calldata trades, uint256 deadline)\n        external\n        nonReentrant\n    {\n        _rebalance(id, trades, deadline, true);\n        for (uint256 i; i < trades.length; ++i) {\n            _execute(id, i, trades[i].amount, true);\n        }\n    }\n\n    function _rebalance(uint256 id, TradeInput[] calldata trades, uint256 deadline, bool direct) private {\n        _owner(id);\n        if (trades.length == 0 || trades.length > 20) revert Portfolio__InvalidPlan();\n        strategy.disable(id);\n        _begin(id, deadline, false);\n        for (uint256 i; i < trades.length; ++i) {\n            TradeInput calldata t = trades[i];\n            if (\n                t.amount == 0 || t.minOutput == 0 || t.tokenIn == t.tokenOut\n                    || (t.tokenIn != settlement && t.tokenOut != settlement)\n            ) revert Portfolio__InvalidPlan();\n            // Direct owner trades use live DEX pricing; delegated plans retain independent reference guards.\n            uint256 quote = direct\n                ? oracle.quoteExecution(t.tokenIn, t.tokenOut, t.amount)\n                : oracle.quote(t.tokenIn, t.tokenOut, t.amount);\n            if (quote == 0) revert Portfolio__InvalidPlan();\n            _plans[id].trades.push(Trade(t.tokenIn, t.tokenOut, t.amount, 0, t.minOutput, 0));\n        }\n    }\n\n    /// @notice Queue liquidation while markets are closed. Keepers still need fresh prices to execute.\n    /// @dev The account remains owned and withdrawable. Cash payout equals actual proceeds, with no NAV guarantee.\n    function queueCashExit(uint256 id, uint256[] calldata minimums, uint256 deadline) external nonReentrant {\n        _queueCashExit(id, minimums, deadline);\n    }\n\n    /// @notice Sell all tracked equities and return proceeds in the owner's transaction, or revert in full.\n    function exitCashDirect(uint256 id, uint256[] calldata minimums, uint256 deadline) external nonReentrant {\n        _queueCashExit(id, minimums, deadline);\n        Plan storage p = _plans[id];\n        for (uint256 i; i < p.trades.length; ++i) {\n            _execute(id, i, p.trades[i].amount, true);\n        }\n        p.active = false;\n        TalonAccount(payable(collection.accountOf(id))).finalizeManagedExit();\n    }\n\n    function _queueCashExit(uint256 id, uint256[] calldata minimums, uint256 deadline) private {\n        _owner(id);\n        strategy.disable(id);\n        _begin(id, deadline, true);\n        address account = collection.accountOf(id);\n        address[] memory assets = TalonAccount(payable(account)).trackedAssets();\n        if (minimums.length != assets.length) revert Portfolio__InvalidPlan();\n        for (uint256 i; i < assets.length; ++i) {\n            uint256 balance = TalonAccount(payable(account)).grossAvailable(assets[i]);\n            if (balance == 0) continue;\n            if (minimums[i] == 0) revert Portfolio__InvalidPlan();\n            _plans[id].trades.push(Trade(assets[i], settlement, balance, 0, minimums[i], 0));\n        }\n    }\n\n    /// @notice Anyone may execute a due clip: rebalances every five minutes; four cash-exit slices 80 minutes apart.\n    function execute(uint256 id, uint256 index, uint256 amount)\n        external\n        nonReentrant\n        returns (uint256 received)\n    {\n        return _execute(id, index, amount, false);\n    }\n\n    function _execute(uint256 id, uint256 index, uint256 amount, bool direct)\n        private\n        returns (uint256 received)\n    {\n        Plan storage p = _plans[id];\n        TalonAccount account = TalonAccount(payable(collection.accountOf(id)));\n        if (!p.active || block.timestamp > p.deadline || p.accountState != account.state()) {\n            revert Portfolio__Unavailable();\n        }\n        if (index >= p.trades.length) revert Portfolio__InvalidClip();\n        Trade storage t = p.trades[index];\n        if (direct) {\n            if (amount == 0 || amount != t.amount - t.spent) revert Portfolio__InvalidClip();\n        } else {\n            _validateClip(t, p.cashExit, amount);\n        }\n        uint256 minimum = Math.mulDiv(amount, t.minOutput, t.amount, Math.Rounding.Ceil);\n        uint256 feeBps = p.cashExit ? 0 : 10;\n        uint256 quotedInput = account.previewManagedInput(t.tokenIn, amount, feeBps);\n        uint256 quote = direct\n            ? oracle.quoteExecution(t.tokenIn, t.tokenOut, quotedInput)\n            : oracle.quote(t.tokenIn, t.tokenOut, quotedInput);\n        uint256 referenceFloor = Math.mulDiv(quote, 9850, 10_000);\n        if (t.tokenOut == settlement) {\n            referenceFloor -= Math.mulDiv(referenceFloor, feeBps, 10_000, Math.Rounding.Ceil);\n        }\n        minimum = Math.max(minimum, referenceFloor);\n        if (minimum == 0) revert Portfolio__InvalidClip();\n        t.spent += amount;\n        if (p.firstExecution == 0) p.firstExecution = block.timestamp;\n        t.lastExecution = block.timestamp;\n        if (t.spent == t.amount) ++p.completed;\n        received = account.executeManagedTrade(t.tokenIn, t.tokenOut, amount, minimum, feeBps);\n        if (!p.cashExit && p.completed == p.trades.length) {\n            p.active = false;\n            account.endManagedPlan();\n        }\n        p.accountState = account.state();\n        emit TradeExecuted(id, index, amount, received);\n    }\n\n    /// @notice After every queued leg sells, the owner burns the NFT and receives its actual cash balance.\n    function finalizeCashExit(uint256 id) external nonReentrant {\n        _owner(id);\n        Plan storage p = _plans[id];\n        TalonAccount account = TalonAccount(payable(collection.accountOf(id)));\n        if (\n            !p.active || !p.cashExit || p.completed != p.trades.length || p.accountState != account.state()\n                || (p.trades.length != 0 && block.timestamp < p.firstExecution + 4 hours)\n        ) {\n            revert Portfolio__Unavailable();\n        }\n        // Ignore unsolicited equity donations: in-kind redemption sends those along with the USDG proceeds.\n        p.active = false;\n        account.finalizeManagedExit();\n    }\n\n    function cancel(uint256 id) external nonReentrant {\n        _owner(id);\n        _plans[id].active = false;\n        TalonAccount(payable(collection.accountOf(id))).endManagedPlan();\n        emit PlanCancelled(id);\n    }\n\n    function _begin(uint256 id, uint256 deadline, bool cashExit) private {\n        if (\n            collection.portfolioManager() != address(this) || deadline <= block.timestamp\n                || deadline > block.timestamp + (cashExit ? 7 days : 4 hours)\n        ) revert Portfolio__InvalidPlan();\n        TalonAccount account = TalonAccount(payable(collection.accountOf(id)));\n        account.beginManagedPlan(deadline);\n        delete _plans[id];\n        Plan storage p = _plans[id];\n        p.accountState = account.state();\n        p.deadline = deadline;\n        p.cashExit = cashExit;\n        p.active = true;\n        emit PlanCreated(id, p.accountState, deadline, cashExit);\n    }\n\n    function _owner(uint256 id) private view {\n        if (msg.sender != collection.ownerOf(id)) revert Portfolio__Unauthorized();\n    }\n\n    /// @dev Only the immutable strategy can submit the owner's previously approved target allocation.\n    function startTargetPlan(uint256 id, TradeInput[] calldata trades, uint256 deadline)\n        external\n        nonReentrant\n    {\n        if (msg.sender != address(strategy) || trades.length == 0 || trades.length > 30) {\n            revert Portfolio__Unauthorized();\n        }\n        _begin(id, deadline, false);\n        for (uint256 i; i < trades.length; ++i) {\n            TradeInput calldata t = trades[i];\n            if (\n                t.amount == 0 || t.minOutput == 0 || t.tokenIn == t.tokenOut\n                    || (t.tokenIn != settlement && t.tokenOut != settlement)\n            ) revert Portfolio__InvalidPlan();\n            _plans[id].trades.push(Trade(t.tokenIn, t.tokenOut, t.amount, 0, t.minOutput, 0));\n        }\n    }\n\n    function _validateClip(Trade storage t, bool cashExit, uint256 amount) private view {\n        uint256 remaining = t.amount - t.spent;\n        uint256 cap = Math.ceilDiv(t.amount, 4);\n        uint256 floor = cashExit ? Math.min(remaining, cap) : Math.min(remaining, Math.max(1, t.amount / 20));\n        uint256 interval = cashExit ? 80 minutes : 5 minutes;\n        if (\n            amount < floor || amount > cap || amount == 0 || amount > remaining\n                || (t.lastExecution != 0 && block.timestamp < t.lastExecution + interval)\n        ) {\n            revert Portfolio__InvalidClip();\n        }\n    }\n}\n",
      "keccak256": "0xa297579ea3a240a4d4d9f9802b288677b2f23b02e769cf486f3a35c857f2fac4"
    },
    "src/talon/rewards/HolderRewards.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {NavOracle} from \"../NavOracle.sol\";\nimport {TalonAccount} from \"../TalonAccount.sol\";\nimport {CouponDistributor} from \"./CouponDistributor.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface IRewardTalon {\n    function accountOf(uint256 id) external view returns (address);\n    function holderRewards() external view returns (address);\n}\n\n/// @notice Coupons belong to the transferable portfolio; only its current beneficiary can claim.\n/// @dev Weight is contributed capital, reduced on withdrawals, with a prospective maturity multiplier.\n/// Unsolicited donations and paper gains cannot create contributed capital or retrospective rewards.\ncontract HolderRewards is ReentrancyGuard {\n    struct Position {\n        uint256 capital;\n        uint256 weight;\n        bool enrolled;\n    }\n    error Holders__Unauthorized();\n    error Holders__InvalidConfiguration();\n    CouponDistributor public immutable coupons;\n    IRewardTalon public immutable collection;\n    NavOracle public immutable oracle;\n    mapping(uint256 => Position) public positions;\n    event WeightUpdated(uint256 indexed id, uint256 capital, uint256 weight);\n    event ValuationUnavailable(uint256 indexed id);\n\n    constructor(CouponDistributor coupons_, IRewardTalon collection_, NavOracle oracle_) {\n        if (\n            address(coupons_).code.length == 0 || address(collection_).code.length == 0\n                || address(oracle_).code.length == 0 || coupons_.rewardTokens(0) != oracle_.settlement()\n        ) {\n            revert Holders__InvalidConfiguration();\n        }\n        coupons = coupons_;\n        collection = collection_;\n        oracle = oracle_;\n    }\n\n    function enroll(uint256 id, uint256 capital) external nonReentrant {\n        if (\n            msg.sender != address(collection) || positions[id].enrolled\n                || collection.holderRewards() != address(this) || capital == 0\n                || capital > coupons.MAX_WEIGHT() / 2\n        ) {\n            revert Holders__Unauthorized();\n        }\n        positions[id] = Position(capital, capital, true);\n        coupons.setWeight(0, bytes32(id), capital);\n        emit WeightUpdated(id, capital, capital);\n    }\n\n    /// @notice Anyone can checkpoint a new maturity tier; increases apply to future elapsed time only.\n    function checkpoint(uint256 id) external nonReentrant {\n        Position storage p = positions[id];\n        if (!p.enrolled) revert Holders__InvalidConfiguration();\n        TalonAccount account = TalonAccount(payable(collection.accountOf(id)));\n        if (account.exitBeneficiary() != address(0)) return;\n        _weight(id, account.openedAt());\n    }\n\n    function multiplier(uint256 age) public pure returns (uint256) {\n        if (age >= 365 days) return 20_000;\n        if (age >= 180 days) return 15_000;\n        if (age >= 90 days) return 12_500;\n        return 10_000;\n    }\n\n    function claim(uint256 id, address recipient) external nonReentrant returns (uint256[2] memory amounts) {\n        if (msg.sender != TalonAccount(payable(collection.accountOf(id))).owner()) {\n            revert Holders__Unauthorized();\n        }\n        return coupons.claim(0, bytes32(id), recipient);\n    }\n\n    function claimToken(uint256 id, uint8 token, address recipient) external nonReentrant returns (uint256) {\n        if (msg.sender != TalonAccount(payable(collection.accountOf(id))).owner()) {\n            revert Holders__Unauthorized();\n        }\n        return coupons.claimToken(0, bytes32(id), token, recipient);\n    }\n\n    /// @dev Oracle failure must not trap portfolio withdrawals. It conservatively removes future weight.\n    function reduce(uint256 id, address asset, uint256 amount)\n        external\n        nonReentrant\n        returns (uint256 anchor)\n    {\n        TalonAccount account = _account(id);\n        anchor = account.openedAt();\n        if (amount == 0 || asset == address(0) || positions[id].capital == 0) return anchor;\n        try this.withdrawalValues(id, asset, amount) returns (uint256 total, uint256 removed) {\n            if (removed == 0) return anchor;\n            if (removed >= total || total == 0) {\n                positions[id].capital = 0;\n                anchor = block.timestamp;\n            } else {\n                positions[id].capital = Math.mulDiv(positions[id].capital, total - removed, total);\n                // A partial withdrawal reduces the retained age in proportion to removed portfolio value.\n                anchor += Math.mulDiv(block.timestamp - anchor, removed, total, Math.Rounding.Ceil);\n            }\n        } catch {\n            positions[id].capital = 0;\n            anchor = block.timestamp;\n            emit ValuationUnavailable(id);\n        }\n        _weight(id, anchor);\n    }\n\n    function exit(uint256 id) external nonReentrant {\n        _account(id);\n        positions[id].capital = 0;\n        _weight(id, block.timestamp);\n    }\n\n    function withdrawalValues(uint256 id, address asset, uint256 amount)\n        external\n        view\n        returns (uint256 total, uint256 removed)\n    {\n        address account = collection.accountOf(id);\n        address cash = oracle.settlement();\n        total = IERC20(cash).balanceOf(account);\n        bool tracked = asset == cash;\n        address[] memory assets = TalonAccount(payable(account)).trackedAssets();\n        for (uint256 i; i < assets.length; ++i) {\n            uint256 balance = IERC20(assets[i]).balanceOf(account);\n            if (balance != 0) total += oracle.value(assets[i], balance);\n            if (assets[i] == asset) tracked = true;\n        }\n        if (tracked) removed = asset == cash ? amount : oracle.value(asset, amount);\n    }\n\n    function _weight(uint256 id, uint256 anchor) private {\n        Position storage p = positions[id];\n        p.weight = Math.mulDiv(p.capital, multiplier(block.timestamp - anchor), 10_000);\n        coupons.setWeight(0, bytes32(id), p.weight);\n        emit WeightUpdated(id, p.capital, p.weight);\n    }\n\n    function _account(uint256 id) private view returns (TalonAccount account) {\n        address bound = collection.accountOf(id);\n        if (msg.sender != bound || !positions[id].enrolled) revert Holders__Unauthorized();\n        return TalonAccount(payable(bound));\n    }\n}\n",
      "keccak256": "0xb772771556d7c18eb28bff62d34a907e443469e772c34e3e864110663ee8b29f"
    },
    "src/talon/rewards/StakingLocker.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {CouponDistributor} from \"./CouponDistributor.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/// @notice Fixed-duration token locks with funded rewards and a disclosed 20% early-exit penalty.\n/// @dev No administrator may withdraw user principal or change existing lock terms.\ncontract StakingLocker is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n\n    struct Lock {\n        address owner;\n        uint256 principal;\n        uint256 weight;\n        uint256 unlockAt;\n    }\n    CouponDistributor public immutable coupons;\n    IERC20 public immutable token;\n    address public immutable reserve;\n    uint256 public nextId = 1;\n    mapping(address => uint256[]) private _ownerReceipts;\n    uint256 public totalPrincipal;\n    mapping(uint256 => Lock) public locks;\n    error Staking__Unauthorized();\n    error Staking__InvalidLock();\n    error Staking__BalanceMismatch();\n    event Staked(\n        uint256 indexed id, address indexed owner, uint256 principal, uint256 weight, uint256 unlockAt\n    );\n    event Unstaked(uint256 indexed id, address indexed owner, uint256 returned, uint256 penalty);\n\n    constructor(CouponDistributor coupons_, address reserve_) {\n        if (address(coupons_).code.length == 0 || reserve_ == address(0)) revert Staking__InvalidLock();\n        coupons = coupons_;\n        token = IERC20(coupons_.rewardTokens(1));\n        reserve = reserve_;\n    }\n\n    /// @notice Receipts remain discoverable after unstaking so unpaid Coupons are not hidden.\n    function receiptCount(address owner) external view returns (uint256) {\n        return _ownerReceipts[owner].length;\n    }\n\n    function receiptAt(address owner, uint256 index) external view returns (uint256) {\n        return _ownerReceipts[owner][index];\n    }\n\n    function terms(uint16 daysLocked) public pure returns (uint256 multiplierBps) {\n        if (daysLocked == 30) return 10_000;\n        if (daysLocked == 90) return 15_000;\n        if (daysLocked == 180) return 20_000;\n        if (daysLocked == 365) return 25_000;\n        revert Staking__InvalidLock();\n    }\n\n    function stake(uint256 amount, uint16 daysLocked) external nonReentrant returns (uint256 id) {\n        uint256 multiplier = terms(daysLocked);\n        if (amount == 0 || amount > coupons.MAX_WEIGHT() / 3) revert Staking__InvalidLock();\n        uint256 beforeBalance = token.balanceOf(address(this));\n        token.safeTransferFrom(msg.sender, address(this), amount);\n        if (token.balanceOf(address(this)) != beforeBalance + amount) revert Staking__BalanceMismatch();\n        id = nextId++;\n        _ownerReceipts[msg.sender].push(id);\n        uint256 weight = Math.mulDiv(amount, multiplier, 10_000);\n        uint256 unlock = block.timestamp + uint256(daysLocked) * 1 days;\n        locks[id] = Lock(msg.sender, amount, weight, unlock);\n        totalPrincipal += amount;\n        coupons.setWeight(1, bytes32(id), weight);\n        emit Staked(id, msg.sender, amount, weight, unlock);\n    }\n\n    function claim(uint256 id, address recipient) external nonReentrant returns (uint256[2] memory) {\n        if (locks[id].owner != msg.sender) revert Staking__Unauthorized();\n        return coupons.claim(1, bytes32(id), recipient);\n    }\n\n    /// @notice Accrued Coupons remain claimable after principal exits, even if a reward token is frozen.\n    function unstake(uint256 id) external nonReentrant {\n        Lock storage position = locks[id];\n        if (position.owner != msg.sender) revert Staking__Unauthorized();\n        uint256 amount = position.principal;\n        if (amount == 0) revert Staking__InvalidLock();\n        uint256 penalty =\n            block.timestamp < position.unlockAt ? Math.mulDiv(amount, 20, 100, Math.Rounding.Ceil) : 0;\n        position.principal = 0;\n        position.weight = 0;\n        totalPrincipal -= amount;\n        coupons.setWeight(1, bytes32(id), 0);\n        if (penalty != 0) {\n            // The exiting lock never earns its own penalty. With no remaining stakers, reserve receives it.\n            if (coupons.totalWeight(1) == 0) {\n                token.safeTransfer(reserve, penalty);\n            } else {\n                token.forceApprove(address(coupons), penalty);\n                coupons.fund(1, 1, penalty);\n                token.forceApprove(address(coupons), 0);\n            }\n        }\n        token.safeTransfer(msg.sender, amount - penalty);\n        emit Unstaked(id, msg.sender, amount - penalty, penalty);\n    }\n\n    function claimToken(uint256 id, uint8 rewardToken, address recipient)\n        external\n        nonReentrant\n        returns (uint256)\n    {\n        if (locks[id].owner != msg.sender) revert Staking__Unauthorized();\n        return coupons.claimToken(1, bytes32(id), rewardToken, recipient);\n    }\n}\n",
      "keccak256": "0xa7905f091e9cef3f95b9de61a1eea85028027845c6dde1096c4e6b8bcb97d098"
    },
    "src/talon/rewards/LiquidityLocker.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {TickMath} from \"../../vendor/uniswap-v4/TickMath.sol\";\nimport {ITalonV3Factory} from \"../UniswapV3Adapter.sol\";\nimport {CouponDistributor} from \"./CouponDistributor.sol\";\nimport {IERC721} from \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport {IERC721Receiver} from \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\n\ninterface ILPPositionManager is IERC721 {\n    struct Position {\n        uint96 nonce;\n        address operator;\n        address token0;\n        address token1;\n        uint24 fee;\n        int24 tickLower;\n        int24 tickUpper;\n        uint128 liquidity;\n        uint256 feeGrowthInside0LastX128;\n        uint256 feeGrowthInside1LastX128;\n        uint128 tokensOwed0;\n        uint128 tokensOwed1;\n    }\n\n    struct CollectParams {\n        uint256 tokenId;\n        address recipient;\n        uint128 amount0Max;\n        uint128 amount1Max;\n    }\n    function factory() external view returns (address);\n    function positions(uint256 id)\n        external\n        view\n        returns (\n            uint96,\n            address,\n            address,\n            address,\n            uint24,\n            int24,\n            int24,\n            uint128,\n            uint256,\n            uint256,\n            uint128,\n            uint128\n        );\n    function collect(CollectParams calldata params)\n        external\n        payable\n        returns (uint256 amount0, uint256 amount1);\n}\n\ninterface ILPFactory is ITalonV3Factory {\n    function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n}\n\n/// @notice Custody and time-weighted Coupons for full-range NFTs from one immutable V3 pool.\n/// @dev Equal ranges make liquidity units comparable. Concentrated, out-of-range and foreign-pool NFTs are rejected.\ncontract LiquidityLocker is IERC721Receiver, ReentrancyGuard {\n    error LP__InvalidConfiguration();\n    error LP__Unauthorized();\n    error LP__InvalidPosition();\n\n    struct Stake {\n        address owner;\n        uint256 tokenId;\n        uint128 liquidity;\n        bool active;\n    }\n    CouponDistributor public immutable coupons;\n    ILPPositionManager public immutable positionManager;\n    address public immutable token0;\n    address public immutable token1;\n    uint24 public immutable fee;\n    int24 public immutable tickLower;\n    int24 public immutable tickUpper;\n    mapping(uint256 => Stake) public stakes;\n    mapping(uint256 => uint256) public activeStake;\n    uint256 public nextStakeId = 1;\n    mapping(address => uint256[]) private _ownerReceipts;\n    uint256 private _receivingId;\n    address private _receivingOwner;\n    event Staked(uint256 indexed id, uint256 indexed tokenId, address indexed owner, uint128 liquidity);\n    event Unstaked(uint256 indexed id, address indexed owner);\n\n    constructor(\n        CouponDistributor coupons_,\n        ILPPositionManager manager_,\n        address factory_,\n        address pairedAsset,\n        uint24 fee_\n    ) {\n        if (\n            address(coupons_).code.length == 0 || address(manager_).code.length == 0\n                || factory_.code.length == 0 || manager_.factory() != factory_ || pairedAsset.code.length == 0\n        ) revert LP__InvalidConfiguration();\n        address protocolToken = coupons_.rewardTokens(1);\n        if (pairedAsset == protocolToken) revert LP__InvalidConfiguration();\n        coupons = coupons_;\n        positionManager = manager_;\n        fee = fee_;\n        (token0, token1) =\n            protocolToken < pairedAsset ? (protocolToken, pairedAsset) : (pairedAsset, protocolToken);\n        int24 spacing = ILPFactory(factory_).feeAmountTickSpacing(fee_);\n        if (spacing <= 0) {\n            revert LP__InvalidConfiguration();\n        }\n        tickLower = TickMath.minUsableTick(spacing);\n        tickUpper = TickMath.maxUsableTick(spacing);\n    }\n\n    /// @notice Receipts remain discoverable after unstaking so unpaid Coupons are not hidden.\n    function receiptCount(address owner) external view returns (uint256) {\n        return _ownerReceipts[owner].length;\n    }\n\n    function receiptAt(address owner, uint256 index) external view returns (uint256) {\n        return _ownerReceipts[owner][index];\n    }\n\n    function stake(uint256 tokenId) external nonReentrant returns (uint256 id) {\n        if (tokenId == 0 || activeStake[tokenId] != 0 || positionManager.ownerOf(tokenId) != msg.sender) {\n            revert LP__Unauthorized();\n        }\n        ILPPositionManager.Position memory p = _position(tokenId);\n        _validate(p);\n        _receivingId = tokenId;\n        _receivingOwner = msg.sender;\n        positionManager.safeTransferFrom(msg.sender, address(this), tokenId);\n        _receivingId = 0;\n        _receivingOwner = address(0);\n        if (positionManager.ownerOf(tokenId) != address(this)) revert LP__InvalidPosition();\n        id = nextStakeId++;\n        _ownerReceipts[msg.sender].push(id);\n        activeStake[tokenId] = id;\n        stakes[id] = Stake(msg.sender, tokenId, p.liquidity, true);\n        coupons.setWeight(2, bytes32(id), p.liquidity);\n        emit Staked(id, tokenId, msg.sender, p.liquidity);\n    }\n\n    /// @notice Additional liquidity donated to a locked NFT earns only after a checkpoint.\n    function checkpoint(uint256 id) external nonReentrant {\n        Stake storage s = stakes[id];\n        if (!s.active) revert LP__InvalidPosition();\n        ILPPositionManager.Position memory p = _position(s.tokenId);\n        _validate(p);\n        s.liquidity = p.liquidity;\n        coupons.setWeight(2, bytes32(id), p.liquidity);\n    }\n\n    /// @notice Unstaking never requires a reward-token transfer; a frozen reward cannot trap the LP NFT.\n    function unstake(uint256 id) external nonReentrant {\n        Stake storage s = stakes[id];\n        if (s.owner != msg.sender || !s.active) revert LP__Unauthorized();\n        s.active = false;\n        s.liquidity = 0;\n        activeStake[s.tokenId] = 0;\n        coupons.setWeight(2, bytes32(id), 0);\n        positionManager.safeTransferFrom(address(this), msg.sender, s.tokenId);\n        emit Unstaked(id, msg.sender);\n    }\n\n    function claim(uint256 id, address recipient) external nonReentrant returns (uint256[2] memory) {\n        if (stakes[id].owner != msg.sender) revert LP__Unauthorized();\n        return coupons.claim(2, bytes32(id), recipient);\n    }\n\n    function claimToken(uint256 id, uint8 token, address recipient) external nonReentrant returns (uint256) {\n        if (stakes[id].owner != msg.sender) revert LP__Unauthorized();\n        return coupons.claimToken(2, bytes32(id), token, recipient);\n    }\n\n    function collectTradingFees(uint256 id, address recipient)\n        external\n        nonReentrant\n        returns (uint256, uint256)\n    {\n        Stake storage s = stakes[id];\n        if (s.owner != msg.sender || !s.active || recipient == address(0) || recipient == address(this)) {\n            revert LP__Unauthorized();\n        }\n        return positionManager.collect(\n            ILPPositionManager.CollectParams(s.tokenId, recipient, type(uint128).max, type(uint128).max)\n        );\n    }\n\n    function onERC721Received(address operator, address from, uint256 id, bytes calldata)\n        external\n        view\n        returns (bytes4)\n    {\n        if (\n            msg.sender != address(positionManager) || operator != address(this) || id != _receivingId\n                || from != _receivingOwner || from == address(0)\n        ) revert LP__Unauthorized();\n        return IERC721Receiver.onERC721Received.selector;\n    }\n\n    function _position(uint256 id) private view returns (ILPPositionManager.Position memory p) {\n        (bool ok, bytes memory data) =\n            address(positionManager).staticcall(abi.encodeCall(ILPPositionManager.positions, (id)));\n        if (!ok || data.length != 384) revert LP__InvalidPosition();\n        p = abi.decode(data, (ILPPositionManager.Position));\n    }\n\n    function _validate(ILPPositionManager.Position memory p) private view {\n        if (\n            ILPFactory(positionManager.factory()).getPool(token0, token1, fee).code.length == 0\n                || p.token0 != token0 || p.token1 != token1 || p.fee != fee || p.tickLower != tickLower\n                || p.tickUpper != tickUpper || p.liquidity == 0\n        ) revert LP__InvalidPosition();\n    }\n}\n",
      "keccak256": "0x9d2a517c89fda850c8c7774bedf6ba4bcb06675d9208cdf96af5d0873388d1a0"
    },
    "src/talon/rewards/BuybackEngine.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {UniswapV3Adapter} from \"../UniswapV3Adapter.sol\";\nimport {CouponDistributor} from \"./CouponDistributor.sol\";\nimport {FeeRouter} from \"./FeeRouter.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/// @notice Permissionless, time-spaced purchases of the configured protocol token from funded fees.\n/// @dev No caller-provided route, recipient or output floor. Bought tokens fund next-hour Coupons.\ncontract BuybackEngine is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n    error Buyback__InvalidConfiguration();\n    error Buyback__Unavailable();\n    error Buyback__BalanceMismatch();\n    FeeRouter public immutable fees;\n    CouponDistributor public immutable coupons;\n    UniswapV3Adapter public immutable adapter;\n    IERC20 public immutable settlement;\n    IERC20 public immutable protocolToken;\n    uint256 public immutable maxClip;\n    uint256 public lastExecution;\n    uint256 public totalSpent;\n    uint256 public totalBought;\n    uint256 public constant INTERVAL = 5 minutes;\n    event BoughtBack(uint256 spent, uint256 bought, uint256 keeperReward);\n\n    constructor(FeeRouter fees_, UniswapV3Adapter adapter_, uint256 maxClip_) {\n        if (address(fees_).code.length == 0 || address(adapter_).code.length == 0 || maxClip_ < 100) {\n            revert Buyback__InvalidConfiguration();\n        }\n        fees = fees_;\n        coupons = fees_.coupons();\n        settlement = fees_.settlement();\n        protocolToken = IERC20(coupons.rewardTokens(1));\n        if (adapter_.settlement() != address(settlement)) revert Buyback__InvalidConfiguration();\n        adapter = adapter_;\n        maxClip = maxClip_;\n    }\n\n    function execute() external nonReentrant returns (uint256 bought) {\n        if (lastExecution != 0 && block.timestamp < lastExecution + INTERVAL) revert Buyback__Unavailable();\n        uint256 amount = Math.min(fees.buybackBudget(), maxClip);\n        if (amount < 100) revert Buyback__Unavailable();\n        // At most 0.1% of this clip, paid in USDG from the buyback budget itself.\n        uint256 bounty = amount / 1000;\n        uint256 trade = amount - bounty;\n        uint256 minimum = adapter.minimumOutput(address(settlement), address(protocolToken), trade);\n        if (minimum == 0) revert Buyback__Unavailable();\n        lastExecution = block.timestamp;\n        uint256 beforeCash = settlement.balanceOf(address(this));\n        uint256 beforeTokens = protocolToken.balanceOf(address(this));\n        fees.takeBuyback(amount);\n        if (settlement.balanceOf(address(this)) != beforeCash + amount) revert Buyback__BalanceMismatch();\n        settlement.forceApprove(address(adapter), trade);\n        adapter.swap(address(settlement), address(protocolToken), trade, minimum, address(this));\n        settlement.forceApprove(address(adapter), 0);\n        bought = protocolToken.balanceOf(address(this)) - beforeTokens;\n        if (bought < minimum) revert Buyback__BalanceMismatch();\n        uint256 holders = Math.mulDiv(bought, 50, 100);\n        uint256 stakers = Math.mulDiv(bought, 30, 100);\n        uint256 lp = bought - holders - stakers;\n        protocolToken.forceApprove(address(coupons), bought);\n        if (holders != 0) coupons.fund(0, 1, holders);\n        if (stakers != 0) coupons.fund(1, 1, stakers);\n        if (lp != 0) coupons.fund(2, 1, lp);\n        protocolToken.forceApprove(address(coupons), 0);\n        if (bounty != 0) settlement.safeTransfer(msg.sender, bounty);\n        if (\n            settlement.balanceOf(address(this)) != beforeCash\n                || protocolToken.balanceOf(address(this)) != beforeTokens\n        ) revert Buyback__BalanceMismatch();\n        totalSpent += amount;\n        totalBought += bought;\n        emit BoughtBack(amount, bought, bounty);\n    }\n}\n",
      "keccak256": "0x714c20a66bf56a43ecc572b1576fb544fafc71832772120b98c7839a955bb951"
    },
    "src/talon/rewards/LiquidityEngine.sol": {
      "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {TickMath} from \"../../vendor/uniswap-v4/TickMath.sol\";\nimport {UniswapV3Adapter} from \"../UniswapV3Adapter.sol\";\nimport {FeeRouter} from \"./FeeRouter.sol\";\nimport {ILPFactory, ILPPositionManager} from \"./LiquidityLocker.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface ILPMintManager is ILPPositionManager {\n    struct MintParams {\n        address token0;\n        address token1;\n        uint24 fee;\n        int24 tickLower;\n        int24 tickUpper;\n        uint256 amount0Desired;\n        uint256 amount1Desired;\n        uint256 amount0Min;\n        uint256 amount1Min;\n        address recipient;\n        uint256 deadline;\n    }\n\n    struct IncreaseParams {\n        uint256 tokenId;\n        uint256 amount0Desired;\n        uint256 amount1Desired;\n        uint256 amount0Min;\n        uint256 amount1Min;\n        uint256 deadline;\n    }\n    function mint(MintParams calldata params) external payable returns (uint256, uint128, uint256, uint256);\n    function increaseLiquidity(IncreaseParams calldata params)\n        external\n        payable\n        returns (uint128, uint256, uint256);\n}\n\n/// @notice Turns the funded 15% fee budget into full-range protocol-owned liquidity.\n/// @dev Acquisitions use fixed TWAP-guarded routes. Unused mint amounts go to the configured treasury.\ncontract LiquidityEngine is ReentrancyGuard {\n    using SafeERC20 for IERC20;\n    error Liquidity__InvalidConfiguration();\n    error Liquidity__Unavailable();\n    error Liquidity__Unauthorized();\n    error Liquidity__BalanceMismatch();\n    FeeRouter public immutable fees;\n    UniswapV3Adapter public immutable adapter;\n    ILPMintManager public immutable positionManager;\n    address public immutable settlement;\n    address public immutable protocolToken;\n    address public immutable pairedAsset;\n    address public immutable treasury;\n    address public immutable token0;\n    address public immutable token1;\n    uint24 public immutable poolFee;\n    int24 public immutable tickLower;\n    int24 public immutable tickUpper;\n    uint256 public immutable maxClip;\n    uint256 public lastExecution;\n    uint256 public positionId;\n    uint256 public totalSpent;\n    event LiquidityAdded(\n        uint256 indexed position, uint256 spent, uint128 liquidity, uint256 amount0, uint256 amount1\n    );\n    event RemainderSent(address indexed token, uint256 amount);\n    event PositionReleased(uint256 indexed position);\n\n    constructor(\n        FeeRouter fees_,\n        UniswapV3Adapter adapter_,\n        ILPMintManager manager_,\n        address pairedAsset_,\n        uint24 fee_,\n        uint256 maxClip_\n    ) {\n        if (\n            address(fees_).code.length == 0 || address(adapter_).code.length == 0\n                || address(manager_).code.length == 0 || pairedAsset_.code.length == 0 || maxClip_ < 100\n        ) revert Liquidity__InvalidConfiguration();\n        fees = fees_;\n        adapter = adapter_;\n        positionManager = manager_;\n        settlement = address(fees_.settlement());\n        protocolToken = fees_.coupons().rewardTokens(1);\n        pairedAsset = pairedAsset_;\n        treasury = fees_.treasury();\n        poolFee = fee_;\n        maxClip = maxClip_;\n        if (\n            pairedAsset_ == protocolToken || adapter_.settlement() != settlement\n                || manager_.factory() != address(adapter_.factory())\n        ) revert Liquidity__InvalidConfiguration();\n        (token0, token1) =\n            protocolToken < pairedAsset_ ? (protocolToken, pairedAsset_) : (pairedAsset_, protocolToken);\n        ILPFactory factory = ILPFactory(manager_.factory());\n        int24 spacing = factory.feeAmountTickSpacing(fee_);\n        if (spacing <= 0) {\n            revert Liquidity__InvalidConfiguration();\n        }\n        tickLower = TickMath.minUsableTick(spacing);\n        tickUpper = TickMath.maxUsableTick(spacing);\n    }\n\n    function execute() external nonReentrant returns (uint128 liquidity) {\n        // Missing launch-day liquidity must not prevent portfolio deployment, but cannot receive a budget.\n        if (ILPFactory(positionManager.factory()).getPool(token0, token1, poolFee).code.length == 0) {\n            revert Liquidity__Unavailable();\n        }\n        if (lastExecution != 0 && block.timestamp < lastExecution + 5 minutes) {\n            revert Liquidity__Unavailable();\n        }\n        uint256 amount = Math.min(fees.liquidityBudget(), maxClip);\n        if (amount < 100) revert Liquidity__Unavailable();\n        lastExecution = block.timestamp;\n        uint256 beforeCash = IERC20(settlement).balanceOf(address(this));\n        uint256 before0 = IERC20(token0).balanceOf(address(this));\n        uint256 before1 = IERC20(token1).balanceOf(address(this));\n        fees.takeLiquidity(amount);\n        if (IERC20(settlement).balanceOf(address(this)) != beforeCash + amount) {\n            revert Liquidity__BalanceMismatch();\n        }\n        uint256 bought = _acquire(protocolToken, amount / 2);\n        uint256 paired =\n            pairedAsset == settlement ? amount - amount / 2 : _acquire(pairedAsset, amount - amount / 2);\n        (uint256 desired0, uint256 desired1) = token0 == protocolToken ? (bought, paired) : (paired, bought);\n        liquidity = _add(amount, desired0, desired1);\n        if (\n            IERC20(settlement).balanceOf(address(this)) != beforeCash\n                || IERC20(token0).balanceOf(address(this)) != before0\n                || IERC20(token1).balanceOf(address(this)) != before1\n        ) {\n            revert Liquidity__BalanceMismatch();\n        }\n        totalSpent += amount;\n    }\n\n    function _add(uint256 amount, uint256 desired0, uint256 desired1) private returns (uint128 liquidity) {\n        IERC20(token0).forceApprove(address(positionManager), desired0);\n        IERC20(token1).forceApprove(address(positionManager), desired1);\n        uint256 used0;\n        uint256 used1;\n        if (positionId == 0) {\n            (positionId, liquidity, used0, used1) = positionManager.mint(\n                ILPMintManager.MintParams(\n                    token0,\n                    token1,\n                    poolFee,\n                    tickLower,\n                    tickUpper,\n                    desired0,\n                    desired1,\n                    Math.mulDiv(desired0, 9800, 10_000),\n                    Math.mulDiv(desired1, 9800, 10_000),\n                    address(this),\n                    block.timestamp\n                )\n            );\n        } else {\n            (liquidity, used0, used1) = positionManager.increaseLiquidity(\n                ILPMintManager.IncreaseParams(\n                    positionId,\n                    desired0,\n                    desired1,\n                    Math.mulDiv(desired0, 9800, 10_000),\n                    Math.mulDiv(desired1, 9800, 10_000),\n                    block.timestamp\n                )\n            );\n        }\n        IERC20(token0).forceApprove(address(positionManager), 0);\n        IERC20(token1).forceApprove(address(positionManager), 0);\n        if (\n            liquidity == 0 || positionId == 0 || used0 > desired0 || used1 > desired1\n                || used0 < Math.mulDiv(desired0, 9800, 10_000) || used1 < Math.mulDiv(desired1, 9800, 10_000)\n                || positionManager.ownerOf(positionId) != address(this)\n        ) revert Liquidity__BalanceMismatch();\n        _remainder(token0, desired0 - used0);\n        _remainder(token1, desired1 - used1);\n        emit LiquidityAdded(positionId, amount, liquidity, used0, used1);\n    }\n\n    /// @notice Pool trading fees accrue to the protocol treasury, not to the caller.\n    function collectTradingFees() external nonReentrant returns (uint256, uint256) {\n        if (positionId == 0) revert Liquidity__Unavailable();\n        return positionManager.collect(\n            ILPPositionManager.CollectParams(positionId, treasury, type(uint128).max, type(uint128).max)\n        );\n    }\n\n    /// @notice Only the configured treasury may move protocol-owned liquidity. User LP stakes use a separate locker.\n    function releasePosition() external nonReentrant {\n        if (msg.sender != treasury) revert Liquidity__Unauthorized();\n        uint256 id = positionId;\n        if (id == 0) revert Liquidity__Unavailable();\n        positionId = 0;\n        positionManager.safeTransferFrom(address(this), treasury, id);\n        emit PositionReleased(id);\n    }\n\n    function _acquire(address asset, uint256 amount) private returns (uint256 received) {\n        uint256 floor = adapter.minimumOutput(settlement, asset, amount);\n        if (floor == 0) revert Liquidity__Unavailable();\n        IERC20(settlement).forceApprove(address(adapter), amount);\n        received = adapter.swap(settlement, asset, amount, floor, address(this));\n        IERC20(settlement).forceApprove(address(adapter), 0);\n    }\n\n    function _remainder(address asset, uint256 amount) private {\n        if (amount != 0) {\n            IERC20(asset).safeTransfer(treasury, amount);\n            emit RemainderSent(asset, amount);\n        }\n    }\n}\n",
      "keccak256": "0x77d24fa9e8f7cdc323d731fbc732d0bfd460a5d8d59f1873f842372f7c62a593"
    }
  },
  "contracts": [
    {
      "name": "TimelockController",
      "address": "0xDFe434bcfe379321888600BAFe23d3B28A28F7da",
      "contractIdentifier": "lib/openzeppelin-contracts/contracts/governance/TimelockController.sol:TimelockController",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/AccessControl.sol",
        "lib/openzeppelin-contracts/contracts/access/IAccessControl.sol",
        "lib/openzeppelin-contracts/contracts/governance/TimelockController.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol",
        "lib/openzeppelin-contracts/contracts/utils/Address.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Errors.sol",
        "lib/openzeppelin-contracts/contracts/utils/LowLevelCall.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol"
      ],
      "constructorArgs": "0x000000000000000000000000000000000000000000000000000000000002a300000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a27de5300aacc228daf4beb771a0d40ecbeeeb2100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "minDelay",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "proposers",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "executors",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "admin",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "receive",
          "stateMutability": "payable"
        },
        {
          "type": "function",
          "name": "CANCELLER_ROLE",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "DEFAULT_ADMIN_ROLE",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "EXECUTOR_ROLE",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "PROPOSER_ROLE",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "cancel",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "execute",
          "inputs": [
            {
              "name": "target",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "value",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "payload",
              "type": "bytes",
              "internalType": "bytes"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [],
          "stateMutability": "payable"
        },
        {
          "type": "function",
          "name": "executeBatch",
          "inputs": [
            {
              "name": "targets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "values",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "payloads",
              "type": "bytes[]",
              "internalType": "bytes[]"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [],
          "stateMutability": "payable"
        },
        {
          "type": "function",
          "name": "getMinDelay",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "getOperationState",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint8",
              "internalType": "enum TimelockController.OperationState"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "getRoleAdmin",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "getTimestamp",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "grantRole",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "hasRole",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "hashOperation",
          "inputs": [
            {
              "name": "target",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "value",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "data",
              "type": "bytes",
              "internalType": "bytes"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "pure"
        },
        {
          "type": "function",
          "name": "hashOperationBatch",
          "inputs": [
            {
              "name": "targets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "values",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "payloads",
              "type": "bytes[]",
              "internalType": "bytes[]"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "pure"
        },
        {
          "type": "function",
          "name": "isOperation",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isOperationDone",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isOperationPending",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isOperationReady",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "onERC1155BatchReceived",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "onERC1155Received",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "onERC721Received",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "renounceRole",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "callerConfirmation",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "revokeRole",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "schedule",
          "inputs": [
            {
              "name": "target",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "value",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "data",
              "type": "bytes",
              "internalType": "bytes"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "delay",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "scheduleBatch",
          "inputs": [
            {
              "name": "targets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "values",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "payloads",
              "type": "bytes[]",
              "internalType": "bytes[]"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "delay",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "supportsInterface",
          "inputs": [
            {
              "name": "interfaceId",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "updateDelay",
          "inputs": [
            {
              "name": "newDelay",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "CallExecuted",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "index",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "target",
              "type": "address",
              "indexed": false,
              "internalType": "address"
            },
            {
              "name": "value",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "data",
              "type": "bytes",
              "indexed": false,
              "internalType": "bytes"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "CallSalt",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "salt",
              "type": "bytes32",
              "indexed": false,
              "internalType": "bytes32"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "CallScheduled",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "index",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "target",
              "type": "address",
              "indexed": false,
              "internalType": "address"
            },
            {
              "name": "value",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "data",
              "type": "bytes",
              "indexed": false,
              "internalType": "bytes"
            },
            {
              "name": "predecessor",
              "type": "bytes32",
              "indexed": false,
              "internalType": "bytes32"
            },
            {
              "name": "delay",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "Cancelled",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "MinDelayChange",
          "inputs": [
            {
              "name": "oldDuration",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "newDuration",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "RoleAdminChanged",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "previousAdminRole",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "newAdminRole",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "RoleGranted",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "account",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "sender",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "RoleRevoked",
          "inputs": [
            {
              "name": "role",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "account",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "sender",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "AccessControlBadConfirmation",
          "inputs": []
        },
        {
          "type": "error",
          "name": "AccessControlUnauthorizedAccount",
          "inputs": [
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "neededRole",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ]
        },
        {
          "type": "error",
          "name": "FailedCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TimelockInsufficientDelay",
          "inputs": [
            {
              "name": "delay",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minDelay",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "type": "error",
          "name": "TimelockInvalidOperationLength",
          "inputs": [
            {
              "name": "targets",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "payloads",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "values",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "type": "error",
          "name": "TimelockUnauthorizedCaller",
          "inputs": [
            {
              "name": "caller",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "TimelockUnexecutedPredecessor",
          "inputs": [
            {
              "name": "predecessorId",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ]
        },
        {
          "type": "error",
          "name": "TimelockUnexpectedOperationState",
          "inputs": [
            {
              "name": "operationId",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "expectedStates",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0x99a9645d76d66d383001fe68c10b7c46e173250a295a65ea73e70a8d80133050"
    },
    {
      "name": "CouponDistributor",
      "address": "0x5258611F497eb45F5cFAC7aDf8C0130Dce8BCaEB",
      "contractIdentifier": "src/talon/rewards/CouponDistributor.sol:CouponDistributor",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/rewards/CouponDistributor.sol"
      ],
      "constructorArgs": "0x0000000000000000000000005fc5360d0400a0fd4f2af552add042d716f1d168000000000000000000000000a4f289ebd33465b0657a45ce1693a49f46707a2c",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "settlement",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "protocolToken",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "EPOCH",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "MAX_WEIGHT",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "checkpoint",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claim",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "key",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "amounts",
              "type": "uint256[2]",
              "internalType": "uint256[2]"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claimToken",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "key",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "token",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "controllers",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "earned",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "key",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "amounts",
              "type": "uint256[2]",
              "internalType": "uint256[2]"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "fund",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "token",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "initialize",
          "inputs": [
            {
              "name": "poolControllers",
              "type": "address[3]",
              "internalType": "address[3]"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "initialized",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "initializer",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "participant",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "key",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "tuple",
              "internalType": "struct CouponDistributor.Participant",
              "components": [
                {
                  "name": "weight",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "paidIndex",
                  "type": "uint256[2]",
                  "internalType": "uint256[2]"
                },
                {
                  "name": "accrued",
                  "type": "uint256[2]",
                  "internalType": "uint256[2]"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "rewardTokens",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "setWeight",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "key",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "weight",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "stream",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "token",
              "type": "uint8",
              "internalType": "uint8"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "tuple",
              "internalType": "struct CouponDistributor.Stream",
              "components": [
                {
                  "name": "index",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "pending",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "active",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "released",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "epochStart",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "funded",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "claimed",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "totalWeight",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "Claimed",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "indexed": true,
              "internalType": "uint8"
            },
            {
              "name": "participant",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "recipient",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "cash",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "token",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "Funded",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "indexed": true,
              "internalType": "uint8"
            },
            {
              "name": "token",
              "type": "uint8",
              "indexed": true,
              "internalType": "uint8"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "firstEpoch",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "WeightChanged",
          "inputs": [
            {
              "name": "pool",
              "type": "uint8",
              "indexed": true,
              "internalType": "uint8"
            },
            {
              "name": "participant",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "weight",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Coupons__BalanceMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Coupons__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Coupons__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0x1935cf78778cf262cf3a5803ec521e581e8016e3aafe56a18ceca6efa9503ed7"
    },
    {
      "name": "FeeRouter",
      "address": "0xd7c5bc78CCc18Ac10B15A6807D98BC4e3Bbe2b82",
      "contractIdentifier": "src/talon/rewards/FeeRouter.sol:FeeRouter",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/Executor.sol",
        "src/talon/NavOracle.sol",
        "src/talon/UniswapV3Adapter.sol",
        "src/talon/rewards/CouponDistributor.sol",
        "src/talon/rewards/FeeRouter.sol",
        "src/vendor/uniswap-v4/BitMath.sol",
        "src/vendor/uniswap-v4/CustomRevert.sol",
        "src/vendor/uniswap-v4/TickMath.sol"
      ],
      "constructorArgs": "0x0000000000000000000000005258611f497eb45f5cfac7adf8c0130dce8bcaeb000000000000000000000000a27de5300aacc228daf4beb771a0d40ecbeeeb21",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "coupons_",
              "type": "address",
              "internalType": "contract CouponDistributor"
            },
            {
              "name": "treasury_",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "buybackBudget",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "buybackEngine",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "conversionCap",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "convertAssetFees",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "received",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "coupons",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract CouponDistributor"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "distribute",
          "inputs": [],
          "outputs": [
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "feeAdapter",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract UniswapV3Adapter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "feeOracle",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract NavOracle"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "initialize",
          "inputs": [
            {
              "name": "buyback",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "liquidity",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "initializeConverter",
          "inputs": [
            {
              "name": "oracle_",
              "type": "address",
              "internalType": "contract NavOracle"
            },
            {
              "name": "adapter_",
              "type": "address",
              "internalType": "contract UniswapV3Adapter"
            },
            {
              "name": "cap",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "initializer",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "liquidityBudget",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "liquidityEngine",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "reserveBudget",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IERC20"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "takeBuyback",
          "inputs": [
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "takeLiquidity",
          "inputs": [
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "totalRouted",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "treasury",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "undistributed",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "withdrawReserve",
          "inputs": [
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "AssetFeesConverted",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "sold",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "received",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "BudgetSpent",
          "inputs": [
            {
              "name": "destination",
              "type": "uint8",
              "indexed": true,
              "internalType": "uint8"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "FeesRouted",
          "inputs": [
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "buyback",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "directCoupons",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "liquidity",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "reserve",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Fees__InvalidAmount",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Fees__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Fees__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0x7e8c56cec9b74ce48e4c08116a0f3329450930a3f1dc4dcb39c08f5829a6d015"
    },
    {
      "name": "UniswapV3Adapter",
      "address": "0xE86A5918289eC08dB709E388ff9eA573F0A88fE8",
      "contractIdentifier": "src/talon/UniswapV3Adapter.sol:UniswapV3Adapter",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/Executor.sol",
        "src/talon/UniswapV3Adapter.sol",
        "src/vendor/uniswap-v4/BitMath.sol",
        "src/vendor/uniswap-v4/CustomRevert.sol",
        "src/vendor/uniswap-v4/TickMath.sol"
      ],
      "constructorArgs": "0x0000000000000000000000005fc5360d0400a0fd4f2af552add042d716f1d168000000000000000000000000caf681a66d020601342297493863e78c959e5cb20000000000000000000000001f7d7550b1b028f7571e69a784071f0205fd2efa00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000009000000000000000000000000d0601ce157db5bdc3162bbac2a2c8af5320d9eec000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af3d76f1834a1d425780943c99ea8a608f8a93f9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e93237c50d904957cf27e7b1133b510c669c2e7400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012f190a9f9d7d37a250758b26824b97ce941bf5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0847e8910a9732eb3fb1bb4b70a580adad4fe3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0d6457c16cc70d6790dd43521c899c87ce02f3500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000322f0929c4625ed5bad873c95208d54e1c003b2d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086923f96303d656e4aa86d9d42d1e57ad2023fdc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd7d308f8e1639fab988df18a8011f41eacad73000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "settlement_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "router_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "expectedFactory",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "inputs",
              "type": "tuple[]",
              "internalType": "struct UniswapV3Adapter.RouteInput[]",
              "components": [
                {
                  "name": "asset",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "bridge",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "firstFee",
                  "type": "uint24",
                  "internalType": "uint24"
                },
                {
                  "name": "secondFee",
                  "type": "uint24",
                  "internalType": "uint24"
                }
              ]
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "MAX_TICK_DEVIATION",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "int24",
              "internalType": "int24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "TWAP_WINDOW",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint32",
              "internalType": "uint32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "checkPaymentQuote",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "pricesAfter",
              "type": "uint160[]",
              "internalType": "uint160[]"
            }
          ],
          "outputs": [],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "checkRoute",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "checkSpotPaymentQuote",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "pricesAfter",
              "type": "uint160[]",
              "internalType": "uint160[]"
            }
          ],
          "outputs": [],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "factory",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ITalonV3Factory"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "minimumOutput",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "payNative",
          "inputs": [
            {
              "name": "minUSDG",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "payable"
        },
        {
          "type": "function",
          "name": "payQuotedNative",
          "inputs": [
            {
              "name": "minUSDG",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "payable"
        },
        {
          "type": "function",
          "name": "payQuotedToken",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minUSDG",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "payToken",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minUSDG",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "paymentVersion",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "quoteTwap",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "route",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "tuple",
              "internalType": "struct UniswapV3Adapter.Route",
              "components": [
                {
                  "name": "path",
                  "type": "bytes",
                  "internalType": "bytes"
                },
                {
                  "name": "firstPool",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "secondPool",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "reversePath",
                  "type": "bytes",
                  "internalType": "bytes"
                },
                {
                  "name": "bridge",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "firstFee",
                  "type": "uint24",
                  "internalType": "uint24"
                },
                {
                  "name": "secondFee",
                  "type": "uint24",
                  "internalType": "uint24"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "router",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ITalonV3Router"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "swap",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minOut",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "received",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "V3Adapter__BalanceMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "V3Adapter__ExpiredPayment",
          "inputs": []
        },
        {
          "type": "error",
          "name": "V3Adapter__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "V3Adapter__InvalidSwap",
          "inputs": []
        },
        {
          "type": "error",
          "name": "V3Adapter__OracleUnavailable",
          "inputs": []
        },
        {
          "type": "error",
          "name": "V3Adapter__PriceDeviation",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xe8f10390c6c02735c873c7fd048e6e796f12f8422ca29a280beea8244c96cb3e"
    },
    {
      "name": "Executor",
      "address": "0x7610d33F521e1B2Be3536265a09E8FA332305d25",
      "contractIdentifier": "src/talon/Executor.sol:Executor",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "src/talon/Executor.sol"
      ],
      "constructorArgs": "0x000000000000000000000000e86a5918289ec08db709e388ff9ea573f0a88fe8",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "adapter_",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "adapter",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ITalonSwapAdapter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "execute",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minOut",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "received",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "Executed",
          "inputs": [
            {
              "name": "account",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "amountOut",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Executor__BalanceMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Executor__InvalidAdapter",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Executor__InvalidSwap",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0x5c8b22c7a8c97a7075869c2be15914227861e53afbe8c59853f796da81a3ad53"
    },
    {
      "name": "BasketRegistry",
      "address": "0x56ffE0B30e3630d28AAb1856ed44Af1AD929734c",
      "contractIdentifier": "src/talon/BasketRegistry.sol:BasketRegistry",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "src/talon/BasketRegistry.sol"
      ],
      "constructorArgs": "0x0000000000000000000000008d6da155ee299f40b59fea02b26d52fda5e8b654000000000000000000000000a27de5300aacc228daf4beb771a0d40ecbeeeb210000000000000000000000005fc5360d0400a0fd4f2af552add042d716f1d168000000000000000000000000d7c5bc78ccc18ac10b15a6807d98bc4e3bbe2b82000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000005f5e100",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "timelock",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "guardian_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "settlement_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "feeRecipient_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "cap",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "perPosition",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "MINT_FEE_BPS",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint16",
              "internalType": "uint16"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "allowedAsset",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "allowedDepositor",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "basket",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [
            {
              "name": "b",
              "type": "tuple",
              "internalType": "struct BasketRegistry.Basket",
              "components": [
                {
                  "name": "name",
                  "type": "string",
                  "internalType": "string"
                },
                {
                  "name": "assets",
                  "type": "address[]",
                  "internalType": "address[]"
                },
                {
                  "name": "weights",
                  "type": "uint16[]",
                  "internalType": "uint16[]"
                },
                {
                  "name": "enabled",
                  "type": "bool",
                  "internalType": "bool"
                },
                {
                  "name": "version",
                  "type": "uint32",
                  "internalType": "uint32"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "canDeposit",
          "inputs": [
            {
              "name": "depositor",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "depositCap",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "disableBasket",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "feeRecipient",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "guardian",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "owner",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "paused",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "positionCap",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "renounceOwnership",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "restrictedDeposits",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "salesOpen",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "setAsset",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "allowed",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "setBasket",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "name",
              "type": "string",
              "internalType": "string"
            },
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "internalType": "uint16[]"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "setDepositor",
          "inputs": [
            {
              "name": "depositor",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "allowed",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "setPaused",
          "inputs": [
            {
              "name": "value",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "setRestrictedDeposits",
          "inputs": [
            {
              "name": "restricted",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "setSalesOpen",
          "inputs": [
            {
              "name": "open",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "transferOwnership",
          "inputs": [
            {
              "name": "newOwner",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "validate",
          "inputs": [
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "internalType": "uint16[]"
            }
          ],
          "outputs": [],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "AssetPermissionChanged",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "allowed",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "BasketConfigured",
          "inputs": [
            {
              "name": "id",
              "type": "bytes32",
              "indexed": true,
              "internalType": "bytes32"
            },
            {
              "name": "version",
              "type": "uint32",
              "indexed": false,
              "internalType": "uint32"
            },
            {
              "name": "name",
              "type": "string",
              "indexed": false,
              "internalType": "string"
            },
            {
              "name": "assets",
              "type": "address[]",
              "indexed": false,
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "indexed": false,
              "internalType": "uint16[]"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "DepositRestrictionChanged",
          "inputs": [
            {
              "name": "restricted",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "DepositorPermissionChanged",
          "inputs": [
            {
              "name": "depositor",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "allowed",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "OwnershipTransferred",
          "inputs": [
            {
              "name": "previousOwner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "newOwner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "PauseChanged",
          "inputs": [
            {
              "name": "paused",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "SalesOpenChanged",
          "inputs": [
            {
              "name": "open",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "BasketRegistry__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "BasketRegistry__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "BasketRegistry__UnknownBasket",
          "inputs": []
        },
        {
          "type": "error",
          "name": "OwnableInvalidOwner",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "OwnableUnauthorizedAccount",
          "inputs": [
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0xf580978b358dfdbfcf511ef8548d4e90a4c00071fb47f1c4cc8e8c76d2411490"
    },
    {
      "name": "TalonNFT",
      "address": "0x43Fda6A15Fe33539b640116Fdbd1C96534DAA406",
      "contractIdentifier": "src/talon/TalonNFT.sol:TalonNFT",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Utils.sol",
        "lib/openzeppelin-contracts/contracts/utils/Base64.sol",
        "lib/openzeppelin-contracts/contracts/utils/Bytes.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/Strings.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol",
        "src/talon/AccountRegistry.sol",
        "src/talon/BasketRegistry.sol",
        "src/talon/Executor.sol",
        "src/talon/ITalonExtensions.sol",
        "src/talon/MintRouter.sol",
        "src/talon/StreamingFees.sol",
        "src/talon/TalonAccount.sol",
        "src/talon/TalonNFT.sol"
      ],
      "constructorArgs": "0x000000000000000000000000000000006551c19487814612e58fe0681377575800000000000000000000000056ffe0b30e3630d28aab1856ed44af1ad929734c0000000000000000000000007610d33f521e1b2be3536265a09e8fa332305d25",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "registry",
              "type": "address",
              "internalType": "contract AccountRegistry"
            },
            {
              "name": "config",
              "type": "address",
              "internalType": "contract BasketRegistry"
            },
            {
              "name": "executor",
              "type": "address",
              "internalType": "contract Executor"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "accountImplementation",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "accountOf",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "accountRegistry",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract AccountRegistry"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "activeSupply",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "approve",
          "inputs": [
            {
              "name": "to",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "balanceOf",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "basketOf",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "basketVersion",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint32",
              "internalType": "uint32"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "burnFromAccount",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "completeMint",
          "inputs": [
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "configureExtensions",
          "inputs": [
            {
              "name": "manager",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "rewards",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "createPosition",
          "inputs": [
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "basketId",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "version",
              "type": "uint32",
              "internalType": "uint32"
            },
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "budgets",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "extensionInitializer",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "extensionsConfigured",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "getApproved",
          "inputs": [
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "holderRewards",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isApprovedForAll",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "operator",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isTalonAccount",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "mintRouter",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract MintRouter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "name",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "string",
              "internalType": "string"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "nextTokenId",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "ownerOf",
          "inputs": [
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "portfolioManager",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "safeTransferFrom",
          "inputs": [
            {
              "name": "from",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "to",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "safeTransferFrom",
          "inputs": [
            {
              "name": "from",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "to",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "data",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "setApprovalForAll",
          "inputs": [
            {
              "name": "operator",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "approved",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "supportsInterface",
          "inputs": [
            {
              "name": "interfaceId",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "symbol",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "string",
              "internalType": "string"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tokenByIndex",
          "inputs": [
            {
              "name": "index",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tokenOfOwnerByIndex",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "index",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tokenURI",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "string",
              "internalType": "string"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "totalSupply",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "transferFrom",
          "inputs": [
            {
              "name": "from",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "to",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "Approval",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "approved",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "ApprovalForAll",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "operator",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "approved",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "PositionClosed",
          "inputs": [
            {
              "name": "tokenId",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "beneficiary",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "PositionCreated",
          "inputs": [
            {
              "name": "tokenId",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "account",
              "type": "address",
              "indexed": false,
              "internalType": "address"
            },
            {
              "name": "basket",
              "type": "bytes32",
              "indexed": false,
              "internalType": "bytes32"
            },
            {
              "name": "version",
              "type": "uint32",
              "indexed": false,
              "internalType": "uint32"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "Transfer",
          "inputs": [
            {
              "name": "from",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "to",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "ERC721EnumerableForbiddenBatchMint",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ERC721IncorrectOwner",
          "inputs": [
            {
              "name": "sender",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721InsufficientApproval",
          "inputs": [
            {
              "name": "operator",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721InvalidApprover",
          "inputs": [
            {
              "name": "approver",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721InvalidOperator",
          "inputs": [
            {
              "name": "operator",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721InvalidOwner",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721InvalidReceiver",
          "inputs": [
            {
              "name": "receiver",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721InvalidSender",
          "inputs": [
            {
              "name": "sender",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721NonexistentToken",
          "inputs": [
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "type": "error",
          "name": "ERC721OutOfBoundsIndex",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "index",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "type": "error",
          "name": "StringsInsufficientHexLength",
          "inputs": [
            {
              "name": "value",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "length",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "type": "error",
          "name": "TalonNFT__AccountBusy",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonNFT__OwnershipCycle",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonNFT__Unauthorized",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0x7afc8802b510f603ccf9be0dcc7d450dfb4120e4de8f3766e52b4c45c9f89aad"
    },
    {
      "name": "MintRouter",
      "address": "0xc150fAc8284fAD17b0817e0Ac669F26FA104FD67",
      "contractIdentifier": "src/talon/MintRouter.sol:MintRouter",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Utils.sol",
        "lib/openzeppelin-contracts/contracts/utils/Base64.sol",
        "lib/openzeppelin-contracts/contracts/utils/Bytes.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/Strings.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol",
        "src/talon/AccountRegistry.sol",
        "src/talon/BasketRegistry.sol",
        "src/talon/Executor.sol",
        "src/talon/ITalonExtensions.sol",
        "src/talon/MintRouter.sol",
        "src/talon/StreamingFees.sol",
        "src/talon/TalonAccount.sol",
        "src/talon/TalonNFT.sol"
      ],
      "constructorArgs": "0x00000000000000000000000043fda6a15fe33539b640116fdbd1c96534daa40600000000000000000000000056ffe0b30e3630d28aab1856ed44af1ad929734c",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "collection_",
              "type": "address",
              "internalType": "contract TalonNFT"
            },
            {
              "name": "config_",
              "type": "address",
              "internalType": "contract BasketRegistry"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "collection",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract TalonNFT"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "config",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract BasketRegistry"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "configureExecutionReserve",
          "inputs": [
            {
              "name": "reserve",
              "type": "address",
              "internalType": "contract ITalonExecutionReserve"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "cumulativeDeposits",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "directExecutionVersion",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "executionReserve",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ITalonExecutionReserve"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "mint",
          "inputs": [
            {
              "name": "basketId",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "expectedVersion",
              "type": "uint32",
              "internalType": "uint32"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "mintCustom",
          "inputs": [
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "internalType": "uint16[]"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "mintCustomDirect",
          "inputs": [
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "internalType": "uint16[]"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "mintCustomFunded",
          "inputs": [
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "internalType": "uint16[]"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "funding",
              "type": "tuple",
              "internalType": "struct MintRouter.ExecutionFunding",
              "components": [
                {
                  "name": "amount",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minimumETH",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "actionFee",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "deadline",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "mintDirect",
          "inputs": [
            {
              "name": "basketId",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "expectedVersion",
              "type": "uint32",
              "internalType": "uint32"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "mintFunded",
          "inputs": [
            {
              "name": "basketId",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "expectedVersion",
              "type": "uint32",
              "internalType": "uint32"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "funding",
              "type": "tuple",
              "internalType": "struct MintRouter.ExecutionFunding",
              "components": [
                {
                  "name": "amount",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minimumETH",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "actionFee",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "deadline",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "account",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "Deposited",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "fee",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "MintRouter__CapExceeded",
          "inputs": []
        },
        {
          "type": "error",
          "name": "MintRouter__DepositorNotAllowed",
          "inputs": []
        },
        {
          "type": "error",
          "name": "MintRouter__InvalidDeposit",
          "inputs": []
        },
        {
          "type": "error",
          "name": "MintRouter__InvalidExecutionReserve",
          "inputs": []
        },
        {
          "type": "error",
          "name": "MintRouter__Paused",
          "inputs": []
        },
        {
          "type": "error",
          "name": "MintRouter__StaleTemplate",
          "inputs": []
        },
        {
          "type": "error",
          "name": "MintRouter__TransferMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0x3ae0799d7b61587ea2c406e40b3747a0146761ca7349a7d233dd50660c07481e"
    },
    {
      "name": "TalonAccount",
      "address": "0x81Cf97388C879FfF646b22e435aF4828bEeDff87",
      "contractIdentifier": "src/talon/TalonAccount.sol:TalonAccount",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/utils/Bytes.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/BasketRegistry.sol",
        "src/talon/Executor.sol",
        "src/talon/ITalonExtensions.sol",
        "src/talon/StreamingFees.sol",
        "src/talon/TalonAccount.sol"
      ],
      "constructorArgs": "0x00000000000000000000000043fda6a15fe33539b640116fdbd1c96534daa40600000000000000000000000056ffe0b30e3630d28aab1856ed44af1ad929734c0000000000000000000000007610d33f521e1b2be3536265a09e8fa332305d25",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "collection_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "config_",
              "type": "address",
              "internalType": "contract BasketRegistry"
            },
            {
              "name": "executor_",
              "type": "address",
              "internalType": "contract Executor"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "receive",
          "stateMutability": "payable"
        },
        {
          "type": "function",
          "name": "CLIP_INTERVAL",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "MAX_CLIP_BPS",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "MIN_CLIP_BPS",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "beginManagedPlan",
          "inputs": [
            {
              "name": "endsAt",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "busy",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "cancelPurchase",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "cancelled",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "collectStreamingFees",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "collection",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "config",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract BasketRegistry"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "deadline",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "endManagedPlan",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "executeClip",
          "inputs": [
            {
              "name": "lotIndex",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "amountIn",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "executeInitialPurchase",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "executeManagedTrade",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimum",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "feeBps",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "received",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "executor",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract Executor"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "exitBeneficiary",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "finalizeManagedExit",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "grossAvailable",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "initialize",
          "inputs": [
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "budgets",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline_",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "initialized",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "inputAfterStreamingFee",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "gross",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isValidSignature",
          "inputs": [
            {
              "name": "hash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "signature",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "isValidSigner",
          "inputs": [
            {
              "name": "signer",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "lots",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "tuple[]",
              "internalType": "struct TalonAccount.Lot[]",
              "components": [
                {
                  "name": "asset",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "budget",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "spent",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minOutput",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "lastClipAt",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "managedDeadline",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "onOwnershipChanged",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "openedAt",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "owner",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "ownershipEpoch",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "previewManagedInput",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "gross",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "feeBps",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "net",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "redeemInKind",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "state",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "streamingFee",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "debt",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "supportsInterface",
          "inputs": [
            {
              "name": "id",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "pure"
        },
        {
          "type": "function",
          "name": "token",
          "inputs": [],
          "outputs": [
            {
              "name": "chainId",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "tokenContract",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "trackedAssets",
          "inputs": [],
          "outputs": [
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "transferAll",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "transferStreamingFee",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "reserved",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "withdraw",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "withdrawable",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "ClipExecuted",
          "inputs": [
            {
              "name": "lot",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "spent",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "received",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "InKindRedeemed",
          "inputs": [
            {
              "name": "beneficiary",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "PurchaseCancelled",
          "inputs": [],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "StreamingFeeDeferred",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "StreamingFeePaid",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "WithdrawalDeferred",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "beneficiary",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "Withdrawn",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "recipient",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "Streaming__InsufficientBalance",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Streaming__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonAccount__ExecutionUnavailable",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonAccount__InvalidClip",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonAccount__InvalidPlan",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonAccount__InvalidReceiver",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonAccount__NativeTransferFailed",
          "inputs": []
        },
        {
          "type": "error",
          "name": "TalonAccount__Unauthorized",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0x606e0ac6b2d6b72a71ed2deef924edb09a64863e7cb82c4fc863b867155e03aa"
    },
    {
      "name": "NavOracle",
      "address": "0xE925835036946EA2eF4D0103B471F151990fd21A",
      "contractIdentifier": "src/talon/NavOracle.sol:NavOracle",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/NavOracle.sol"
      ],
      "constructorArgs": "0x000000000000000000000000e86a5918289ec08db709e388ff9ea573f0a88fe800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000090000000000000000000000005fc5360d0400a0fd4f2af552add042d716f1d16800000000000000000000000061b7e5650328764b076a108eff5fa7282a1b9ad20000000000000000000000000000000000000000000000000000000000016da00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0601ce157db5bdc3162bbac2a2c8af5320d9eec000000000000000000000000379ec4f7c378f34a1b47e4f3cbebcbac3e8e9f150000000000000000000000000000000000000000000000000000000000016da00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000af3d76f1834a1d425780943c99ea8a608f8a93f90000000000000000000000006b22a786baa607d76728168703a39ea9c99f2cd00000000000000000000000000000000000000000000000000000000000016da00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000e93237c50d904957cf27e7b1133b510c669c2e7400000000000000000000000045c3c877c15e6ba2ebb19ea114ea508d14c1af2e0000000000000000000000000000000000000000000000000000000000016da0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000012f190a9f9d7d37a250758b26824b97ce941bf54000000000000000000000000d5a1508ced74c084ebf3cbe853e2c968fb2a651c0000000000000000000000000000000000000000000000000000000000016da000000000000000000000000000000000000000000000000000000000000000010000000000000000000000002e0847e8910a9732eb3fb1bb4b70a580adad4fe3000000000000000000000000f6f373a037c30f0e5010d854385ca89185ae638b0000000000000000000000000000000000000000000000000000000000016da00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c0d6457c16cc70d6790dd43521c899c87ce02f350000000000000000000000007c38c00c30bee9378381e7b6135d7283356d71b10000000000000000000000000000000000000000000000000000000000016da00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000322f0929c4625ed5bad873c95208d54e1c003b2d0000000000000000000000004a1166a659a55625345e9515b32adecea5547c380000000000000000000000000000000000000000000000000000000000016da0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000086923f96303d656e4aa86d9d42d1e57ad2023fdc000000000000000000000000943a29e7ae51a4798823ca9eed2ed533b2a22c720000000000000000000000000000000000000000000000000000000000016da00000000000000000000000000000000000000000000000000000000000000001",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "dex_",
              "type": "address",
              "internalType": "contract ITalonTwap"
            },
            {
              "name": "sequencer_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "inputs",
              "type": "tuple[]",
              "internalType": "struct NavOracle.FeedInput[]",
              "components": [
                {
                  "name": "asset",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "aggregator",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "maxAge",
                  "type": "uint32",
                  "internalType": "uint32"
                },
                {
                  "name": "checkIssuerPause",
                  "type": "bool",
                  "internalType": "bool"
                }
              ]
            },
            {
              "name": "priceChecksOnly_",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "EXECUTION_PRICE_VERSION",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "MAX_DIVERGENCE_BPS",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "SEQUENCER_GRACE",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "dex",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ITalonTwap"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "feeds",
          "inputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "aggregator",
              "type": "address",
              "internalType": "contract ITalonAggregator"
            },
            {
              "name": "tokenUnit",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "feedUnit",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "maxAge",
              "type": "uint32",
              "internalType": "uint32"
            },
            {
              "name": "checkIssuerPause",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "priceChecksOnly",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "quote",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "quoteExecution",
          "inputs": [
            {
              "name": "tokenIn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenOut",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "sequencer",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ITalonAggregator"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "value",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "error",
          "name": "NAV__Divergence",
          "inputs": []
        },
        {
          "type": "error",
          "name": "NAV__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "NAV__IssuerPaused",
          "inputs": []
        },
        {
          "type": "error",
          "name": "NAV__PriceUnavailable",
          "inputs": []
        },
        {
          "type": "error",
          "name": "NAV__SequencerUnavailable",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xbc357f33201ae564a4501040ecde975f76a809fc38fcb1dfe4aed4f9287c8b6e"
    },
    {
      "name": "PortfolioManager",
      "address": "0x7885bE6edD3Fdff4fAA0e2d0E07a3cA6daF14F7D",
      "contractIdentifier": "src/talon/PortfolioManager.sol:PortfolioManager",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/utils/Bytes.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/AllocationStrategy.sol",
        "src/talon/BasketRegistry.sol",
        "src/talon/Executor.sol",
        "src/talon/ITalonExtensions.sol",
        "src/talon/NavOracle.sol",
        "src/talon/PortfolioManager.sol",
        "src/talon/StreamingFees.sol",
        "src/talon/TalonAccount.sol"
      ],
      "constructorArgs": "0x00000000000000000000000043fda6a15fe33539b640116fdbd1c96534daa406000000000000000000000000e925835036946ea2ef4d0103b471f151990fd21a",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "collection_",
              "type": "address",
              "internalType": "contract IManagedTalon"
            },
            {
              "name": "oracle_",
              "type": "address",
              "internalType": "contract NavOracle"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "cancel",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "collection",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IManagedTalon"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "execute",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "index",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "received",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "exitCashDirect",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "finalizeCashExit",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "oracle",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract NavOracle"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "plan",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "tuple",
              "internalType": "struct PortfolioManager.Plan",
              "components": [
                {
                  "name": "accountState",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "deadline",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "completed",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "firstExecution",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "cashExit",
                  "type": "bool",
                  "internalType": "bool"
                },
                {
                  "name": "active",
                  "type": "bool",
                  "internalType": "bool"
                },
                {
                  "name": "trades",
                  "type": "tuple[]",
                  "internalType": "struct PortfolioManager.Trade[]",
                  "components": [
                    {
                      "name": "tokenIn",
                      "type": "address",
                      "internalType": "address"
                    },
                    {
                      "name": "tokenOut",
                      "type": "address",
                      "internalType": "address"
                    },
                    {
                      "name": "amount",
                      "type": "uint256",
                      "internalType": "uint256"
                    },
                    {
                      "name": "spent",
                      "type": "uint256",
                      "internalType": "uint256"
                    },
                    {
                      "name": "minOutput",
                      "type": "uint256",
                      "internalType": "uint256"
                    },
                    {
                      "name": "lastExecution",
                      "type": "uint256",
                      "internalType": "uint256"
                    }
                  ]
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "queueCashExit",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "minimums",
              "type": "uint256[]",
              "internalType": "uint256[]"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "rebalance",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "trades",
              "type": "tuple[]",
              "internalType": "struct PortfolioManager.TradeInput[]",
              "components": [
                {
                  "name": "tokenIn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "tokenOut",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "amount",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minOutput",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "rebalanceDirect",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "trades",
              "type": "tuple[]",
              "internalType": "struct PortfolioManager.TradeInput[]",
              "components": [
                {
                  "name": "tokenIn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "tokenOut",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "amount",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minOutput",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "startTargetPlan",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "trades",
              "type": "tuple[]",
              "internalType": "struct PortfolioManager.TradeInput[]",
              "components": [
                {
                  "name": "tokenIn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "tokenOut",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "amount",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minOutput",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            },
            {
              "name": "deadline",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "strategy",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract AllocationStrategy"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "validateDirectPurchase",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "minimum",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "validatePurchase",
          "inputs": [
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "minimum",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "PlanCancelled",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "PlanCreated",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "accountState",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "deadline",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "cashExit",
              "type": "bool",
              "indexed": false,
              "internalType": "bool"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "TradeExecuted",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "leg",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "spent",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "received",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Portfolio__InvalidClip",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Portfolio__InvalidPlan",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Portfolio__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Portfolio__Unavailable",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xf12eee8b734f51a35317aea8f57ed7a334b41ceb30fbc4fa3c06ad7b700e4f94"
    },
    {
      "name": "AllocationStrategy",
      "address": "0x88b9d2a62De3c91187Da230A567Ff747D8bd7C05",
      "contractIdentifier": "src/talon/AllocationStrategy.sol:AllocationStrategy",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/utils/Bytes.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/AllocationStrategy.sol",
        "src/talon/BasketRegistry.sol",
        "src/talon/Executor.sol",
        "src/talon/ITalonExtensions.sol",
        "src/talon/NavOracle.sol",
        "src/talon/StreamingFees.sol",
        "src/talon/TalonAccount.sol"
      ],
      "constructorArgs": "0x00000000000000000000000043fda6a15fe33539b640116fdbd1c96534daa406000000000000000000000000e925835036946ea2ef4d0103b471f151990fd21a0000000000000000000000007885be6edd3fdff4faa0e2d0e07a3ca6daf14f7d",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "collection_",
              "type": "address",
              "internalType": "contract IAllocationCollection"
            },
            {
              "name": "oracle_",
              "type": "address",
              "internalType": "contract NavOracle"
            },
            {
              "name": "manager_",
              "type": "address",
              "internalType": "contract IAllocationManager"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "collection",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IAllocationCollection"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "disable",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "manager",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IAllocationManager"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "oracle",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract NavOracle"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "quote",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "trades",
              "type": "tuple[]",
              "internalType": "struct IAllocationManager.TradeInput[]",
              "components": [
                {
                  "name": "tokenIn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "tokenOut",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "amount",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "minOutput",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "setTarget",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "assets",
              "type": "address[]",
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "internalType": "uint16[]"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "start",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "target",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "tuple",
              "internalType": "struct AllocationStrategy.Target",
              "components": [
                {
                  "name": "grantor",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "ownershipEpoch",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "nextRebalance",
                  "type": "uint256",
                  "internalType": "uint256"
                },
                {
                  "name": "enabled",
                  "type": "bool",
                  "internalType": "bool"
                },
                {
                  "name": "assets",
                  "type": "address[]",
                  "internalType": "address[]"
                },
                {
                  "name": "weights",
                  "type": "uint16[]",
                  "internalType": "uint16[]"
                }
              ]
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "RebalanceStarted",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "nextRebalance",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "TargetDisabled",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "TargetSet",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "assets",
              "type": "address[]",
              "indexed": false,
              "internalType": "address[]"
            },
            {
              "name": "weights",
              "type": "uint16[]",
              "indexed": false,
              "internalType": "uint16[]"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Strategy__NoDrift",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Strategy__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Strategy__Unavailable",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xa40b29fd3e4471976ebe7fe841790574dc0c44edc65c6b1fa74a13ad5f070a9a"
    },
    {
      "name": "HolderRewards",
      "address": "0x5C94190224f829f11b1269C96D32ac9f180C6889",
      "contractIdentifier": "src/talon/rewards/HolderRewards.sol:HolderRewards",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/utils/Bytes.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/BasketRegistry.sol",
        "src/talon/Executor.sol",
        "src/talon/ITalonExtensions.sol",
        "src/talon/NavOracle.sol",
        "src/talon/StreamingFees.sol",
        "src/talon/TalonAccount.sol",
        "src/talon/rewards/CouponDistributor.sol",
        "src/talon/rewards/HolderRewards.sol"
      ],
      "constructorArgs": "0x0000000000000000000000005258611f497eb45f5cfac7adf8c0130dce8bcaeb00000000000000000000000043fda6a15fe33539b640116fdbd1c96534daa406000000000000000000000000e925835036946ea2ef4d0103b471f151990fd21a",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "coupons_",
              "type": "address",
              "internalType": "contract CouponDistributor"
            },
            {
              "name": "collection_",
              "type": "address",
              "internalType": "contract IRewardTalon"
            },
            {
              "name": "oracle_",
              "type": "address",
              "internalType": "contract NavOracle"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "checkpoint",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claim",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "amounts",
              "type": "uint256[2]",
              "internalType": "uint256[2]"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claimToken",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "token",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "collection",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IRewardTalon"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "coupons",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract CouponDistributor"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "enroll",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "capital",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "exit",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "multiplier",
          "inputs": [
            {
              "name": "age",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "pure"
        },
        {
          "type": "function",
          "name": "oracle",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract NavOracle"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "positions",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "capital",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "weight",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "enrolled",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "reduce",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "anchor",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "withdrawalValues",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "asset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "total",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "removed",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "ValuationUnavailable",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "WeightUpdated",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "capital",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "weight",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Holders__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Holders__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xf44d94976803903b783ea459770e5c14e2b1da7207f6621143a100f1e938a78f"
    },
    {
      "name": "StakingLocker",
      "address": "0xCfdDE5408dA6537fF4f78181293666FEBb515E70",
      "contractIdentifier": "src/talon/rewards/StakingLocker.sol:StakingLocker",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/rewards/CouponDistributor.sol",
        "src/talon/rewards/StakingLocker.sol"
      ],
      "constructorArgs": "0x0000000000000000000000005258611f497eb45f5cfac7adf8c0130dce8bcaeb000000000000000000000000a27de5300aacc228daf4beb771a0d40ecbeeeb21",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "coupons_",
              "type": "address",
              "internalType": "contract CouponDistributor"
            },
            {
              "name": "reserve_",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claim",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256[2]",
              "internalType": "uint256[2]"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claimToken",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "rewardToken",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "coupons",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract CouponDistributor"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "locks",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "principal",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "weight",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "unlockAt",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "nextId",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "receiptAt",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "index",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "receiptCount",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "reserve",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "stake",
          "inputs": [
            {
              "name": "amount",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "daysLocked",
              "type": "uint16",
              "internalType": "uint16"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "terms",
          "inputs": [
            {
              "name": "daysLocked",
              "type": "uint16",
              "internalType": "uint16"
            }
          ],
          "outputs": [
            {
              "name": "multiplierBps",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "pure"
        },
        {
          "type": "function",
          "name": "token",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IERC20"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "totalPrincipal",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "unstake",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "Staked",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "principal",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "weight",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "unlockAt",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "Unstaked",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "returned",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "penalty",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "type": "error",
          "name": "Staking__BalanceMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Staking__InvalidLock",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Staking__Unauthorized",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xf1b0aa60bf2a259e3d5700c565b261351bf58e88da78f948731551bebccb4008"
    },
    {
      "name": "LiquidityLocker",
      "address": "0xEFF86159ee10BC01C6c0124C12376a8AA5a1EC1C",
      "contractIdentifier": "src/talon/rewards/LiquidityLocker.sol:LiquidityLocker",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/Executor.sol",
        "src/talon/UniswapV3Adapter.sol",
        "src/talon/rewards/CouponDistributor.sol",
        "src/talon/rewards/LiquidityLocker.sol",
        "src/vendor/uniswap-v4/BitMath.sol",
        "src/vendor/uniswap-v4/CustomRevert.sol",
        "src/vendor/uniswap-v4/TickMath.sol"
      ],
      "constructorArgs": "0x0000000000000000000000005258611f497eb45f5cfac7adf8c0130dce8bcaeb00000000000000000000000073991a25c818bf1f1128deaab1492d45638de0d30000000000000000000000001f7d7550b1b028f7571e69a784071f0205fd2efa0000000000000000000000000bd7d308f8e1639fab988df18a8011f41eacad730000000000000000000000000000000000000000000000000000000000002710",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "coupons_",
              "type": "address",
              "internalType": "contract CouponDistributor"
            },
            {
              "name": "manager_",
              "type": "address",
              "internalType": "contract ILPPositionManager"
            },
            {
              "name": "factory_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "pairedAsset",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "fee_",
              "type": "uint24",
              "internalType": "uint24"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "activeStake",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "checkpoint",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claim",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256[2]",
              "internalType": "uint256[2]"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "claimToken",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "token",
              "type": "uint8",
              "internalType": "uint8"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "collectTradingFees",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "recipient",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "coupons",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract CouponDistributor"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "fee",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint24",
              "internalType": "uint24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "nextStakeId",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "onERC721Received",
          "inputs": [
            {
              "name": "operator",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "from",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "",
              "type": "bytes",
              "internalType": "bytes"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "bytes4",
              "internalType": "bytes4"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "positionManager",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ILPPositionManager"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "receiptAt",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "index",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "receiptCount",
          "inputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            }
          ],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "stake",
          "inputs": [
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "stakes",
          "inputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [
            {
              "name": "owner",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "liquidity",
              "type": "uint128",
              "internalType": "uint128"
            },
            {
              "name": "active",
              "type": "bool",
              "internalType": "bool"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tickLower",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "int24",
              "internalType": "int24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tickUpper",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "int24",
              "internalType": "int24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "token0",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "token1",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "unstake",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "event",
          "name": "Staked",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "tokenId",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "liquidity",
              "type": "uint128",
              "indexed": false,
              "internalType": "uint128"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "Unstaked",
          "inputs": [
            {
              "name": "id",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "owner",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "LP__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "LP__InvalidPosition",
          "inputs": []
        },
        {
          "type": "error",
          "name": "LP__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        }
      ],
      "runtimeCodeHash": "0xccb930b8722094ae9be0c9336d70e5fc1490974038ed7cd6c4167f16acb4c2f0"
    },
    {
      "name": "BuybackEngine",
      "address": "0x78681ebF278f9952180633582E4429D3b3756e59",
      "contractIdentifier": "src/talon/rewards/BuybackEngine.sol:BuybackEngine",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/Executor.sol",
        "src/talon/NavOracle.sol",
        "src/talon/UniswapV3Adapter.sol",
        "src/talon/rewards/BuybackEngine.sol",
        "src/talon/rewards/CouponDistributor.sol",
        "src/talon/rewards/FeeRouter.sol",
        "src/vendor/uniswap-v4/BitMath.sol",
        "src/vendor/uniswap-v4/CustomRevert.sol",
        "src/vendor/uniswap-v4/TickMath.sol"
      ],
      "constructorArgs": "0x000000000000000000000000d7c5bc78ccc18ac10b15a6807d98bc4e3bbe2b82000000000000000000000000e86a5918289ec08db709e388ff9ea573f0a88fe800000000000000000000000000000000000000000000000000000000004c4b40",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "fees_",
              "type": "address",
              "internalType": "contract FeeRouter"
            },
            {
              "name": "adapter_",
              "type": "address",
              "internalType": "contract UniswapV3Adapter"
            },
            {
              "name": "maxClip_",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "INTERVAL",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "adapter",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract UniswapV3Adapter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "coupons",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract CouponDistributor"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "execute",
          "inputs": [],
          "outputs": [
            {
              "name": "bought",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "fees",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract FeeRouter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "lastExecution",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "maxClip",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "protocolToken",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IERC20"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract IERC20"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "totalBought",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "totalSpent",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "BoughtBack",
          "inputs": [
            {
              "name": "spent",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "bought",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "keeperReward",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Buyback__BalanceMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Buyback__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Buyback__Unavailable",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0xea943f4c5959c6a46432efb08e618a6e2c7903f4a49523c6182db6a21c894f6f"
    },
    {
      "name": "LiquidityEngine",
      "address": "0x3dA5b713B1d5440C201867fF892e3B64d11AF5bf",
      "contractIdentifier": "src/talon/rewards/LiquidityEngine.sol:LiquidityEngine",
      "compilerVersion": "0.8.28+commit.7893614a",
      "settings": {
        "remappings": [
          "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
          "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
          "forge-std/=lib/forge-std/src/",
          "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
          "openzeppelin-contracts/=lib/openzeppelin-contracts/"
        ],
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "metadata": {
          "bytecodeHash": "none",
          "appendCBOR": false
        },
        "evmVersion": "cancun",
        "libraries": {}
      },
      "sourcePaths": [
        "lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/utils/Panic.sol",
        "lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/Math.sol",
        "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol",
        "src/talon/Executor.sol",
        "src/talon/NavOracle.sol",
        "src/talon/UniswapV3Adapter.sol",
        "src/talon/rewards/CouponDistributor.sol",
        "src/talon/rewards/FeeRouter.sol",
        "src/talon/rewards/LiquidityEngine.sol",
        "src/talon/rewards/LiquidityLocker.sol",
        "src/vendor/uniswap-v4/BitMath.sol",
        "src/vendor/uniswap-v4/CustomRevert.sol",
        "src/vendor/uniswap-v4/TickMath.sol"
      ],
      "constructorArgs": "0x000000000000000000000000d7c5bc78ccc18ac10b15a6807d98bc4e3bbe2b82000000000000000000000000e86a5918289ec08db709e388ff9ea573f0a88fe800000000000000000000000073991a25c818bf1f1128deaab1492d45638de0d30000000000000000000000000bd7d308f8e1639fab988df18a8011f41eacad73000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000004c4b40",
      "abi": [
        {
          "type": "constructor",
          "inputs": [
            {
              "name": "fees_",
              "type": "address",
              "internalType": "contract FeeRouter"
            },
            {
              "name": "adapter_",
              "type": "address",
              "internalType": "contract UniswapV3Adapter"
            },
            {
              "name": "manager_",
              "type": "address",
              "internalType": "contract ILPMintManager"
            },
            {
              "name": "pairedAsset_",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "fee_",
              "type": "uint24",
              "internalType": "uint24"
            },
            {
              "name": "maxClip_",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "adapter",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract UniswapV3Adapter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "collectTradingFees",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "execute",
          "inputs": [],
          "outputs": [
            {
              "name": "liquidity",
              "type": "uint128",
              "internalType": "uint128"
            }
          ],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "fees",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract FeeRouter"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "lastExecution",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "maxClip",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "pairedAsset",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "poolFee",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint24",
              "internalType": "uint24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "positionId",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "positionManager",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "contract ILPMintManager"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "protocolToken",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "releasePosition",
          "inputs": [],
          "outputs": [],
          "stateMutability": "nonpayable"
        },
        {
          "type": "function",
          "name": "settlement",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tickLower",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "int24",
              "internalType": "int24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "tickUpper",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "int24",
              "internalType": "int24"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "token0",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "token1",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "totalSpent",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "uint256",
              "internalType": "uint256"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "function",
          "name": "treasury",
          "inputs": [],
          "outputs": [
            {
              "name": "",
              "type": "address",
              "internalType": "address"
            }
          ],
          "stateMutability": "view"
        },
        {
          "type": "event",
          "name": "LiquidityAdded",
          "inputs": [
            {
              "name": "position",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            },
            {
              "name": "spent",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "liquidity",
              "type": "uint128",
              "indexed": false,
              "internalType": "uint128"
            },
            {
              "name": "amount0",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            },
            {
              "name": "amount1",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "PositionReleased",
          "inputs": [
            {
              "name": "position",
              "type": "uint256",
              "indexed": true,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "event",
          "name": "RemainderSent",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "indexed": true,
              "internalType": "address"
            },
            {
              "name": "amount",
              "type": "uint256",
              "indexed": false,
              "internalType": "uint256"
            }
          ],
          "anonymous": false
        },
        {
          "type": "error",
          "name": "Liquidity__BalanceMismatch",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Liquidity__InvalidConfiguration",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Liquidity__Unauthorized",
          "inputs": []
        },
        {
          "type": "error",
          "name": "Liquidity__Unavailable",
          "inputs": []
        },
        {
          "type": "error",
          "name": "ReentrancyGuardReentrantCall",
          "inputs": []
        },
        {
          "type": "error",
          "name": "SafeERC20FailedOperation",
          "inputs": [
            {
              "name": "token",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "runtimeCodeHash": "0x055f073a14586b0483aea871cc0b4fa6735bb32a9446d4759e410afe6807512d"
    }
  ]
}
