{"file_path":"src/AttestationOracle.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.30;\n\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {PausableUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\nimport {EIP712Upgradeable} from \"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\";\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\nimport {IAttestationOracle} from \"./interfaces/IAttestationOracle.sol\";\nimport {Roles} from \"./libraries/Roles.sol\";\n\n/// @title AttestationOracle — the off-chain → on-chain synchronization layer (ADR-0007)\n/// @notice Authorized attesters co-sign facts (EIP-712 typed data); once a kind's\n///         m-of-n threshold of DISTINCT attester signatures over the IDENTICAL struct\n///         is relayed here, the fact becomes on-chain truth: the ClaimBridge mint gate,\n///         the WaterfallEngine's payment gate, the DefaultManager's default/loss and\n///         margin paths, and signed facility amendments all read it.\n///\n///         ⚠ TRUST BOUNDARY (ADR-0007 — the protocol's primary trust assumption): the\n///         protocol executes faithfully on whatever authorized attesters assert. A\n///         false attestation, or a compromised attester key set reaching a kind's\n///         threshold, means the protocol acts on false information. Mitigations are\n///         m-of-n thresholds (≥2 for high-value kinds), governance-managed attester\n///         rotation, guardian pause on submissions, and governance revocation — not\n///         trustlessness. Forest Road's conscious acceptance of this boundary is a\n///         pre-mainnet ownership item (brief Part 11 gate 6).\n/// @dev Replay safety operates at TWO levels, and the second one is load-bearing:\n///      1. BUNDLE level — every accepted EIP-712 digest is consumed forever (`used`). This stops\n///         a byte-identical resubmission and nothing more.\n///      2. FACT level (AUDIT FIX C4-01/C4-02) — every one-shot fact, keyed on\n///         (facilityId, kind, payload) with the digest's `nonce`/`asOf`/`expiry` salt EXCLUDED, is\n///         realisable exactly once (`factStatuses`). Level 1 alone was bypassable by re-signing\n///         the SAME real-world event under a fresh nonce, which caused one real loss to be\n///         written down twice and made governance `revoke` cosmetic on 8 of the 9 kinds.\n///      `Valuation` is the 9th kind and is excluded from level 2 on purpose: it is a monotone\n///      observation series whose uniqueness key is the per-facility high-watermark, requiring\n///      strictly increasing attested `asOf`, so a stale-but-genuinely-signed mark can never roll\n///      back a newer one and a revoked observation can never return. `asOf` is the ATTESTED\n///      observation time inside the signed struct — freshness rules (ADR-0015/0017) are\n///      meaningless against submission time.\ncontract AttestationOracle is\n    Initializable,\n    AccessControlUpgradeable,\n    PausableUpgradeable,\n    EIP712Upgradeable,\n    UUPSUpgradeable,\n    IAttestationOracle\n{\n    struct Record {\n        bytes32 payload;\n        uint64 asOf;\n        bool satisfied;\n    }\n\n    /// @custom:storage-location erc7201:forestroad.storage.AttestationOracle\n    struct OracleStorage {\n        mapping(uint256 facilityId => mapping(AttestationKind kind => Record)) records;\n        mapping(AttestationKind kind => uint8) thresholds;\n        mapping(bytes32 digest => bool) used;\n        // ── AUDIT FIX (H-02): valuation anti-rollback high-watermark (append-only TAIL) ──\n        // The highest `asOf` ever ACCEPTED for a facility, held OUTSIDE the record so that\n        // `revoke` can zero the live mark (an emergency stop) without rewinding the monotonic\n        // clock. Must stay last: inserting mid-struct would shift every field below it and\n        // corrupt a deployed proxy.\n        mapping(uint256 facilityId => uint64) valuationWatermarks;\n        // ── AUDIT FIX (C4-01 / C4-02): per-FACT consume-once ledger (append-only TAIL) ──\n        // Keyed by `_factKey(facilityId, kind, payload)` — the economic fact, with the digest's\n        // replay salt (nonce/asOf/expiry) deliberately excluded. `used[digest]` above is keyed on\n        // the SIGNATURE BUNDLE and is therefore defeated by re-signing the identical fact under a\n        // fresh nonce; this ledger is keyed on the EVENT and is not. Must stay last: inserting\n        // mid-struct would shift every field below it and corrupt a deployed proxy.\n        mapping(bytes32 factKey => FactStatus) factStatuses;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"forestroad.storage.AttestationOracle\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ORACLE_STORAGE_LOCATION =\n        0xac9508c5303c175f6440d43a5e3eadcf5afa63ca3c359d94d58c5e5919cebf00;\n\n    /// @dev keccak256(\"Attestation(uint256 facilityId,uint8 kind,bytes32 payload,uint64 asOf,uint64 expiry,uint256 nonce)\")\n    bytes32 private constant ATTESTATION_TYPEHASH =\n        keccak256(\"Attestation(uint256 facilityId,uint8 kind,bytes32 payload,uint64 asOf,uint64 expiry,uint256 nonce)\");\n\n    error Oracle_ZeroAddress();\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    /// @notice Initializes documentary kinds at one signer and every kind authorizing\n    ///         financial or risk changes, including accrual openings, at two signers.\n    /// @param admin Governance timelock (attester set, thresholds, revocation).\n    /// @param guardian Emergency pauser (submissions only — reads never pause).\n    /// @param upgrader Upgrade authority (timelock).\n    function initialize(address admin, address guardian, address upgrader) external initializer {\n        if (admin == address(0) || guardian == address(0) || upgrader == address(0)) revert Oracle_ZeroAddress();\n        __AccessControl_init();\n        __Pausable_init();\n        __EIP712_init(\"ForestRoadAttestationOracle\", \"1\");\n        __UUPSUpgradeable_init();\n        _grantRole(DEFAULT_ADMIN_ROLE, admin);\n        _grantRole(Roles.GUARDIAN_ROLE, guardian);\n        _grantRole(Roles.UPGRADER_ROLE, upgrader);\n        OracleStorage storage $ = _storage();\n        for (uint8 k = 0; k <= uint8(AttestationKind.AccrualOpening); ++k) {\n            AttestationKind kind = AttestationKind(k);\n            // AUDIT FIX (M): every kind that authorizes a VALUE-MOVING or state-freezing\n            // action defaults to 2-of-n so no single compromised attester key can act\n            // alone — CreditIssued/Valuation (mint gate + backing), PaymentReceived\n            // (authorizes a waterfall distribution), DefaultDeclared (drives the loss\n            // path). Documentary assignment/perfection kinds start 1-of-n.\n            uint8 m = (\n                kind == AttestationKind.CreditIssued || kind == AttestationKind.Valuation\n                    || kind == AttestationKind.PaymentReceived || kind == AttestationKind.DefaultDeclared\n                    || kind == AttestationKind.LossRealized || kind == AttestationKind.PastDueCured\n                    || kind == AttestationKind.TermsAmended || kind == AttestationKind.AccrualOpening\n            ) ? 2 : 1;\n            $.thresholds[kind] = m;\n            emit ThresholdSet(kind, m);\n        }\n    }\n\n    // ── Submission ───────────────────────────────────────────────────────\n\n    /// @inheritdoc IAttestationOracle\n    /// @dev Signatures must be sorted by ascending recovered signer address — the\n    ///      cheapest possible distinctness proof for the m-of-n check.\n    function attest(AttestationInput calldata a, bytes[] calldata signatures) external whenNotPaused {\n        if (block.timestamp > a.expiry) revert Oracle_Expired(a.expiry);\n        if (a.asOf == 0 || a.asOf > block.timestamp) revert Oracle_BadAsOf(a.asOf);\n\n        OracleStorage storage $ = _storage();\n        uint8 required = $.thresholds[a.kind];\n        // Fail closed if a new kind is introduced without an initialized threshold, or\n        // if an unsafe legacy upgrade leaves the threshold slot unset. `setThreshold`\n        // rejects zero, but submission must enforce the invariant independently.\n        if (required == 0) revert Oracle_BadThreshold();\n        if (signatures.length < required) revert Oracle_ThresholdNotMet(required, signatures.length);\n\n        bytes32 digest = _hashTypedDataV4(\n            keccak256(\n                abi.encode(ATTESTATION_TYPEHASH, a.facilityId, uint8(a.kind), a.payload, a.asOf, a.expiry, a.nonce)\n            )\n        );\n        if ($.used[digest]) revert Oracle_DigestAlreadyUsed(digest);\n        $.used[digest] = true;\n\n        // ══ AUDIT FIX (C4-01 / C4-02) — DO NOT DELETE. THE DIGEST GUARD ABOVE IS NOT ENOUGH. ══\n        // `nonce`, `asOf` and `expiry` live INSIDE the digest and OUTSIDE the economic fact, so the\n        // SAME real-world event re-signed by the same quorum under a fresh nonce yields a fresh\n        // digest and walks straight past `used[digest]`. Measured before this guard existed: one\n        // 300,000e18 loss on one facility was cascaded and written down TWICE (outstanding fell\n        // 2,000,000 -> 1,400,000 instead of -> 1,700,000), and a loss attestation that GOVERNANCE\n        // HAD REVOKED landed anyway. Both repros live in\n        // `test/audit/Fix_C401-fact-realised-once.t.sol`.\n        //\n        // The consume-once key is therefore the FACT — (facilityId, kind, payload) — not the\n        // bundle. Every one-shot kind's payload already commits to its event identity (payment id,\n        // amendment id, or an evidence hash), so this is exact rather than approximate.\n        //\n        // `Valuation` is DELIBERATELY EXCLUDED, and this is not an oversight: a valuation is a\n        // monotone OBSERVATION SERIES, not a one-shot event. Two genuinely distinct marks may\n        // legitimately carry the identical value, so payload-keying would freeze a facility's mark\n        // permanently at the first repeat — a live-fire liveness break on the MTM margin path and\n        // `ReserveManager.totalBackingValue()`. Its uniqueness key is the H-02 high-watermark\n        // (facility, asOf) enforced below, which already makes both replay AND revocation durable.\n        // If you ever add Valuation here, read `test_c402_valuationStaysWatermarkKeyedNotPayloadKeyed`\n        // first.\n        //\n        // OPERATIONAL CONSEQUENCE, now binding: an evidence hash must be unique per real-world\n        // event. Two equal-sized partial write-downs on one facility need two distinct evidence\n        // hashes; reusing one FAILS CLOSED here rather than double-writing-down.\n        bool oneShot = a.kind != AttestationKind.Valuation;\n        bytes32 factKey_;\n        if (oneShot) {\n            factKey_ = _factKey(a.facilityId, a.kind, a.payload);\n            FactStatus status = $.factStatuses[factKey_];\n            // ── PRIMARY LEDGER GUARD (C4-01) — DO NOT DELETE, AND DO NOT ASSUME THE SHADOW ──\n            // ── GUARD BELOW COVERS IT. THEY COVER DISJOINT STATES.                        ──\n            // AUDIT R17-01 (the same defect class, one round later): every C4-01 regression\n            // replayed a fact while the record slot STILL HELD THAT PAYLOAD, so the legacy shadow\n            // guard below caught all of them and this line was deletable with the whole C4-01 file\n            // green — MEASURED: 11 of 11 passing with the C4-01 half of this line removed.\n            //\n            // The state only THIS line sees is a SUPERSEDED fact: `records[facility][kind]` holds\n            // ONE payload, so the moment a second fact of the same kind lands on the same facility\n            // (two partial write-downs, two servicing payments, two amendments — the ordinary\n            // multi-event facility) every EARLIER fact's record is gone while its ledger entry\n            // stands. Re-signing tranche 1 under a fresh nonce then walks past the digest guard\n            // AND past the shadow guard, and `DefaultManager.realizeLoss` writes tranche 1 down a\n            // second time. `test/audit/Fix_C401b-superseded-fact-replay.t.sol` drives exactly that\n            // to completion in money, and `OracleHandler.replaySupersededFact` reaches it in the\n            // stateful campaign with a non-vacuity counter behind it.\n            if (status != FactStatus.None) revert Oracle_FactAlreadyRealised(factKey_, status);\n            // UPGRADE-PATH DEGRADATION, exactly parallel to H-02's `max` below and for the same\n            // reason. On an IN-PLACE UUPS upgrade of a proxy that predates this fix, `factStatuses`\n            // starts EMPTY while live records stand, so every already-realised fact would read\n            // `None` and be replayable exactly once. The live record is the one piece of pre-upgrade\n            // evidence available: if this submission reproduces the CURRENT record for the slot, the\n            // fact has demonstrably been through here before. That covers the most recent — and by\n            // far the most valuable — fact per (facility, kind), which is precisely what a holder of\n            // a duplicate pre-signed bundle would target. On a FRESH deploy this branch is\n            // UNREACHABLE (a standing record implies a non-`None` ledger entry), so it costs\n            // correctness nothing and degrades the rule gracefully instead of to nothing at all.\n            // It cannot distinguish Consumed from Revoked on the legacy path; `satisfied` is all\n            // the pre-upgrade state says, so it reports the closest honest status.\n            //\n            // SHADOW GUARD (upgrade path only) — DO NOT DELETE EITHER, and do not mistake it for a\n            // second copy of the guard above. It is keyed on the LIVE RECORD, so it is blind to\n            // every superseded fact (see the primary guard's note); the primary guard is in turn\n            // blind to a proxy whose ledger predates this fix. Deleting this line reds\n            // `test_c401_legacyProxyWithAnEmptyLedgerStillBlocksTheReplay`; deleting the primary\n            // guard reds `test/audit/Fix_C401b-superseded-fact-replay.t.sol`. Neither test can\n            // stand in for the other.\n            Record storage legacy = $.records[a.facilityId][a.kind];\n            if (legacy.asOf != 0 && legacy.payload == a.payload) {\n                revert Oracle_FactAlreadyRealised(\n                    factKey_, legacy.satisfied ? FactStatus.Recorded : FactStatus.Consumed\n                );\n            }\n        }\n\n        address prev = address(0);\n        for (uint256 i = 0; i < signatures.length; ++i) {\n            address signer = ECDSA.recover(digest, signatures[i]);\n            if (signer <= prev) revert Oracle_UnorderedSigners(prev, signer);\n            if (!hasRole(Roles.ATTESTER_ROLE, signer)) revert Oracle_NotAttester(signer);\n            prev = signer;\n            emit Attested(a.facilityId, a.kind, signer, uint64(block.timestamp));\n        }\n\n        Record storage r = $.records[a.facilityId][a.kind];\n        // A second action must not strand an accepted payment, loss or servicing approval.\n        // Documentary records and observation series retain their existing replacement policy.\n        if (oneShot && a.kind >= AttestationKind.PaymentReceived && r.satisfied) {\n            revert Oracle_UnconsumedFact(a.facilityId, a.kind, r.payload);\n        }\n        if (a.kind == AttestationKind.Valuation) {\n            if (uint256(a.payload) == 0) revert Oracle_ZeroValuation();\n            // AUDIT FIX (H-02). Strictly newer marks only, measured against the per-facility\n            // HIGH-WATERMARK rather than the live record. `revoke` zeroes `r.asOf`, so\n            // comparing against the record alone let an older but validly-signed bundle be\n            // replayed the instant governance revoked a bad mark -- and that mark feeds\n            // `ReserveManager.totalBackingValue()`, the right-hand side of the backing\n            // invariant. Taking `max` with `r.asOf` is deliberate belt-and-braces: on a\n            // FRESH deploy the watermark already dominates, but on an in-place upgrade of a\n            // proxy that predates this fix the watermark starts at zero while a live mark\n            // stands, and the max makes the rule degrade to the OLD behaviour rather than to\n            // no rule at all.\n            uint64 floor_ = $.valuationWatermarks[a.facilityId];\n            if (r.asOf > floor_) floor_ = r.asOf;\n            if (a.asOf <= floor_) revert Oracle_StaleValuation(a.asOf, floor_);\n            $.valuationWatermarks[a.facilityId] = a.asOf;\n        }\n        // AUDIT FIX (C4-01): burn the FACT here, after every check has passed.\n        //\n        // CORRECTION (audit R17-01). An earlier revision of this comment justified the ordering as\n        // stopping \"an unauthorized relayer permanently poisoning a legitimate fact's key with a\n        // garbage bundle\". That reasoning is WRONG and is removed rather than repeated: every\n        // failure between here and the top of the function REVERTS (`Oracle_NotAttester`,\n        // `Oracle_UnorderedSigners`, `ECDSA`'s own malformed-signature revert), which unwinds any\n        // write made earlier in the same call. The ordering is therefore checks-effects hygiene —\n        // correct, and worth keeping — but it is NOT what prevents that denial of service; the\n        // revert is. Do not rely on the ordering for a property only the revert provides.\n        if (oneShot) $.factStatuses[factKey_] = FactStatus.Recorded;\n        r.payload = a.payload;\n        r.asOf = a.asOf;\n        r.satisfied = true;\n        emit AttestationSatisfied(a.facilityId, a.kind, a.payload, a.asOf);\n    }\n\n    // ── Credit-layer consumption ─────────────────────────────────────────\n\n    /// @inheritdoc IAttestationOracle\n    /// @dev Never pausable: consumption is part of loss/payment processing, and\n    ///      suppressing it would strand already-attested value flows.\n    function consume(uint256 facilityId, AttestationKind kind) external onlyRole(Roles.CREDIT_ROLE) {\n        OracleStorage storage $ = _storage();\n        Record storage r = $.records[facilityId][kind];\n        if (!r.satisfied) revert Oracle_NotSatisfied(facilityId, kind);\n        r.satisfied = false; // payload + asOf retained for audit\n        // AUDIT FIX (C4-01) — DO NOT DELETE. `satisfied = false` alone was the entire reason ONE\n        // real loss could be written down twice: it left the record re-satisfiable, and the digest\n        // guard could not see a re-signing of the same fact. Recording the spend against the FACT\n        // key is what makes consumption terminal. Skipped for `Valuation`, which is not a one-shot\n        // fact and is keyed on the H-02 watermark (see `attest`); writing a status for it would\n        // block the legitimate re-marking of an unchanged value.\n        if (kind != AttestationKind.Valuation) {\n            $.factStatuses[_factKey(facilityId, kind, r.payload)] = FactStatus.Consumed;\n        }\n        emit AttestationConsumed(facilityId, kind, msg.sender);\n    }\n\n    // ── Governance ───────────────────────────────────────────────────────\n\n    /// @inheritdoc IAttestationOracle\n    function revoke(uint256 facilityId, AttestationKind kind) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        OracleStorage storage $ = _storage();\n        Record storage r = $.records[facilityId][kind];\n        if (!r.satisfied && r.payload == bytes32(0)) revert Oracle_NotSatisfied(facilityId, kind);\n        r.satisfied = false;\n        if (kind == AttestationKind.Valuation) {\n            // AUDIT FIX (H-02): SEED the watermark from the live mark BEFORE wiping it. The\n            // additive floor in `attest` alone does not cover the upgrade path -- on a proxy\n            // that predates this fix the watermark is zero, so revoking first would drop the\n            // floor to zero and re-open exactly the rollback window this closes. Seeding here\n            // makes the monotonic clock survive revocation on every path.\n            if (r.asOf > $.valuationWatermarks[facilityId]) $.valuationWatermarks[facilityId] = r.asOf;\n            // a revoked mark must not keep steering the margin path or the backing\n            r.payload = bytes32(0);\n            r.asOf = 0;\n        } else {\n            // AUDIT FIX (C4-02) — DO NOT DELETE. Before this line, `revoke` was COSMETIC on 8 of\n            // the 9 kinds: it cleared `satisfied` and nothing stopped the identical bundle being\n            // re-signed under a fresh nonce and re-consumed, so governance's emergency stop on a\n            // discovered-false attestation could be undone by any relayer. Measured: a REVOKED\n            // 300,000e18 loss was written down anyway. `Valuation` was the sole durable kind, and\n            // only because H-02's watermark (seeded in the branch above) is already a fact-level\n            // key — which is exactly why the other eight now get a fact-level tombstone here.\n            //\n            // The tombstone is PERMANENT BY DESIGN, with no governance lever to lift it. That is\n            // the same reasoning that deleted `resetValuationWatermark` (see the note below):\n            // governance acts through a PUBLIC timelock queue, so any \"un-revoke\" lever would let\n            // a holder of the revoked pre-signed bundle race it and re-open this exact hole.\n            //\n            // RE-ESTABLISHING A REVOKED FACT — CORRECTED, audit R17-03. An earlier revision of\n            // this comment said, without qualification, \"the attesters sign a NEW fact — a new\n            // evidence hash\". THAT IS ONLY TRUE FOR THE KINDS WHOSE PAYLOAD CARRIES A FREE\n            // EVENT-IDENTITY FIELD, and an operator who trusted it on the kind that does not\n            // would find the facility bricked. The two cases, both pinned in\n            // `test/audit/Fix_C402b-revocation-escape-hatch.t.sol`:\n            //\n            //   WORKS — DefaultDeclared / LossRealized / PastDueCured (free `evidenceHash`),\n            //   PaymentReceived (free `paymentId`), and TermsAmended (free `amendmentId`).\n            //   The documentary kinds are deal-identity facts under P-32, so ClaimBridge binds\n            //   their payloads to the exact terms hash as well; a new document hash is a fresh\n            //   oracle fact but cannot restore the mint gate, and the exact hash is tombstoned.\n            //\n            //   DOES NOT WORK — CreditIssued. The H-4/P-32 terms binding makes\n            //   `ClaimBridge._requireMintAttestations` demand the deal-identity payloads equal\n            //   `_creditTermsHash(facility)` EXACTLY, and that hash is a pure function of the signed terms: there is no free\n            //   field to vary. Once revoked, that (facilityId, CreditIssued, termsHash) triple is\n            //   dead forever, so a PENDING facility cannot be funded and cannot be amended\n            //   (`amendTerms` requires Active/Amortizing). The remedy is NOT a re-attestation: it\n            //   is `ClaimBridge.cancelPending` — which reverses the recorded concentration\n            //   exposure and burns the position — followed by re-origination at a FRESH facility\n            //   id, whose different id gives the identical terms a different fact key. Before the\n            //   token is minted the same applies to `nextId`: those exact terms are dead at that\n            //   id and origination must move to a different id or different terms.\n            $.factStatuses[_factKey(facilityId, kind, r.payload)] = FactStatus.Revoked;\n        }\n        emit AttestationRevoked(facilityId, kind);\n    }\n\n    // AUDIT / OWNER DECISION (2026-07-22): `resetValuationWatermark` was REMOVED. The H-02\n    // anti-rollback watermark itself is unchanged (see `attest`/`revoke` and\n    // `valuationWatermarks`). The governance recovery lever that could lower a stuck watermark\n    // was deleted because it was also an attack surface -- governance actions go through a PUBLIC\n    // timelock queue, so a queued reset let a holder of a pre-signed OLDER valuation race the\n    // watermark down the instant it executed, re-opening the very rollback the watermark prevents.\n    // The rare \"watermark stuck at a far-future asOf\" recovery case is covered by the oracle's\n    // UUPS upgrade path (also timelock-gated), so the dedicated lever was redundant with an\n    // existing path while adding a race surface. Tradeoff accepted by the owner.\n\n    /// @inheritdoc IAttestationOracle\n    /// @dev AUDIT FIX: the value-moving / state-freezing kinds are floored at 2-of-n so\n    ///      governance can't (accidentally or maliciously) lower them back to 1-of-n and\n    ///      undo the single-attester protection (ADR-0007 high-value kinds).\n    function setThreshold(AttestationKind kind, uint8 threshold_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        if (threshold_ == 0) revert Oracle_BadThreshold();\n        if (\n            threshold_ < 2\n                && (\n                    kind == AttestationKind.CreditIssued || kind == AttestationKind.Valuation\n                        || kind == AttestationKind.PaymentReceived || kind == AttestationKind.DefaultDeclared\n                        || kind == AttestationKind.LossRealized || kind == AttestationKind.PastDueCured\n                        || kind == AttestationKind.TermsAmended || kind == AttestationKind.AccrualOpening\n                )\n        ) revert Oracle_BadThreshold();\n        _storage().thresholds[kind] = threshold_;\n        emit ThresholdSet(kind, threshold_);\n    }\n\n    // ── Guardian ─────────────────────────────────────────────────────────\n\n    /// @notice Pauses attestation submissions (the lever against suspect attesters).\n    ///         Reads and consumption never pause.\n    function pause() external onlyRole(Roles.GUARDIAN_ROLE) {\n        _pause();\n    }\n\n    /// @notice Unpauses submissions.\n    function unpause() external onlyRole(Roles.GUARDIAN_ROLE) {\n        _unpause();\n    }\n\n    // ── Views ────────────────────────────────────────────────────────────\n\n    /// @inheritdoc IAttestationOracle\n    function isSatisfied(uint256 facilityId, AttestationKind kind) external view returns (bool) {\n        return _storage().records[facilityId][kind].satisfied;\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function latestValuation(uint256 facilityId) external view returns (uint256 value, uint64 asOf) {\n        Record storage r = _storage().records[facilityId][AttestationKind.Valuation];\n        return (uint256(r.payload), r.asOf);\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function latestPayload(uint256 facilityId, AttestationKind kind)\n        external\n        view\n        returns (bytes32 payload, uint64 asOf, bool satisfied)\n    {\n        Record storage r = _storage().records[facilityId][kind];\n        return (r.payload, r.asOf, r.satisfied);\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function valuationWatermark(uint256 facilityId) external view returns (uint64) {\n        return _storage().valuationWatermarks[facilityId];\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function threshold(AttestationKind kind) external view returns (uint8) {\n        return _storage().thresholds[kind];\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function digestUsed(bytes32 digest) external view returns (bool) {\n        return _storage().used[digest];\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function factKey(uint256 facilityId, AttestationKind kind, bytes32 payload) external pure returns (bytes32) {\n        return _factKey(facilityId, kind, payload);\n    }\n\n    /// @inheritdoc IAttestationOracle\n    function factStatus(uint256 facilityId, AttestationKind kind, bytes32 payload) external view returns (FactStatus) {\n        return _storage().factStatuses[_factKey(facilityId, kind, payload)];\n    }\n\n    /// @notice The EIP-712 struct digest for an attestation (attester tooling aid).\n    function attestationDigest(AttestationInput calldata a) external view override returns (bytes32) {\n        return _hashTypedDataV4(\n            keccak256(\n                abi.encode(ATTESTATION_TYPEHASH, a.facilityId, uint8(a.kind), a.payload, a.asOf, a.expiry, a.nonce)\n            )\n        );\n    }\n\n    // ── Internals ────────────────────────────────────────────────────────\n\n    function _authorizeUpgrade(address) internal override onlyRole(Roles.UPGRADER_ROLE) {}\n\n    /// @dev AUDIT FIX (C4-01). The consume-once key for an economic FACT. `nonce`, `asOf` and\n    ///      `expiry` are deliberately ABSENT: they are replay salt that varies between two\n    ///      signings of the SAME real-world event, which is precisely how the digest guard was\n    ///      bypassed. Do not add them back.\n    function _factKey(uint256 facilityId, AttestationKind kind, bytes32 payload) private pure returns (bytes32) {\n        return keccak256(abi.encode(facilityId, uint8(kind), payload));\n    }\n\n    function _storage() private pure returns (OracleStorage storage $) {\n        assembly {\n            $.slot := ORACLE_STORAGE_LOCATION\n        }\n    }\n}\n","deployed_bytecode":"0x608060405260043610610173575f3560e01c806352d1902d116100c9578063a217fddf11610078578063a217fddf14610470578063a23c287e14610483578063ad3cb1cc146104a2578063bb01111a146104df578063c0c53b8b146104fe578063d547741f1461051d578063ec75614f1461053c575f5ffd5b806352d1902d146103a35780635c975abb146103b7578063697ec449146103cb57806372a8dba6146103f75780638456cb591461041657806384b0196e1461042a57806391d1485414610451575f5ffd5b806322ad86a01161012557806322ad86a0146102c9578063248a9ca3146103005780632f2ff15d1461031f578063315344c31461033e57806336568abe1461035d5780633f4ba83a1461037c5780634f1ef28614610390575f5ffd5b806301ffc9a714610177578063054301d6146101ab57806305ccd464146101ef578063107ebbaa1461021c57806314f6b1fb1461023d5780631bc6dca71461025c5780631ca338f11461028d575b5f5ffd5b348015610182575f5ffd5b50610196610191366004612624565b61055b565b60405190151581526020015b60405180910390f35b3480156101b6575f5ffd5b506101ca6101c536600461265e565b610591565b604080519384526001600160401b0390921660208401521515908201526060016101a2565b3480156101fa575f5ffd5b5061020e610209366004612688565b61060a565b6040519081526020016101a2565b348015610227575f5ffd5b5061023b61023636600461265e565b610620565b005b348015610248575f5ffd5b5061023b61025736600461265e565b610783565b348015610267575f5ffd5b5061027b6102763660046126bb565b61093f565b60405160ff90911681526020016101a2565b348015610298575f5ffd5b506102ac6102a73660046126d4565b610988565b604080519283526001600160401b039091166020830152016101a2565b3480156102d4575f5ffd5b506102e86102e33660046126d4565b6109c7565b6040516001600160401b0390911681526020016101a2565b34801561030b575f5ffd5b5061020e61031a3660046126d4565b6109ec565b34801561032a575f5ffd5b5061023b610339366004612701565b610a0a565b348015610349575f5ffd5b5061023b610358366004612722565b610a2c565b348015610368575f5ffd5b5061023b610377366004612701565b610bff565b348015610387575f5ffd5b5061023b610c37565b61023b61039e366004612770565b610c59565b3480156103ae575f5ffd5b5061020e610c78565b3480156103c2575f5ffd5b50610196610c93565b3480156103d6575f5ffd5b506103ea6103e5366004612688565b610ca7565b6040516101a29190612859565b348015610402575f5ffd5b506101966104113660046126d4565b610cda565b348015610421575f5ffd5b5061023b610cf9565b348015610435575f5ffd5b5061043e610d18565b6040516101a29796959493929190612895565b34801561045c575f5ffd5b5061019661046b366004612701565b610dbc565b34801561047b575f5ffd5b5061020e5f81565b34801561048e575f5ffd5b5061023b61049d366004612941565b610df0565b3480156104ad575f5ffd5b506104d2604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516101a291906129c1565b3480156104ea575f5ffd5b506101966104f936600461265e565b61160d565b348015610509575f5ffd5b5061023b6105183660046129d3565b61166c565b348015610528575f5ffd5b5061023b610537366004612701565b611a2b565b348015610547575f5ffd5b5061020e610556366004612a13565b611a47565b5f6001600160e01b03198216637965db0b60e01b148061058b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f5f5f5f61059d611acf565b5f87815260209190915260408120908660098111156105be576105be612831565b60098111156105cf576105cf612831565b815260208101919091526040015f2080546001909101549094506001600160401b0381169350600160401b900460ff169150505b9250925092565b5f610616848484611af3565b90505b9392505050565b7f8f949a3ba351e10a4e8a55f43474eba190dceef5961d8b678c89e6dd8f5681ef61064a81611b45565b5f610653611acf565b5f858152602082905260408120919250908185600981111561067757610677612831565b600981111561068857610688612831565b81526020019081526020015f2090508060010160089054906101000a900460ff166106d3578484604051631ce294af60e01b81526004016106ca929190612a3d565b60405180910390fd5b60018101805460ff60401b1916905560058460098111156106f6576106f6612831565b1461073f576002826004015f6107108888865f0154611af3565b815260208101919091526040015f20805460ff1916600183600381111561073957610739612831565b02179055505b3384600981111561075257610752612831565b60405187907f122ec69f450ab05f6b12af59cd61aa2203da212900ff3e6c0550421a30844371905f90a45050505050565b5f61078d81611b45565b5f610796611acf565b5f85815260208290526040812091925090818560098111156107ba576107ba612831565b60098111156107cb576107cb612831565b81526020019081526020015f2090508060010160089054906101000a900460ff161580156107f857508054155b1561081a578484604051631ce294af60e01b81526004016106ca929190612a3d565b60018101805460ff60401b19169055600584600981111561083d5761083d612831565b036108b8575f85815260038301602052604090205460018201546001600160401b039182169116111561089d5760018101545f8681526003840160205260409020805467ffffffffffffffff19166001600160401b039092169190911790555b5f815560018101805467ffffffffffffffff191690556108fc565b6003826004015f6108cd8888865f0154611af3565b815260208101919091526040015f20805460ff191660018360038111156108f6576108f6612831565b02179055505b83600981111561090e5761090e612831565b60405186907f497f7de0d563f0df1560981d41c1cbc5ab5739bfd88bdf0077f09da6a51c810d905f90a35050505050565b5f610948611acf565b6001015f83600981111561095e5761095e612831565b600981111561096f5761096f612831565b815260208101919091526040015f205460ff1692915050565b5f5f5f610993611acf565b5f9485526020908152604080862060058752909152909320805460019091015490946001600160401b039091169350915050565b5f6109d0611acf565b5f9283526003016020525060409020546001600160401b031690565b5f5f6109f6611b4f565b5f9384526020525050604090206001015490565b610a13826109ec565b610a1c81611b45565b610a268383611b73565b50505050565b5f610a3681611b45565b8160ff165f03610a59576040516305eecad760e21b815260040160405180910390fd5b60028260ff16108015610b4057506002836009811115610a7b57610a7b612831565b1480610a9857506005836009811115610a9657610a96612831565b145b80610ab457506003836009811115610ab257610ab2612831565b145b80610ad057506004836009811115610ace57610ace612831565b145b80610aec57506006836009811115610aea57610aea612831565b145b80610b0857506007836009811115610b0657610b06612831565b145b80610b2457506008836009811115610b2257610b22612831565b145b80610b4057506009836009811115610b3e57610b3e612831565b145b15610b5e576040516305eecad760e21b815260040160405180910390fd5b81610b67611acf565b6001015f856009811115610b7d57610b7d612831565b6009811115610b8e57610b8e612831565b81526020019081526020015f205f6101000a81548160ff021916908360ff160217905550826009811115610bc457610bc4612831565b60405160ff841681527f28a4f2bc9a2d1e8262aceeb52de887dda6aab13506e563af344f61cc95f1f4aa9060200160405180910390a2505050565b6001600160a01b0381163314610c285760405163334bd91960e11b815260040160405180910390fd5b610c328282611c11565b505050565b5f516020612d0c5f395f51905f52610c4e81611b45565b610c56611c87565b50565b610c61611cdd565b610c6a82611d83565b610c748282611dad565b5050565b5f610c81611e60565b505f516020612cec5f395f51905f5290565b5f5f610c9d611ea9565b5460ff1692915050565b5f610cb0611acf565b6004015f610cbf868686611af3565b815260208101919091526040015f205460ff16949350505050565b5f610ce3611acf565b5f92835260020160205250604090205460ff1690565b5f516020612d0c5f395f51905f52610d1081611b45565b610c56611ecd565b5f6060805f5f5f60605f610d2a611f13565b8054909150158015610d3e57506001810154155b610d825760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016106ca565b610d8a611f37565b610d92611fd5565b604080515f80825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b5f5f610dc6611b4f565b5f948552602090815260408086206001600160a01b03959095168652939052505090205460ff1690565b610df8611ff1565b610e0860a0840160808501612a51565b6001600160401b0316421115610e4d57610e2860a0840160808501612a51565b6040516321d55f7360e21b81526001600160401b0390911660048201526024016106ca565b610e5d6080840160608501612a51565b6001600160401b03161580610e89575042610e7e6080850160608601612a51565b6001600160401b0316115b15610ec357610e9e6080840160608501612a51565b60405163708629d960e01b81526001600160401b0390911660048201526024016106ca565b5f610ecc611acf565b90505f6001820181610ee460408801602089016126bb565b6009811115610ef557610ef5612831565b6009811115610f0657610f06612831565b815260208101919091526040015f9081205460ff169150819003610f3d576040516305eecad760e21b815260040160405180910390fd5b60ff8116831015610f6d5760405163471f461360e11b815260ff82166004820152602481018490526044016106ca565b5f6110107f58790f254d4654a2210f6fa3c6cde13fc2901526dd389b2b1665ae75427581788735610fa460408a0160208b016126bb565b6009811115610fb557610fb5612831565b60408a0135610fca60808c0160608d01612a51565b610fda60a08d0160808e01612a51565b8c60a00135604051602001610ff59796959493929190612a77565b60405160208183030381529060405280519060200120612017565b5f81815260028501602052604090205490915060ff16156110475760405163c9ea192760e01b8152600481018290526024016106ca565b5f8181526002840160205260408120805460ff1916600117905560056110736040890160208a016126bb565b600981111561108457611084612831565b141590505f81156111b3576110ae88356110a460408b0160208c016126bb565b8a60400135611af3565b5f81815260048701602052604081205491925060ff909116908160038111156110d9576110d9612831565b146110fb578181604051632d83b50960e01b81526004016106ca929190612ab6565b88355f9081526020878152604080832091839161111d91908e01908e016126bb565b600981111561112e5761112e612831565b600981111561113f5761113f612831565b815260208101919091526040015f2060018101549091506001600160401b0316158015906111715750805460408b0135145b156111b05760018101548390600160401b900460ff16611192576002611195565b60015b604051632d83b50960e01b81526004016106ca929190612ab6565b50505b5f805b87811015611325575f611220868b8b858181106111d5576111d5612aca565b90506020028101906111e79190612ade565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061204392505050565b9050826001600160a01b0316816001600160a01b03161161126757604051639ec6d30d60e01b81526001600160a01b038085166004830152821660248201526044016106ca565b6112917fca77cd8f9856ef5fcd36f6b15bf469fe216c2f9114f60dd031f0a2b97b67aaa982610dbc565b6112b057806040516339dcb78760e21b81526004016106ca9190612b27565b9150816001600160a01b0381166112cd60408d0160208e016126bb565b60098111156112de576112de612831565b6040516001600160401b03421681528d35907e0dcdf13bf9ca3d6acc817b5d922672b6a76b10e4d98bfa309559cf733d953c9060200160405180910390a4506001016111b6565b5088355f9081526020878152604080832091839161134891908e01908e016126bb565b600981111561135957611359612831565b600981111561136a5761136a612831565b81526020019081526020015f2090508380156113a75750600361139360408c0160208d016126bb565b60098111156113a4576113a4612831565b10155b80156113be57506001810154600160401b900460ff165b156113f35789356113d560408c0160208d016126bb565b8254604051630ef4891760e11b81526106ca93929190600401612b3b565b600561140560408c0160208d016126bb565b600981111561141657611416612831565b036115215760408a01355f0361143f576040516397373cbd60e01b815260040160405180910390fd5b89355f90815260038801602052604090205460018201546001600160401b03918216911681101561147a575060018101546001600160401b03165b6001600160401b03811661149460808d0160608e01612a51565b6001600160401b0316116114df576114b260808c0160608d01612a51565b6040516303daafcf60e01b81526001600160401b03918216600482015290821660248201526044016106ca565b6114ef60808c0160608d01612a51565b8b355f90815260038a0160205260409020805467ffffffffffffffff19166001600160401b0392909216919091179055505b8315611542575f8381526004880160205260409020805460ff191660011790555b60408a0135815561155960808b0160608c01612a51565b60018201805468ffffffffffffffffff19166001600160401b039290921691909117600160401b17905561159360408b0160208c016126bb565b60098111156115a4576115a4612831565b8a5f01357fb5524b7067ffd2b7fb661aeb6b9c7a1a75b43d1ea55a78c7a4ea335866bff23b8c604001358d60600160208101906115e19190612a51565b604080519283526001600160401b0390911660208301520160405180910390a350505050505050505050565b5f611616611acf565b5f848152602091909152604081209083600981111561163757611637612831565b600981111561164857611648612831565b815260208101919091526040015f2060010154600160401b900460ff169392505050565b5f61167561206b565b805490915060ff600160401b82041615906001600160401b03165f8115801561169b5750825b90505f826001600160401b031660011480156116b65750303b155b9050811580156116c4575080155b156116e25760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561170c57845460ff60401b1916600160401b1785555b6001600160a01b038816158061172957506001600160a01b038716155b8061173b57506001600160a01b038616155b156117595760405163e4d6a43360e01b815260040160405180910390fd5b611761612093565b611769612093565b6117c16040518060400160405280601b81526020017f466f72657374526f61644174746573746174696f6e4f7261636c650000000000815250604051806040016040528060018152602001603160f81b81525061209b565b6117c9612093565b6117d35f89611b73565b506117eb5f516020612d0c5f395f51905f5288611b73565b506118167f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e387611b73565b505f611820611acf565b90505f5b600960ff8216116119d9575f8160ff16600981111561184557611845612831565b90505f600282600981111561185c5761185c612831565b14806118795750600582600981111561187757611877612831565b145b806118955750600382600981111561189357611893612831565b145b806118b1575060048260098111156118af576118af612831565b145b806118cd575060068260098111156118cb576118cb612831565b145b806118e9575060078260098111156118e7576118e7612831565b145b806119055750600882600981111561190357611903612831565b145b806119215750600982600981111561191f5761191f612831565b145b61192c57600161192f565b60025b905080846001015f84600981111561194957611949612831565b600981111561195a5761195a612831565b81526020019081526020015f205f6101000a81548160ff021916908360ff16021790555081600981111561199057611990612831565b60405160ff831681527f28a4f2bc9a2d1e8262aceeb52de887dda6aab13506e563af344f61cc95f1f4aa9060200160405180910390a25050806119d290612b5d565b9050611824565b50508315611a2157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b611a34826109ec565b611a3d81611b45565b610a268383611c11565b5f61058b7f58790f254d4654a2210f6fa3c6cde13fc2901526dd389b2b1665ae75427581788335611a7e60408601602087016126bb565b6009811115611a8f57611a8f612831565b6040860135611aa46080880160608901612a51565b611ab460a0890160808a01612a51565b8860a00135604051602001610ff59796959493929190612a77565b7fac9508c5303c175f6440d43a5e3eadcf5afa63ca3c359d94d58c5e5919cebf0090565b5f83836009811115611b0757611b07612831565b60408051602081019390935260ff90911690820152606081018390526080016040516020818303038152906040528051906020012090509392505050565b610c5681336120ad565b7f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b62680090565b5f5f611b7d611b4f565b9050611b898484610dbc565b611c08575f848152602082815260408083206001600160a01b03871684529091529020805460ff19166001179055611bbe3390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4600191505061058b565b5f91505061058b565b5f5f611c1b611b4f565b9050611c278484610dbc565b15611c08575f848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4600191505061058b565b611c8f6120e6565b5f611c98611ea9565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051611cd29190612b27565b60405180910390a150565b306001600160a01b037f000000000000000000000000870deb459512099e70e9a640cf3140a0d969fc18161480611d6357507f000000000000000000000000870deb459512099e70e9a640cf3140a0d969fc186001600160a01b0316611d575f516020612cec5f395f51905f52546001600160a01b031690565b6001600160a01b031614155b15611d815760405163703e46dd60e11b815260040160405180910390fd5b565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610c7481611b45565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611e07575060408051601f3d908101601f19168201909252611e0491810190612b87565b60015b611e265781604051634c9c8ce360e01b81526004016106ca9190612b27565b5f516020612cec5f395f51905f528114611e5657604051632a87526960e21b8152600481018290526024016106ca565b610c32838361210b565b306001600160a01b037f000000000000000000000000870deb459512099e70e9a640cf3140a0d969fc181614611d815760405163703e46dd60e11b815260040160405180910390fd5b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b611ed5611ff1565b5f611ede611ea9565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611cc53390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b60605f611f42611f13565b9050806002018054611f5390612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054611f7f90612b9e565b8015611fca5780601f10611fa157610100808354040283529160200191611fca565b820191905f5260205f20905b815481529060010190602001808311611fad57829003601f168201915b505050505091505090565b60605f611fe0611f13565b9050806003018054611f5390612b9e565b611ff9610c93565b15611d815760405163d93c066560e01b815260040160405180910390fd5b5f61058b612023612160565b8360405161190160f01b8152600281019290925260228201526042902090565b5f5f5f5f612051868661216e565b92509250925061206182826121b4565b5090949350505050565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0061058b565b611d8161226c565b6120a361226c565b610c748282612291565b6120b78282610dbc565b610c745760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106ca565b6120ee610c93565b611d8157604051638dfc202b60e01b815260040160405180910390fd5b612114826122d0565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561215857610c32828261232a565b610c7461239c565b5f6121696123bb565b905090565b5f5f5f83516041036121a5576020840151604085015160608601515f1a6121978882858561242e565b955095509550505050610603565b505081515f9150600290610603565b5f8260038111156121c7576121c7612831565b036121d0575050565b60018260038111156121e4576121e4612831565b036122025760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561221657612216612831565b036122375760405163fce698f760e01b8152600481018290526024016106ca565b600382600381111561224b5761224b612831565b03610c74576040516335e2f38360e21b8152600481018290526024016106ca565b6122746124ec565b611d8157604051631afcd79f60e31b815260040160405180910390fd5b61229961226c565b5f6122a2611f13565b9050600281016122b28482612c1b565b50600381016122c18382612c1b565b505f8082556001909101555050565b806001600160a01b03163b5f036122fc5780604051634c9c8ce360e01b81526004016106ca9190612b27565b5f516020612cec5f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f5f846001600160a01b0316846040516123469190612cd5565b5f60405180830381855af49150503d805f811461237e576040519150601f19603f3d011682016040523d82523d5f602084013e612383565b606091505b5091509150612393858383612505565b95945050505050565b3415611d815760405163b398979f60e01b815260040160405180910390fd5b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6123e5612558565b6123ed6125bd565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f80806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0384111561245d57505f915060039050826124e2565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156124ae573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b0381166124d957505f9250600191508290506124e2565b92505f91508190505b9450945094915050565b5f6124f561206b565b54600160401b900460ff16919050565b60608261251a57612515826125fc565b610619565b815115801561253157506001600160a01b0384163b155b156125515783604051639996b31560e01b81526004016106ca9190612b27565b5080610619565b5f5f612562611f13565b90505f61256d611f37565b80519091501561258557805160209091012092915050565b81548015612594579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b5f5f6125c7611f13565b90505f6125d2611fd5565b8051909150156125ea57805160209091012092915050565b60018201548015612594579392505050565b80511561260b57805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f60208284031215612634575f5ffd5b81356001600160e01b031981168114610619575f5ffd5b8035600a8110612659575f5ffd5b919050565b5f5f6040838503121561266f575f5ffd5b8235915061267f6020840161264b565b90509250929050565b5f5f5f6060848603121561269a575f5ffd5b833592506126aa6020850161264b565b929592945050506040919091013590565b5f602082840312156126cb575f5ffd5b6106198261264b565b5f602082840312156126e4575f5ffd5b5035919050565b80356001600160a01b0381168114612659575f5ffd5b5f5f60408385031215612712575f5ffd5b8235915061267f602084016126eb565b5f5f60408385031215612733575f5ffd5b61273c8361264b565b9150602083013560ff81168114612751575f5ffd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215612781575f5ffd5b61278a836126eb565b915060208301356001600160401b038111156127a4575f5ffd5b8301601f810185136127b4575f5ffd5b80356001600160401b038111156127cd576127cd61275c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156127fb576127fb61275c565b604052818152828201602001871015612812575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b634e487b7160e01b5f52602160045260245ffd5b6004811061285557612855612831565b9052565b6020810161058b8284612845565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e060208201525f6128b360e0830189612867565b82810360408401526128c58189612867565b606084018890526001600160a01b038716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b8181101561291a5783518352602093840193909201916001016128fc565b50909b9a5050505050505050505050565b5f60c0828403121561293b575f5ffd5b50919050565b5f5f5f60e08486031215612953575f5ffd5b61295d858561292b565b925060c08401356001600160401b03811115612977575f5ffd5b8401601f81018613612987575f5ffd5b80356001600160401b0381111561299c575f5ffd5b8660208260051b84010111156129b0575f5ffd5b939660209190910195509293505050565b602081525f6106196020830184612867565b5f5f5f606084860312156129e5575f5ffd5b6129ee846126eb565b92506129fc602085016126eb565b9150612a0a604085016126eb565b90509250925092565b5f60c08284031215612a23575f5ffd5b610619838361292b565b600a811061285557612855612831565b828152604081016106196020830184612a2d565b5f60208284031215612a61575f5ffd5b81356001600160401b0381168114610619575f5ffd5b968752602087019590955260ff93909316604086015260608501919091526001600160401b0390811660808501521660a083015260c082015260e00190565b828152604081016106196020830184612845565b634e487b7160e01b5f52603260045260245ffd5b5f5f8335601e19843603018112612af3575f5ffd5b8301803591506001600160401b03821115612b0c575f5ffd5b602001915036819003821315612b20575f5ffd5b9250929050565b6001600160a01b0391909116815260200190565b83815260608101612b4f6020830185612a2d565b826040830152949350505050565b5f60ff821660ff8103612b7e57634e487b7160e01b5f52601160045260245ffd5b60010192915050565b5f60208284031215612b97575f5ffd5b5051919050565b600181811c90821680612bb257607f821691505b60208210810361293b57634e487b7160e01b5f52602260045260245ffd5b601f821115610c3257805f5260205f20601f840160051c81016020851015612bf55750805b601f840160051c820191505b81811015612c14575f8155600101612c01565b5050505050565b81516001600160401b03811115612c3457612c3461275c565b612c4881612c428454612b9e565b84612bd0565b6020601f821160018114612c7a575f8315612c635750848201515b5f19600385901b1c1916600184901b178455612c14565b5f84815260208120601f198516915b82811015612ca95787850151825560209485019460019092019101612c89565b5084821015612cc657868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041a264697066735822122018ca30f2408b7638dcefdadfc096a933ee927ec5989129721747cefcb6bbbf4e64736f6c634300081e0033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"cancun","metadata":{"appendCBOR":true,"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":100},"remappings":["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","solady/=lib/solady/src/","forge-std/=lib/forge-std/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"viaIR":false},"optimization_runs":100,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"0.8.30+commit.73712a01","is_verified_via_verifier_alliance":true,"verified_at":"2026-09-19T01:55:25.162461Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a060405230608052348015610013575f5ffd5b5061001c610021565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051612d616100f95f395f8181611ce801528181611d110152611e6b0152612d615ff3fe608060405260043610610173575f3560e01c806352d1902d116100c9578063a217fddf11610078578063a217fddf14610470578063a23c287e14610483578063ad3cb1cc146104a2578063bb01111a146104df578063c0c53b8b146104fe578063d547741f1461051d578063ec75614f1461053c575f5ffd5b806352d1902d146103a35780635c975abb146103b7578063697ec449146103cb57806372a8dba6146103f75780638456cb591461041657806384b0196e1461042a57806391d1485414610451575f5ffd5b806322ad86a01161012557806322ad86a0146102c9578063248a9ca3146103005780632f2ff15d1461031f578063315344c31461033e57806336568abe1461035d5780633f4ba83a1461037c5780634f1ef28614610390575f5ffd5b806301ffc9a714610177578063054301d6146101ab57806305ccd464146101ef578063107ebbaa1461021c57806314f6b1fb1461023d5780631bc6dca71461025c5780631ca338f11461028d575b5f5ffd5b348015610182575f5ffd5b50610196610191366004612624565b61055b565b60405190151581526020015b60405180910390f35b3480156101b6575f5ffd5b506101ca6101c536600461265e565b610591565b604080519384526001600160401b0390921660208401521515908201526060016101a2565b3480156101fa575f5ffd5b5061020e610209366004612688565b61060a565b6040519081526020016101a2565b348015610227575f5ffd5b5061023b61023636600461265e565b610620565b005b348015610248575f5ffd5b5061023b61025736600461265e565b610783565b348015610267575f5ffd5b5061027b6102763660046126bb565b61093f565b60405160ff90911681526020016101a2565b348015610298575f5ffd5b506102ac6102a73660046126d4565b610988565b604080519283526001600160401b039091166020830152016101a2565b3480156102d4575f5ffd5b506102e86102e33660046126d4565b6109c7565b6040516001600160401b0390911681526020016101a2565b34801561030b575f5ffd5b5061020e61031a3660046126d4565b6109ec565b34801561032a575f5ffd5b5061023b610339366004612701565b610a0a565b348015610349575f5ffd5b5061023b610358366004612722565b610a2c565b348015610368575f5ffd5b5061023b610377366004612701565b610bff565b348015610387575f5ffd5b5061023b610c37565b61023b61039e366004612770565b610c59565b3480156103ae575f5ffd5b5061020e610c78565b3480156103c2575f5ffd5b50610196610c93565b3480156103d6575f5ffd5b506103ea6103e5366004612688565b610ca7565b6040516101a29190612859565b348015610402575f5ffd5b506101966104113660046126d4565b610cda565b348015610421575f5ffd5b5061023b610cf9565b348015610435575f5ffd5b5061043e610d18565b6040516101a29796959493929190612895565b34801561045c575f5ffd5b5061019661046b366004612701565b610dbc565b34801561047b575f5ffd5b5061020e5f81565b34801561048e575f5ffd5b5061023b61049d366004612941565b610df0565b3480156104ad575f5ffd5b506104d2604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516101a291906129c1565b3480156104ea575f5ffd5b506101966104f936600461265e565b61160d565b348015610509575f5ffd5b5061023b6105183660046129d3565b61166c565b348015610528575f5ffd5b5061023b610537366004612701565b611a2b565b348015610547575f5ffd5b5061020e610556366004612a13565b611a47565b5f6001600160e01b03198216637965db0b60e01b148061058b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f5f5f5f61059d611acf565b5f87815260209190915260408120908660098111156105be576105be612831565b60098111156105cf576105cf612831565b815260208101919091526040015f2080546001909101549094506001600160401b0381169350600160401b900460ff169150505b9250925092565b5f610616848484611af3565b90505b9392505050565b7f8f949a3ba351e10a4e8a55f43474eba190dceef5961d8b678c89e6dd8f5681ef61064a81611b45565b5f610653611acf565b5f858152602082905260408120919250908185600981111561067757610677612831565b600981111561068857610688612831565b81526020019081526020015f2090508060010160089054906101000a900460ff166106d3578484604051631ce294af60e01b81526004016106ca929190612a3d565b60405180910390fd5b60018101805460ff60401b1916905560058460098111156106f6576106f6612831565b1461073f576002826004015f6107108888865f0154611af3565b815260208101919091526040015f20805460ff1916600183600381111561073957610739612831565b02179055505b3384600981111561075257610752612831565b60405187907f122ec69f450ab05f6b12af59cd61aa2203da212900ff3e6c0550421a30844371905f90a45050505050565b5f61078d81611b45565b5f610796611acf565b5f85815260208290526040812091925090818560098111156107ba576107ba612831565b60098111156107cb576107cb612831565b81526020019081526020015f2090508060010160089054906101000a900460ff161580156107f857508054155b1561081a578484604051631ce294af60e01b81526004016106ca929190612a3d565b60018101805460ff60401b19169055600584600981111561083d5761083d612831565b036108b8575f85815260038301602052604090205460018201546001600160401b039182169116111561089d5760018101545f8681526003840160205260409020805467ffffffffffffffff19166001600160401b039092169190911790555b5f815560018101805467ffffffffffffffff191690556108fc565b6003826004015f6108cd8888865f0154611af3565b815260208101919091526040015f20805460ff191660018360038111156108f6576108f6612831565b02179055505b83600981111561090e5761090e612831565b60405186907f497f7de0d563f0df1560981d41c1cbc5ab5739bfd88bdf0077f09da6a51c810d905f90a35050505050565b5f610948611acf565b6001015f83600981111561095e5761095e612831565b600981111561096f5761096f612831565b815260208101919091526040015f205460ff1692915050565b5f5f5f610993611acf565b5f9485526020908152604080862060058752909152909320805460019091015490946001600160401b039091169350915050565b5f6109d0611acf565b5f9283526003016020525060409020546001600160401b031690565b5f5f6109f6611b4f565b5f9384526020525050604090206001015490565b610a13826109ec565b610a1c81611b45565b610a268383611b73565b50505050565b5f610a3681611b45565b8160ff165f03610a59576040516305eecad760e21b815260040160405180910390fd5b60028260ff16108015610b4057506002836009811115610a7b57610a7b612831565b1480610a9857506005836009811115610a9657610a96612831565b145b80610ab457506003836009811115610ab257610ab2612831565b145b80610ad057506004836009811115610ace57610ace612831565b145b80610aec57506006836009811115610aea57610aea612831565b145b80610b0857506007836009811115610b0657610b06612831565b145b80610b2457506008836009811115610b2257610b22612831565b145b80610b4057506009836009811115610b3e57610b3e612831565b145b15610b5e576040516305eecad760e21b815260040160405180910390fd5b81610b67611acf565b6001015f856009811115610b7d57610b7d612831565b6009811115610b8e57610b8e612831565b81526020019081526020015f205f6101000a81548160ff021916908360ff160217905550826009811115610bc457610bc4612831565b60405160ff841681527f28a4f2bc9a2d1e8262aceeb52de887dda6aab13506e563af344f61cc95f1f4aa9060200160405180910390a2505050565b6001600160a01b0381163314610c285760405163334bd91960e11b815260040160405180910390fd5b610c328282611c11565b505050565b5f516020612d0c5f395f51905f52610c4e81611b45565b610c56611c87565b50565b610c61611cdd565b610c6a82611d83565b610c748282611dad565b5050565b5f610c81611e60565b505f516020612cec5f395f51905f5290565b5f5f610c9d611ea9565b5460ff1692915050565b5f610cb0611acf565b6004015f610cbf868686611af3565b815260208101919091526040015f205460ff16949350505050565b5f610ce3611acf565b5f92835260020160205250604090205460ff1690565b5f516020612d0c5f395f51905f52610d1081611b45565b610c56611ecd565b5f6060805f5f5f60605f610d2a611f13565b8054909150158015610d3e57506001810154155b610d825760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016106ca565b610d8a611f37565b610d92611fd5565b604080515f80825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b5f5f610dc6611b4f565b5f948552602090815260408086206001600160a01b03959095168652939052505090205460ff1690565b610df8611ff1565b610e0860a0840160808501612a51565b6001600160401b0316421115610e4d57610e2860a0840160808501612a51565b6040516321d55f7360e21b81526001600160401b0390911660048201526024016106ca565b610e5d6080840160608501612a51565b6001600160401b03161580610e89575042610e7e6080850160608601612a51565b6001600160401b0316115b15610ec357610e9e6080840160608501612a51565b60405163708629d960e01b81526001600160401b0390911660048201526024016106ca565b5f610ecc611acf565b90505f6001820181610ee460408801602089016126bb565b6009811115610ef557610ef5612831565b6009811115610f0657610f06612831565b815260208101919091526040015f9081205460ff169150819003610f3d576040516305eecad760e21b815260040160405180910390fd5b60ff8116831015610f6d5760405163471f461360e11b815260ff82166004820152602481018490526044016106ca565b5f6110107f58790f254d4654a2210f6fa3c6cde13fc2901526dd389b2b1665ae75427581788735610fa460408a0160208b016126bb565b6009811115610fb557610fb5612831565b60408a0135610fca60808c0160608d01612a51565b610fda60a08d0160808e01612a51565b8c60a00135604051602001610ff59796959493929190612a77565b60405160208183030381529060405280519060200120612017565b5f81815260028501602052604090205490915060ff16156110475760405163c9ea192760e01b8152600481018290526024016106ca565b5f8181526002840160205260408120805460ff1916600117905560056110736040890160208a016126bb565b600981111561108457611084612831565b141590505f81156111b3576110ae88356110a460408b0160208c016126bb565b8a60400135611af3565b5f81815260048701602052604081205491925060ff909116908160038111156110d9576110d9612831565b146110fb578181604051632d83b50960e01b81526004016106ca929190612ab6565b88355f9081526020878152604080832091839161111d91908e01908e016126bb565b600981111561112e5761112e612831565b600981111561113f5761113f612831565b815260208101919091526040015f2060018101549091506001600160401b0316158015906111715750805460408b0135145b156111b05760018101548390600160401b900460ff16611192576002611195565b60015b604051632d83b50960e01b81526004016106ca929190612ab6565b50505b5f805b87811015611325575f611220868b8b858181106111d5576111d5612aca565b90506020028101906111e79190612ade565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061204392505050565b9050826001600160a01b0316816001600160a01b03161161126757604051639ec6d30d60e01b81526001600160a01b038085166004830152821660248201526044016106ca565b6112917fca77cd8f9856ef5fcd36f6b15bf469fe216c2f9114f60dd031f0a2b97b67aaa982610dbc565b6112b057806040516339dcb78760e21b81526004016106ca9190612b27565b9150816001600160a01b0381166112cd60408d0160208e016126bb565b60098111156112de576112de612831565b6040516001600160401b03421681528d35907e0dcdf13bf9ca3d6acc817b5d922672b6a76b10e4d98bfa309559cf733d953c9060200160405180910390a4506001016111b6565b5088355f9081526020878152604080832091839161134891908e01908e016126bb565b600981111561135957611359612831565b600981111561136a5761136a612831565b81526020019081526020015f2090508380156113a75750600361139360408c0160208d016126bb565b60098111156113a4576113a4612831565b10155b80156113be57506001810154600160401b900460ff165b156113f35789356113d560408c0160208d016126bb565b8254604051630ef4891760e11b81526106ca93929190600401612b3b565b600561140560408c0160208d016126bb565b600981111561141657611416612831565b036115215760408a01355f0361143f576040516397373cbd60e01b815260040160405180910390fd5b89355f90815260038801602052604090205460018201546001600160401b03918216911681101561147a575060018101546001600160401b03165b6001600160401b03811661149460808d0160608e01612a51565b6001600160401b0316116114df576114b260808c0160608d01612a51565b6040516303daafcf60e01b81526001600160401b03918216600482015290821660248201526044016106ca565b6114ef60808c0160608d01612a51565b8b355f90815260038a0160205260409020805467ffffffffffffffff19166001600160401b0392909216919091179055505b8315611542575f8381526004880160205260409020805460ff191660011790555b60408a0135815561155960808b0160608c01612a51565b60018201805468ffffffffffffffffff19166001600160401b039290921691909117600160401b17905561159360408b0160208c016126bb565b60098111156115a4576115a4612831565b8a5f01357fb5524b7067ffd2b7fb661aeb6b9c7a1a75b43d1ea55a78c7a4ea335866bff23b8c604001358d60600160208101906115e19190612a51565b604080519283526001600160401b0390911660208301520160405180910390a350505050505050505050565b5f611616611acf565b5f848152602091909152604081209083600981111561163757611637612831565b600981111561164857611648612831565b815260208101919091526040015f2060010154600160401b900460ff169392505050565b5f61167561206b565b805490915060ff600160401b82041615906001600160401b03165f8115801561169b5750825b90505f826001600160401b031660011480156116b65750303b155b9050811580156116c4575080155b156116e25760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561170c57845460ff60401b1916600160401b1785555b6001600160a01b038816158061172957506001600160a01b038716155b8061173b57506001600160a01b038616155b156117595760405163e4d6a43360e01b815260040160405180910390fd5b611761612093565b611769612093565b6117c16040518060400160405280601b81526020017f466f72657374526f61644174746573746174696f6e4f7261636c650000000000815250604051806040016040528060018152602001603160f81b81525061209b565b6117c9612093565b6117d35f89611b73565b506117eb5f516020612d0c5f395f51905f5288611b73565b506118167f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e387611b73565b505f611820611acf565b90505f5b600960ff8216116119d9575f8160ff16600981111561184557611845612831565b90505f600282600981111561185c5761185c612831565b14806118795750600582600981111561187757611877612831565b145b806118955750600382600981111561189357611893612831565b145b806118b1575060048260098111156118af576118af612831565b145b806118cd575060068260098111156118cb576118cb612831565b145b806118e9575060078260098111156118e7576118e7612831565b145b806119055750600882600981111561190357611903612831565b145b806119215750600982600981111561191f5761191f612831565b145b61192c57600161192f565b60025b905080846001015f84600981111561194957611949612831565b600981111561195a5761195a612831565b81526020019081526020015f205f6101000a81548160ff021916908360ff16021790555081600981111561199057611990612831565b60405160ff831681527f28a4f2bc9a2d1e8262aceeb52de887dda6aab13506e563af344f61cc95f1f4aa9060200160405180910390a25050806119d290612b5d565b9050611824565b50508315611a2157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b611a34826109ec565b611a3d81611b45565b610a268383611c11565b5f61058b7f58790f254d4654a2210f6fa3c6cde13fc2901526dd389b2b1665ae75427581788335611a7e60408601602087016126bb565b6009811115611a8f57611a8f612831565b6040860135611aa46080880160608901612a51565b611ab460a0890160808a01612a51565b8860a00135604051602001610ff59796959493929190612a77565b7fac9508c5303c175f6440d43a5e3eadcf5afa63ca3c359d94d58c5e5919cebf0090565b5f83836009811115611b0757611b07612831565b60408051602081019390935260ff90911690820152606081018390526080016040516020818303038152906040528051906020012090509392505050565b610c5681336120ad565b7f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b62680090565b5f5f611b7d611b4f565b9050611b898484610dbc565b611c08575f848152602082815260408083206001600160a01b03871684529091529020805460ff19166001179055611bbe3390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4600191505061058b565b5f91505061058b565b5f5f611c1b611b4f565b9050611c278484610dbc565b15611c08575f848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4600191505061058b565b611c8f6120e6565b5f611c98611ea9565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051611cd29190612b27565b60405180910390a150565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480611d6357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611d575f516020612cec5f395f51905f52546001600160a01b031690565b6001600160a01b031614155b15611d815760405163703e46dd60e11b815260040160405180910390fd5b565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610c7481611b45565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611e07575060408051601f3d908101601f19168201909252611e0491810190612b87565b60015b611e265781604051634c9c8ce360e01b81526004016106ca9190612b27565b5f516020612cec5f395f51905f528114611e5657604051632a87526960e21b8152600481018290526024016106ca565b610c32838361210b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611d815760405163703e46dd60e11b815260040160405180910390fd5b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b611ed5611ff1565b5f611ede611ea9565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611cc53390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b60605f611f42611f13565b9050806002018054611f5390612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054611f7f90612b9e565b8015611fca5780601f10611fa157610100808354040283529160200191611fca565b820191905f5260205f20905b815481529060010190602001808311611fad57829003601f168201915b505050505091505090565b60605f611fe0611f13565b9050806003018054611f5390612b9e565b611ff9610c93565b15611d815760405163d93c066560e01b815260040160405180910390fd5b5f61058b612023612160565b8360405161190160f01b8152600281019290925260228201526042902090565b5f5f5f5f612051868661216e565b92509250925061206182826121b4565b5090949350505050565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0061058b565b611d8161226c565b6120a361226c565b610c748282612291565b6120b78282610dbc565b610c745760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106ca565b6120ee610c93565b611d8157604051638dfc202b60e01b815260040160405180910390fd5b612114826122d0565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561215857610c32828261232a565b610c7461239c565b5f6121696123bb565b905090565b5f5f5f83516041036121a5576020840151604085015160608601515f1a6121978882858561242e565b955095509550505050610603565b505081515f9150600290610603565b5f8260038111156121c7576121c7612831565b036121d0575050565b60018260038111156121e4576121e4612831565b036122025760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561221657612216612831565b036122375760405163fce698f760e01b8152600481018290526024016106ca565b600382600381111561224b5761224b612831565b03610c74576040516335e2f38360e21b8152600481018290526024016106ca565b6122746124ec565b611d8157604051631afcd79f60e31b815260040160405180910390fd5b61229961226c565b5f6122a2611f13565b9050600281016122b28482612c1b565b50600381016122c18382612c1b565b505f8082556001909101555050565b806001600160a01b03163b5f036122fc5780604051634c9c8ce360e01b81526004016106ca9190612b27565b5f516020612cec5f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f5f846001600160a01b0316846040516123469190612cd5565b5f60405180830381855af49150503d805f811461237e576040519150601f19603f3d011682016040523d82523d5f602084013e612383565b606091505b5091509150612393858383612505565b95945050505050565b3415611d815760405163b398979f60e01b815260040160405180910390fd5b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6123e5612558565b6123ed6125bd565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f80806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0384111561245d57505f915060039050826124e2565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156124ae573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b0381166124d957505f9250600191508290506124e2565b92505f91508190505b9450945094915050565b5f6124f561206b565b54600160401b900460ff16919050565b60608261251a57612515826125fc565b610619565b815115801561253157506001600160a01b0384163b155b156125515783604051639996b31560e01b81526004016106ca9190612b27565b5080610619565b5f5f612562611f13565b90505f61256d611f37565b80519091501561258557805160209091012092915050565b81548015612594579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b5f5f6125c7611f13565b90505f6125d2611fd5565b8051909150156125ea57805160209091012092915050565b60018201548015612594579392505050565b80511561260b57805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f60208284031215612634575f5ffd5b81356001600160e01b031981168114610619575f5ffd5b8035600a8110612659575f5ffd5b919050565b5f5f6040838503121561266f575f5ffd5b8235915061267f6020840161264b565b90509250929050565b5f5f5f6060848603121561269a575f5ffd5b833592506126aa6020850161264b565b929592945050506040919091013590565b5f602082840312156126cb575f5ffd5b6106198261264b565b5f602082840312156126e4575f5ffd5b5035919050565b80356001600160a01b0381168114612659575f5ffd5b5f5f60408385031215612712575f5ffd5b8235915061267f602084016126eb565b5f5f60408385031215612733575f5ffd5b61273c8361264b565b9150602083013560ff81168114612751575f5ffd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215612781575f5ffd5b61278a836126eb565b915060208301356001600160401b038111156127a4575f5ffd5b8301601f810185136127b4575f5ffd5b80356001600160401b038111156127cd576127cd61275c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156127fb576127fb61275c565b604052818152828201602001871015612812575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b634e487b7160e01b5f52602160045260245ffd5b6004811061285557612855612831565b9052565b6020810161058b8284612845565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e060208201525f6128b360e0830189612867565b82810360408401526128c58189612867565b606084018890526001600160a01b038716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b8181101561291a5783518352602093840193909201916001016128fc565b50909b9a5050505050505050505050565b5f60c0828403121561293b575f5ffd5b50919050565b5f5f5f60e08486031215612953575f5ffd5b61295d858561292b565b925060c08401356001600160401b03811115612977575f5ffd5b8401601f81018613612987575f5ffd5b80356001600160401b0381111561299c575f5ffd5b8660208260051b84010111156129b0575f5ffd5b939660209190910195509293505050565b602081525f6106196020830184612867565b5f5f5f606084860312156129e5575f5ffd5b6129ee846126eb565b92506129fc602085016126eb565b9150612a0a604085016126eb565b90509250925092565b5f60c08284031215612a23575f5ffd5b610619838361292b565b600a811061285557612855612831565b828152604081016106196020830184612a2d565b5f60208284031215612a61575f5ffd5b81356001600160401b0381168114610619575f5ffd5b968752602087019590955260ff93909316604086015260608501919091526001600160401b0390811660808501521660a083015260c082015260e00190565b828152604081016106196020830184612845565b634e487b7160e01b5f52603260045260245ffd5b5f5f8335601e19843603018112612af3575f5ffd5b8301803591506001600160401b03821115612b0c575f5ffd5b602001915036819003821315612b20575f5ffd5b9250929050565b6001600160a01b0391909116815260200190565b83815260608101612b4f6020830185612a2d565b826040830152949350505050565b5f60ff821660ff8103612b7e57634e487b7160e01b5f52601160045260245ffd5b60010192915050565b5f60208284031215612b97575f5ffd5b5051919050565b600181811c90821680612bb257607f821691505b60208210810361293b57634e487b7160e01b5f52602260045260245ffd5b601f821115610c3257805f5260205f20601f840160051c81016020851015612bf55750805b601f840160051c820191505b81811015612c14575f8155600101612c01565b5050505050565b81516001600160401b03811115612c3457612c3461275c565b612c4881612c428454612b9e565b84612bd0565b6020601f821160018114612c7a575f8315612c635750848201515b5f19600385901b1c1916600184901b178455612c14565b5f84815260208120601f198516915b82811015612ca95787850151825560209485019460019092019101612c89565b5084821015612cc657868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041a264697066735822122018ca30f2408b7638dcefdadfc096a933ee927ec5989129721747cefcb6bbbf4e64736f6c634300081e0033","name":"AttestationOracle","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"cancun","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol","source_code":"// 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 \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {ERC165Upgradeable} from \"../utils/introspection/ERC165Upgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl\n    struct AccessControlStorage {\n        mapping(bytes32 role => RoleData) _roles;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControl\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;\n\n    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {\n        assembly {\n            $.slot := AccessControlStorageLocation\n        }\n    }\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    function __AccessControl_init() internal onlyInitializing {\n    }\n\n    function __AccessControl_init_unchained() internal onlyInitializing {\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        AccessControlStorage storage $ = _getAccessControlStorage();\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        AccessControlStorage storage $ = _getAccessControlStorage();\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        AccessControlStorage storage $ = _getAccessControlStorage();\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        AccessControlStorage storage $ = _getAccessControlStorage();\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        AccessControlStorage storage $ = _getAccessControlStorage();\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"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.21;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.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\n        (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            _revert(returndata);\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, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\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, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\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, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\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    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\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 (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\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            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            assembly (\"memory-safe\") {\n                revert(add(returndata, 0x20), mload(returndata))\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Errors.sol","source_code":"// 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Panic.sol","source_code":"// 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol","source_code":"// 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Strings.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.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 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(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(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; 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.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     * 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     * - 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 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     * 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 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 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"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\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 ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    function __Pausable_init() internal onlyInitializing {\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: The upgradeable version of this contract does not use an immutable cache and recomputes the domain separator\n * each time {_domainSeparatorV4} is called. That is cheaper than accessing a cached version in cold storage.\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267 {\n    bytes32 private constant TYPE_HASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.EIP712\n    struct EIP712Storage {\n        /// @custom:oz-renamed-from _HASHED_NAME\n        bytes32 _hashedName;\n        /// @custom:oz-renamed-from _HASHED_VERSION\n        bytes32 _hashedVersion;\n\n        string _name;\n        string _version;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.EIP712\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;\n\n    function _getEIP712Storage() private pure returns (EIP712Storage storage $) {\n        assembly {\n            $.slot := EIP712StorageLocation\n        }\n    }\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     *\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n     * contract upgrade].\n     */\n    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n        __EIP712_init_unchained(name, version);\n    }\n\n    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n        EIP712Storage storage $ = _getEIP712Storage();\n        $._name = name;\n        $._version = version;\n\n        // Reset prior values in storage if upgrading\n        $._hashedName = 0;\n        $._hashedVersion = 0;\n    }\n\n    /**\n     * @dev Returns the domain separator for the current chain.\n     */\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        return _buildDomainSeparator();\n    }\n\n    function _buildDomainSeparator() private view returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n    }\n\n    /// @inheritdoc IERC5267\n    function eip712Domain()\n        public\n        view\n        virtual\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        )\n    {\n        EIP712Storage storage $ = _getEIP712Storage();\n        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized\n        // and the EIP712 domain is not reliable, as it will be missing name and version.\n        require($._hashedName == 0 && $._hashedVersion == 0, \"EIP712: Uninitialized\");\n\n        return (\n            hex\"0f\", // 01111\n            _EIP712Name(),\n            _EIP712Version(),\n            block.chainid,\n            address(this),\n            bytes32(0),\n            new uint256[](0)\n        );\n    }\n\n    /**\n     * @dev The name parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Name() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev The version parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Version() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._version;\n    }\n\n    /**\n     * @dev The hash of the name parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n     */\n    function _EIP712NameHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory name = _EIP712Name();\n        if (bytes(name).length > 0) {\n            return keccak256(bytes(name));\n        } else {\n            // If the name is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.\n            bytes32 hashedName = $._hashedName;\n            if (hashedName != 0) {\n                return hashedName;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n\n    /**\n     * @dev The hash of the version parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n     */\n    function _EIP712VersionHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory version = _EIP712Version();\n        if (bytes(version).length > 0) {\n            return keccak256(bytes(version));\n        } else {\n            // If the version is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.\n            bytes32 hashedVersion = $._hashedVersion;\n            if (hashedVersion != 0) {\n                return hashedVersion;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol","source_code":"// 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 \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165 {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol","source_code":"// 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"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1967.sol)\n\npragma solidity >=0.4.11;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC5267.sol)\n\npragma solidity >=0.4.16;\n\ninterface IERC5267 {\n    /**\n     * @dev MAY be emitted to signal that the domain could have changed.\n     */\n    event EIP712DomainChanged();\n\n    /**\n     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n     * signature.\n     */\n    function eip712Domain()\n        external\n        view\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        );\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing a bytes32 `messageHash` with\n     * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n     * keccak256, although any bytes32 value can be safely used because the final digest will\n     * be re-hashed.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing an arbitrary `message` with\n     * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n        return\n            keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x00` (data with intended validator).\n     *\n     * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n     * `validator` address. Then hashing the result.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n    }\n\n    /**\n     * @dev Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.\n     */\n    function toDataWithIntendedValidatorHash(\n        address validator,\n        bytes32 messageHash\n    ) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, hex\"19_00\")\n            mstore(0x02, shl(96, validator))\n            mstore(0x16, messageHash)\n            digest := keccak256(0x00, 0x36)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            mstore(ptr, hex\"19_01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol","source_code":"// 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.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 `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, 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol","source_code":"// 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"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol","source_code":"// 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"},{"file_path":"src/interfaces/IAttestationOracle.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.30;\n\n/// @title IAttestationOracle\n/// @notice Off-chain → on-chain synchronization layer (ADR-0007). Facilities may not\n///         mint, and material state may not advance, without the required attestations.\n/// @dev TRUST NOTE (state prominently everywhere): the protocol executes faithfully on\n///      whatever authorized attesters assert. A false attestation or compromised\n///      attester key means the protocol acts on false information. This is the\n///      protocol's primary trust assumption (ADR-0007; brief Part 11 gate 6).\ninterface IAttestationOracle {\n    /// @notice Attestation kinds, per ADR-0007 / the legal-wrapper sync table.\n    enum AttestationKind {\n        AssignmentExecuted,\n        UCCFiled,\n        CreditIssued,\n        PaymentReceived,\n        DefaultDeclared,\n        Valuation,\n        LossRealized,\n        PastDueCured,\n        TermsAmended,\n        /// @dev One-shot opening debt for continuous accrual. The payload binds the reserve,\n        ///      migration session, cutoff, facility identity, contractual cursor and balances.\n        AccrualOpening\n    }\n\n    /// @notice Lifecycle of a single ECONOMIC FACT, keyed by (facilityId, kind, payload).\n    /// @dev AUDIT FIX (C4-01/C4-02). This enum exists because the EIP-712 DIGEST is the wrong\n    ///      uniqueness key: `nonce`, `asOf` and `expiry` are all inside the digest but outside the\n    ///      fact, so the SAME real-world event re-signed under a fresh nonce produced a fresh\n    ///      digest and sailed past `used[digest]`. The fact key is digest-independent, so a fact\n    ///      leaves `None` exactly once and never returns to it. See `attest`.\n    /// @custom:member None Never recorded — the only state from which `attest` accepts the fact.\n    /// @custom:member Recorded Accepted and standing; the credit layer has not spent it yet.\n    /// @custom:member Consumed Spent by a CREDIT_ROLE module (the write-down/distribution ran).\n    /// @custom:member Revoked Governance killed it (C4-02: a DURABLE tombstone, not just a flag).\n    enum FactStatus {\n        None,\n        Recorded,\n        Consumed,\n        Revoked\n    }\n\n    /// @notice One attested fact, signed by m-of-n authorized attesters over EIP-712.\n    /// @param facilityId The facility.\n    /// @param kind The attestation kind.\n    /// @param payload Kind-specific commitment. Valuation stores the 18-decimal value\n    ///        directly; operational facts commit to their complete action parameters\n    ///        (terms, payment id/payer/amounts/due date, evidence hash, or amendment id).\n    /// @param asOf The ATTESTED observation time (inside the signed payload — not the\n    ///        submission block time; freshness rules depend on this, ADR-0017 §4).\n    /// @param expiry Submission deadline for this signed bundle.\n    /// @param nonce Uniqueness salt (any unused value; digests are consume-once).\n    struct AttestationInput {\n        uint256 facilityId;\n        AttestationKind kind;\n        bytes32 payload;\n        uint64 asOf;\n        uint64 expiry;\n        uint256 nonce;\n    }\n\n    // ── Events ───────────────────────────────────────────────────────────\n    /// @notice Emitted once per recovered signer of an accepted attestation.\n    event Attested(uint256 indexed facilityId, AttestationKind indexed kind, address indexed attester, uint64 at);\n    /// @notice The fact is now on-chain truth (threshold met).\n    event AttestationSatisfied(uint256 indexed facilityId, AttestationKind indexed kind, bytes32 payload, uint64 asOf);\n    /// @notice A one-shot fact was consumed by the credit layer (e.g. a\n    ///         PaymentReceived spent by its distribution).\n    event AttestationConsumed(uint256 indexed facilityId, AttestationKind indexed kind, address indexed by);\n    /// @notice Governance revoked a fact (e.g. discovered-false attestation).\n    event AttestationRevoked(uint256 indexed facilityId, AttestationKind indexed kind);\n    event ThresholdSet(AttestationKind indexed kind, uint8 threshold);\n    // NOTE: `ValuationWatermarkReset` and the `resetValuationWatermark` lever were REMOVED\n    // (owner decision 2026-07-22). The H-02 anti-rollback watermark itself is unchanged; a stuck\n    // watermark is recovered via the oracle's timelocked UUPS upgrade, not a dedicated lever.\n\n    // ── Errors ───────────────────────────────────────────────────────────\n    error Oracle_Expired(uint64 expiry);\n    error Oracle_BadAsOf(uint64 asOf);\n    error Oracle_DigestAlreadyUsed(bytes32 digest);\n    error Oracle_ThresholdNotMet(uint8 required, uint256 provided);\n    error Oracle_NotAttester(address recovered);\n    error Oracle_UnorderedSigners(address prev, address current);\n    error Oracle_ZeroValuation();\n    error Oracle_StaleValuation(uint64 asOf, uint64 existing);\n    error Oracle_NotSatisfied(uint256 facilityId, AttestationKind kind);\n    /// @notice Process or revoke the current action before submitting another of the same kind.\n    error Oracle_UnconsumedFact(uint256 facilityId, AttestationKind kind, bytes32 payload);\n    error Oracle_BadThreshold();\n    /// @notice AUDIT FIX (C4-01/C4-02): this economic fact has already left `None`. It was\n    ///         recorded, spent, or revoked, and no re-signing under a fresh nonce brings it back.\n    /// @param factKey keccak256(abi.encode(facilityId, uint8(kind), payload)) — see `factKey`.\n    /// @param status The terminal-for-`attest` state the fact is already in.\n    error Oracle_FactAlreadyRealised(bytes32 factKey, FactStatus status);\n\n    // ── Submission (permissionless relay of attester signatures) ─────────\n    /// @notice Records `a` as on-chain truth if at least the kind's threshold of\n    ///         DISTINCT authorized attesters signed exactly this struct (EIP-712).\n    ///         Anyone may relay the bundle; the signatures are the authority.\n    function attest(AttestationInput calldata a, bytes[] calldata signatures) external;\n\n    // ── Credit-layer consumption ─────────────────────────────────────────\n    /// @notice Clears the satisfied flag of a one-shot fact (payload/asOf retained\n    ///         for audit). Only a wired CREDIT_ROLE module may consume a fact.\n    function consume(uint256 facilityId, AttestationKind kind) external;\n\n    // ── Governance ───────────────────────────────────────────────────────\n    /// @notice Revokes a fact (clears satisfied; a revoked Valuation is zeroed so the\n    ///         margin path blocks until a fresh mark). Timelocked governance only.\n    function revoke(uint256 facilityId, AttestationKind kind) external;\n\n    // NOTE (owner decision 2026-07-22): the `resetValuationWatermark` recovery lever was REMOVED.\n    // The H-02 anti-rollback watermark itself is unchanged. Rationale: the lever was also an\n    // attack surface -- governance goes through a PUBLIC timelock queue, so a queued reset let a\n    // holder of a pre-signed OLDER valuation race the watermark down the instant it executed,\n    // re-opening the rollback the watermark prevents. The rare \"watermark stuck at a far-future\n    // asOf after an attester-quorum compromise\" recovery is instead handled by the oracle's\n    // timelocked UUPS upgrade (redundant with the lever, without the race surface). This\n    // supersedes the 2026-07-21 decision to keep it.\n\n    /// @notice Sets a kind's m-of-n threshold (>= 1). Timelocked governance only.\n    function setThreshold(AttestationKind kind, uint8 threshold_) external;\n\n    // ── Views ────────────────────────────────────────────────────────────\n    /// @notice True if `facilityId` has a currently valid attestation of `kind`.\n    function isSatisfied(uint256 facilityId, AttestationKind kind) external view returns (bool);\n\n    /// @notice Latest attested valuation mark for a facility (conservative, haircut).\n    /// @return value 18-dec USD mark (0 = no valid mark).\n    /// @return asOf Attested observation time of the mark (staleness checks per\n    ///         ADR-0015 for marked-to-market classes).\n    function latestValuation(uint256 facilityId) external view returns (uint256 value, uint64 asOf);\n\n    /// @notice Latest recorded fact for (facility, kind).\n    function latestPayload(uint256 facilityId, AttestationKind kind)\n        external\n        view\n        returns (bytes32 payload, uint64 asOf, bool satisfied);\n\n    /// @notice The facility's valuation anti-rollback high-watermark: the highest attested\n    ///         `asOf` ever ACCEPTED for this facility, preserved across `revoke` and `consume`.\n    ///         A new `Valuation` must beat it strictly.\n    /// @param facilityId The facility identifier.\n    /// @return highestAsOf Highest accepted observation time (0 = never marked).\n    function valuationWatermark(uint256 facilityId) external view returns (uint64 highestAsOf);\n\n    /// @notice Current m-of-n threshold for a kind.\n    function threshold(AttestationKind kind) external view returns (uint8);\n\n    /// @notice True if an attestation digest was already submitted (replay guard).\n    /// @dev NOT a fact-uniqueness guard — it is defeated by re-signing the same fact under a\n    ///      fresh nonce. Read `factStatus` for \"has this real-world event already been realised\".\n    function digestUsed(bytes32 digest) external view returns (bool);\n\n    /// @notice The consume-once key for an economic fact: the (facility, kind, payload) triple,\n    ///         with the digest's replay salt (`nonce`/`asOf`/`expiry`) DELIBERATELY excluded.\n    /// @dev AUDIT FIX (C4-01). Exposed so relayers and attester tooling can check whether a fact\n    ///      is already spent before paying for signatures.\n    /// @param facilityId The facility the fact concerns.\n    /// @param kind The attestation kind.\n    /// @param payload The kind-specific commitment identifying the real-world event.\n    /// @return key keccak256(abi.encode(facilityId, uint8(kind), payload)).\n    function factKey(uint256 facilityId, AttestationKind kind, bytes32 payload) external pure returns (bytes32 key);\n\n    /// @notice Lifecycle state of one economic fact (C4-01/C4-02). `None` is the only state from\n    ///         which `attest` accepts it; the transition out of `None` is irreversible.\n    /// @dev Always `None` for `Valuation`: a valuation is a monotone OBSERVATION SERIES, not a\n    ///      one-shot event, and its uniqueness key is `valuationWatermark`, not the payload. Two\n    ///      genuinely distinct marks may legitimately carry the identical value.\n    /// @param facilityId The facility the fact concerns.\n    /// @param kind The attestation kind.\n    /// @param payload The kind-specific commitment identifying the real-world event.\n    /// @return status `None` if never realised; otherwise `Recorded`, `Consumed` or `Revoked`.\n    function factStatus(uint256 facilityId, AttestationKind kind, bytes32 payload)\n        external\n        view\n        returns (FactStatus status);\n\n    /// @notice The EIP-712 digest attesters sign for `a`.\n    /// @dev Exposed for signing tools, atomic executors, and replay-safe relayers.\n    function attestationDigest(AttestationInput calldata a) external view returns (bytes32);\n}\n"},{"file_path":"src/libraries/Roles.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.30;\n\n// GENERATED by tools/generate-privilege-topology.mjs from config/privilege-topology.json.\n// Do not edit this file directly; the compiler-AST topology gate rejects drift.\n\n/// @title Roles\n/// @notice Canonical role identifiers for the protocol's access-control matrix.\n/// @dev DEFAULT_ADMIN_ROLE is inherited from AccessControl and represented by bytes32(0).\nlibrary Roles {\n    // NOTE: A QUEUE_ROLE existed through Phase H but was never consumed. The vault gates its exit by the configured redemption-queue address, which is the stronger check; it was removed at Phase I cleanup.\n\n    /// @notice May authorize UUPS upgrades. Held only by the governance timelock.\n    bytes32 internal constant UPGRADER_ROLE = keccak256(\"UPGRADER_ROLE\");\n\n    /// @notice Emergency pause/unpause on value-moving paths. Cannot upgrade or move value.\n    bytes32 internal constant GUARDIAN_ROLE = keccak256(\"GUARDIAN_ROLE\");\n\n    /// @notice May mint USDfr. Held only by the MintRedeemController.\n    bytes32 internal constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n    /// @notice Reserve custody operations (deposit/release). Held only by the MintRedeemController.\n    bytes32 internal constant CONTROLLER_ROLE = keccak256(\"CONTROLLER_ROLE\");\n\n    /// @notice Principal deployment, atomic payment receipt, and writedown. Held by credit modules.\n    bytes32 internal constant CREDIT_ROLE = keccak256(\"CREDIT_ROLE\");\n\n    /// @notice May burn USDfr to realize an authenticated loss. Held only by DefaultManager and ReserveManager.\n    /// @dev AUDIT R16-M1: burnLoss is deliberately split from CREDIT_ROLE so the repayment engine cannot compose mint and burn authority.\n    bytes32 internal constant LOSS_BURNER_ROLE = keccak256(\"LOSS_BURNER_ROLE\");\n\n    /// @notice May bracket a junior-capacity change so the vault preserves its asset-denominated performance-fee hurdle. Held only by the curator, sGROVE, and DefaultManager modules.\n    bytes32 internal constant FEE_ACCOUNTING_ROLE = keccak256(\"FEE_ACCOUNTING_ROLE\");\n\n    /// @notice Manages KYC allowlist and jurisdiction blocklist entries.\n    bytes32 internal constant COMPLIANCE_ADMIN_ROLE = keccak256(\"COMPLIANCE_ADMIN_ROLE\");\n\n    /// @notice Reserve configuration and conservative USDC custody write-downs.\n    bytes32 internal constant RESERVE_ADMIN_ROLE = keccak256(\"RESERVE_ADMIN_ROLE\");\n\n    /// @notice May originate facilities (Phase D).\n    bytes32 internal constant ORIGINATOR_ROLE = keccak256(\"ORIGINATOR_ROLE\");\n\n    /// @notice Authorized attesters (Phase G, ADR-0007).\n    bytes32 internal constant ATTESTER_ROLE = keccak256(\"ATTESTER_ROLE\");\n\n    /// @notice Servicing operations: facility funding, repayment distribution, default declaration, and loss realization. Held by Forest Road servicing keys until Phase G binds these paths to attested facts; the role then gates who may execute an already-attested action, not what is true.\n    bytes32 internal constant SERVICER_ROLE = keccak256(\"SERVICER_ROLE\");\n\n    /// @notice Drives RedemptionQueue.closeEpoch. Operational, not governance or upgrade authority: it initiates a financially effective settlement and controls when its budget is sampled, but cannot choose recipients, reorder FIFO, set parameters, or exceed the contract-enforced budget and pricing rules.\n    /// @dev AUDIT FIX D7-01: closeEpoch samples the epoch liquidity budget as a spot read and the fill loop re-reads it every chunk. While permissionless, a caller could hold flash liquidity across both reads; measured excess budget was $1.62M from Morpho alone and $4.31M from stacked Aave and Morpho borrowing. A flash loan cannot span two transactions, so the keeper gate closes the vector at its root. This supersedes ADR-0018 section 2's permissionless-settlement design. Grant the role to at least two holders: a hot keeper and a manual ops-multisig backstop. A total keeper outage is bounded only by governance regranting the role. A permissionless grace fallback was rejected because it would restore the flash vector whenever the keeper missed the window.\n    bytes32 internal constant SETTLEMENT_KEEPER_ROLE = keccak256(\"SETTLEMENT_KEEPER_ROLE\");\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"uint64","name":"asOf","type":"uint64"}],"name":"Oracle_BadAsOf","type":"error"},{"inputs":[],"name":"Oracle_BadThreshold","type":"error"},{"inputs":[{"internalType":"bytes32","name":"digest","type":"bytes32"}],"name":"Oracle_DigestAlreadyUsed","type":"error"},{"inputs":[{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"Oracle_Expired","type":"error"},{"inputs":[{"internalType":"bytes32","name":"factKey","type":"bytes32"},{"internalType":"enum IAttestationOracle.FactStatus","name":"status","type":"uint8"}],"name":"Oracle_FactAlreadyRealised","type":"error"},{"inputs":[{"internalType":"address","name":"recovered","type":"address"}],"name":"Oracle_NotAttester","type":"error"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"Oracle_NotSatisfied","type":"error"},{"inputs":[{"internalType":"uint64","name":"asOf","type":"uint64"},{"internalType":"uint64","name":"existing","type":"uint64"}],"name":"Oracle_StaleValuation","type":"error"},{"inputs":[{"internalType":"uint8","name":"required","type":"uint8"},{"internalType":"uint256","name":"provided","type":"uint256"}],"name":"Oracle_ThresholdNotMet","type":"error"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"internalType":"bytes32","name":"payload","type":"bytes32"}],"name":"Oracle_UnconsumedFact","type":"error"},{"inputs":[{"internalType":"address","name":"prev","type":"address"},{"internalType":"address","name":"current","type":"address"}],"name":"Oracle_UnorderedSigners","type":"error"},{"inputs":[],"name":"Oracle_ZeroAddress","type":"error"},{"inputs":[],"name":"Oracle_ZeroValuation","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"facilityId","type":"uint256"},{"indexed":true,"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"indexed":true,"internalType":"address","name":"by","type":"address"}],"name":"AttestationConsumed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"facilityId","type":"uint256"},{"indexed":true,"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"AttestationRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"facilityId","type":"uint256"},{"indexed":true,"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"payload","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"asOf","type":"uint64"}],"name":"AttestationSatisfied","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"facilityId","type":"uint256"},{"indexed":true,"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"indexed":true,"internalType":"address","name":"attester","type":"address"},{"indexed":false,"internalType":"uint64","name":"at","type":"uint64"}],"name":"Attested","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"threshold","type":"uint8"}],"name":"ThresholdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"internalType":"bytes32","name":"payload","type":"bytes32"},{"internalType":"uint64","name":"asOf","type":"uint64"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct IAttestationOracle.AttestationInput","name":"a","type":"tuple"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"attest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"internalType":"bytes32","name":"payload","type":"bytes32"},{"internalType":"uint64","name":"asOf","type":"uint64"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct IAttestationOracle.AttestationInput","name":"a","type":"tuple"}],"name":"attestationDigest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"consume","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"digest","type":"bytes32"}],"name":"digestUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"internalType":"bytes32","name":"payload","type":"bytes32"}],"name":"factKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"internalType":"bytes32","name":"payload","type":"bytes32"}],"name":"factStatus","outputs":[{"internalType":"enum IAttestationOracle.FactStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"guardian","type":"address"},{"internalType":"address","name":"upgrader","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"isSatisfied","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"latestPayload","outputs":[{"internalType":"bytes32","name":"payload","type":"bytes32"},{"internalType":"uint64","name":"asOf","type":"uint64"},{"internalType":"bool","name":"satisfied","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"}],"name":"latestValuation","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint64","name":"asOf","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"},{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"revoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"},{"internalType":"uint8","name":"threshold_","type":"uint8"}],"name":"setThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum IAttestationOracle.AttestationKind","name":"kind","type":"uint8"}],"name":"threshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"facilityId","type":"uint256"}],"name":"valuationWatermark","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}