Skip to content
We manage your security to weather the AI storm →

Security review · October 2026

JPYdf for DeltaForesight

Guardian's review of JPYdf for DeltaForesight, published October 2026. The report records 21 findings across 2 review rounds, including 12 low and 9 informational.

See how Guardian runs a smart contract audit.

Published
Review window
September 3 to October 8, 2026
Rounds
Main Review, Remediation Review
Language
Solidity, Python
  • 0 Critical
  • 0 High
  • 0 Medium
  • 12 Low
  • 9 Informational

17 resolved · 4 acknowledged

Scope

25 files in scope · 535 nSLOC
FilenSLOCLines
source-snapshot/contracts/src/AddressesRegistry.sol148273
source-snapshot/contracts/src/BorrowerOperations.sol331474
source-snapshot/contracts/src/CollateralVault.sol291117
source-snapshot/contracts/src/Dependencies/Constants.sol1132
source-snapshot/contracts/src/DFStabilityPool.sol3622
source-snapshot/contracts/src/Interfaces/IAddressesRegistry.sol1755
source-snapshot/contracts/src/Interfaces/IBorrowerOperations.sol337
source-snapshot/contracts/src/Interfaces/IJpyUsdRateProvider.sol16
source-snapshot/contracts/src/Interfaces/IPriceFeed.sol16
source-snapshot/contracts/src/Interfaces/IPriceFeedProxy.sol765
source-snapshot/contracts/src/Interfaces/IStabilityPool.sol134
source-snapshot/contracts/src/Interfaces/ITroveManager.sol733
source-snapshot/contracts/src/PriceFeeds/CompositePriceFeed.sol561
source-snapshot/contracts/src/PriceFeeds/DFPriceFeedBase.sol8158
source-snapshot/contracts/src/PriceFeeds/DFWstETHPriceFeed.sol61211
source-snapshot/contracts/src/PriceFeeds/JpyFreezeLib.sol2107
source-snapshot/contracts/src/PriceFeeds/JpyUsdRateProvider.sol9162
source-snapshot/contracts/src/PriceFeeds/MainnetPriceFeedBase.sol6134
source-snapshot/contracts/src/PriceFeeds/PriceFeedPlaceholder.sol970
source-snapshot/contracts/src/PriceFeeds/PriceFeedProxy.sol101512
source-snapshot/contracts/src/RedemptionHelper.sol19178
source-snapshot/contracts/src/StabilityPool.sol3603
source-snapshot/contracts/src/TroveManager.sol291866
source-snapshot/contracts/src/Zappers/archive/SkyUsdcSUsdsYieldZapper.sol12213
source-snapshot/contracts/src/Zappers/CollateralYieldZapper.sol20549

Findings 21

Main Review

19 findings · September 3 to 16, 2026
  1. L-01 Low Cap opening can block risk finalization DoS Resolved
    Location
    source-snapshot/contracts/src/DToken.sol:353-361; source-snapshot/contracts/src/CollateralVault.sol:253-270
    Round
    Main Review

    Description

    Reserved branches must finalize their risk parameters before borrowing and Stability Pool deposits become available. AddressesRegistry.finalizeRiskParams requires both the dToken mint cap and total supply to remain zero.

    uint256 dTokenCap = dToken.cap();
    if (dTokenCap != 0) revert DTokenCapNotZero(dTokenCap);
    uint256 dTokenSupply = dToken.totalSupply();
    if (dTokenSupply != 0) revert DTokenSupplyNotZero(dTokenSupply);
    

    However, the owner can increase the cap through DToken.setCap without checking whether risk parameters have been finalized. Once the underlying is bound and other deposit requirements are satisfied, CollateralVault.deposit can mint dTokens without checking finalization.

    Consequently, if the owner mistakenly opens the cap before risk parameters are finalized, deposits can introduce dToken supply that blocks finalization. Although the owner can restore the cap to zero, finalization will continue reverting until all existing dTokens are burned. A malicious depositor can refuse to redeem or transfer the tokens to an unspendable address, permanently preventing branch activation and forcing a redeployment.

    Recommendation

    Consider requiring finalized risk parameters before permitting a nonzero cap or Vault deposits.

    Resolution

    DeltaForesight Team: We changed DToken to start with a zero mint cap and require a one-time binding to the matching AddressesRegistry while cap and supply are zero. Positive caps and minting now require finalized branch risk parameters. This prevents cap opening from blocking reserved-branch finalization while retaining the zero-supply finalization guards. Setting the cap to zero and burning remain available. Deployment wiring and regression tests cover the real branch lifecycle. An existing token with nonzero supply requires a separately reviewed migration; this change is not a production-upgrade claim.

  2. L-02 Low Sky harvest can return principal as yield OOS - Business logic errors Resolved
    Location
    https://github.com/GuardianOrg/mirror-deltaforesight-jpydf-audit-01a06231/blob/d59437beed41da49ff53c6796d2e3a09337af046/source-snapshot/contracts/src/Strategies/BaseStrategy.sol#L367-L383 https://github.com/GuardianOrg/mirror-deltaforesight-jpydf-audit-01a06231/blob/d59437beed41da49ff53c6796d2e3a09337af046/source-snapshot/contracts/src/Strategies/SkyUsdcSUsdsStrategy.sol#L380-L389
    Round
    Main Review

    Description

    In BaseStrategy, sendProfitToVault calculates available yield as the strategy’s estimated underlying value minus its recorded principal. It withdraws that amount and forwards the entire actual return to the Vault, deliberately leaving _principal unchanged.

            uint256 withdrawnUnderlying = _doWithdraw(realizedProfit);
            if (withdrawnUnderlying == 0) {
                emit ProfitSentToVault(msg.sender, realizedProfit, 0);
                return 0;
            }
    
            // Yield-only push: `_principal` is intentionally left unchanged. Send
            // directly to the Vault buffer so Strategy valuation cache is not
            // reduced as if principal had been returned.
            sent = _sendUnderlyingYieldToVault(withdrawnUnderlying);
    

    However, SkyUsdcSUsdsStrategy._doWithdraw can return more than requested. When converting the equivalent USDS amount would produce insufficient USDC, _usdsTargetForUsdc increases the input budget using maxConversionLossBps. The converter then purchases the maximum USDC supported by this inflated budget at the actual conversion fee, without limiting output to the requested withdrawal amount.

    If the actual conversion fee is positive and lower than the configured allowance, the returned amount can exceed the available yield. The excess comes from principal and is transferred to the Vault, but _principal remains unchanged. The strategy therefore records more principal than it actually holds.

    Future earnings must cover this accounting gap before becoming harvestable through sendProfitToVault. Even after all remaining assets are withdrawn, the strategy can retain nonzero recorded principal, blocking its removal until that residual principal is cleared.

    Recommendation

    Ensure Sky converts only enough USDS to obtain the requested USDC amount, and prevent yield-only transfers from exceeding the calculated yield.

    Resolution

    DeltaForesight Team: We separated measured harvest yield from excess underlying returned by a Strategy withdrawal. Any amount above the measured yield is now accounted for as returned principal and retained in the Vault buffer, rather than being sent to the treasury as yield. This preserves principal accounting if the external conversion returns more than requested. The excess is temporarily deallocated until a subsequent allocation. Tests cover excess receipt, principal accounting and final drain. A post-harvest valuation refresh should occur after the Strategy's accounting settles before relying on an outage cache.

  3. L-03 Low MCR Validation Omits Gas Compensation, Reducing SP Rewards For dJPY And dJGB Validation Resolved
    Location
    source-snapshot/contracts/src/AddressesRegistry.sol:244; source-snapshot/contracts/src/Dependencies/Constants.sol:73; source-snapshot/contracts/src/Dependencies/Constants.sol:81
    Round
    Main Review

    Description

    AddressesRegistry._requireFinalizedRiskParams checks that MCR covers 100% + liquidationPenaltySP when finalizing a branch’s risk parameters. However, TroveManager deducts liquidator collateral compensation before allocating collateral to the Stability Pool. This finalization gate therefore does not ensure sufficient collateral for the full configured SP premium near MCR.

    This affects the dJPY and dJGB parameter sets, which specify a 105.30% MCR and a 5% SP penalty. These values pass the check, but a liquidation just below MCR leaves approximately 105.30% × 99.5% = 104.7735% of offset debt value for the SP after collateral compensation. Depositors consequently receive approximately a 4.7735% premium instead of 5%, even before further price deterioration.

    Covering both payments requires an MCR of at least approximately 105.52764%. The other branch parameter sets exceed this threshold. dJPY and dJGB are currently documented as inert branches, so this concern applies if they are activated with these values.

    Recommendation

    Consider replacing the existing MCR-versus-SP-penalty check in AddressesRegistry._requireFinalizedRiskParams with the following. The replacement makes the old check redundant.

    if (_mcr * (COLL_GAS_COMPENSATION_DIVISOR - 1) < (1e18 + _liquidationPenaltySP) * COLL_GAS_COMPENSATION_DIVISOR) revert MCRBelowSPPenalty();
    

    Increase MCR_DJPY and MCR_DJGB from 105.30% to at least 105.53% to satisfy the revised check.

    Resolution

    DeltaForesight Team: We updated risk validation to account for the liquidator's collateral gas compensation when checking Stability Pool coverage. The required inequality now includes the 0.5% collateral deduction as well as the configured SP liquidation penalty. The inactive dJPY and dJGB candidate MCR values are 105.53% in both Day-1 manifests. Tests cover the exact acceptance boundary, one unit below it, reserved-branch finalization and deployment validation.

  4. L-04 Low Bridge Burns Increase Redemption Fees OOS - Business logic errors Acknowledged
    Location
    source-snapshot/contracts/src/CollateralRegistry.sol:138; source-snapshot/contracts/src/CollateralRegistry.sol:212; source-snapshot/contracts/src/JpydfToken.sol:219
    Round
    Main Review

    Description

    CollateralRegistry._getUpdatedBaseRateFromRedemption calculates the base-rate increment using the redeemed amount divided by JpydfToken.totalSupply(). In the original BOLD implementation, there is no bridge burn path that reduces this denominator while leaving the corresponding Trove debt outstanding.

    JPYdf introduces bridgeBurn, which reduces total supply without repaying Trove debt. Bridging out from mainnet through a burn/mint bridge therefore reduces the redemption fee denominator while the corresponding debt remains outstanding.

    Consequently, the same redemption produces a larger base-rate increment as more supply is bridged out. For example, bridging out 50% of total supply doubles the increment, assuming the fee cap does not bind. This increases redemption costs and can discourage redemptions that would otherwise help restore the peg.

    The effect applies to burn/mint bridging after activation. The documented launch configuration has zero bridge minters, and lock/unlock bridging does not cause this denominator reduction.

    Recommendation

    Document this behavior and consider using lock/unlock bridging. If burn/mint bridging is retained, consider replacing totalSupply() in the redemption fee calculation with a function that calculates total outstanding debt across all branches, consistently accounting for accrued interest.

    Resolution

    DeltaForesight Team: We acknowledge that burn/mint bridging reduces the local supply-based redemption denominator without repaying branch debt, which can increase redemption fees. No token or fee-formula change is proposed for the current single-chain launch. The launch specification and deployment guards require zero registered and proposed bridge minters; this is a launch condition, not a statement about a production deployment. Any later burn/mint activation must revisit the denominator and accrued-debt treatment as part of the mandatory bridge activation review. A lock/unlock design avoids this specific supply-reduction effect.

    Follow-up verification (2026-09-17): the current upstream CCIP proposal is https://github.com/deltaforesight/jpydf-v2/pull/2109 at head c4c54fc565c20dfbae30423873dd89c25b5f69e0. Ethereum uses JpydfLockReleasePool and the standard CCIP 2.0.0 ERC20LockBox (token transfers); remote chains mint/burn a separate token. Canonical JPYdf remains in Ethereum totalSupply while escrowed, so this direction avoids the specific L-06 denominator shrink. The existing canonical bridgeBurn interface is unchanged and must remain separately gated. This finding-specific conclusion is not a full bridge security or activation approval.

    Verification evidence and focused tests: https://github.com/deltaforesight/jpydf-audit/pull/128 (evidence follow-up; no production code fix).

  5. L-05 Low Shared Compensation Cap Allows Excessive Liquidator Rewards For dwstETH OOS - Configuration Resolved
    Location
    source-snapshot/contracts/src/Dependencies/Constants.sol:90; source-snapshot/contracts/src/TroveManager.sol:358
    Round
    Main Review

    Description

    TroveManager pays liquidators 0.5% of the collateral assigned to the Stability Pool offset, subject to COLL_GAS_COMPENSATION_CAP. This cap places an absolute limit on the collateral paid as gas compensation per liquidation, preventing the reward from continuing to grow proportionally with position size.

    The cap was increased from the original Liquity Bold limit of 2 collateral tokens to 1,000 to accommodate dUSDC. However, this shared constant also raises the dwstETH cap despite its much higher value per token.

    For dwstETH, the cap only takes effect when the SP collateral portion reaches 200,000 dwstETH, providing little practical restriction on large-position payouts beyond the 0.5% rate.

    For example, a liquidation assigning 1,000 dwstETH to the SP would pay 5 dwstETH instead of Liquity Bold’s maximum of 2 collateral tokens. The additional 3 dwstETH reduces collateral available to SP depositors and/or the remaining collateral claimable by the borrower.

    Recommendation

    Consider configuring a separate compensation cap for each branch, calibrated to each collateral’s value.

    Resolution

    DeltaForesight Team: We replaced the shared liquidation-compensation cap with a branch-specific cap. The remediation candidate uses 2 dwstETH and 1,000 dUSDC. For inactive reserved branches, the cap is finalized once together with MCR and the other risk parameters before economic activity, rather than permanently fixing an unknown collateral's cap at initial deployment. Finalization validates the cap and synchronizes the TroveManager value; it cannot be changed after finalization. Tests cover the cap calculation, partial offsets, initialization and finalization. The selected monetary values remain launch parameter candidates, not a production-deployment or final economic-approval claim.

  6. L-06 Low Written-Off Strategies Can Remain Registered Indefinitely OOS - Business logic errors Acknowledged
    Location
    source-snapshot/contracts/src/CollateralVault.sol:657-663; source-snapshot/contracts/src/Strategies/BaseStrategy.sol:387-396
    Round
    Main Review

    Description

    CollateralVault.removeStrategy requires both principal and estimated assets to be readable and zero. However, writeoffStrategyPrincipal only reduces principal. It does not clear tracked shares or change the upstream valuation.

    For example, Morpho Vault V1.1 calculates reported assets as realTotalAssets + newLostAssets, adding recorded losses back into its accounting value instead of reducing the share price. An ERC4626Strategy holding its shares can therefore report nonzero assets even if they are unrecoverable due to bad debt.

    This also applies to a MorphoV2Strategy whose upstream V2 vault allocates into a V1.1 vault through an adapter that uses the V1.1 share valuation.

    Writing off the strategy’s remaining principal still leaves removeStrategy reverting on its nonzero asset estimate. Until the residual position can be cleared, the strategy occupies one of the vault’s 32 strategy slots and remains in every valuation sweep.

    Recommendation

    Add an explicit, privileged removal path for fully written-off strategies with unrecoverable positions, allowing deregistration without requiring a zero upstream valuation. Document this path as a final abandonment of the position, to be used only after recovery has been ruled out.

    Resolution

    DeltaForesight Team: We acknowledge both occupied strategy slots and the availability risk of a retained Strategy whose valuation becomes unreadable. We defer a new removal authority for the current launch and keep affected Strategies disabled while preserving recovery paths. Removal itself does not destroy venue shares, and GOV can re-register a still-whitelisted Strategy with zero allocation weight.

    A failed live valuation can stop allocation and treasury sweeps even after principal is written off, and can leave pricing unavailable when known assets do not cover liabilities. Full writeoff plus cache invalidation can expose this immediately. Recovery or a separately reviewed Strategy upgrade may be needed. Further registration and re-enabling a written-off Strategy require capacity, valuation and recovery review. No code fix, implemented sunset upgrade, or verified production alert delivery is claimed.

    This acknowledgement is not launch-readiness approval. Before relying on this deferral for an active Strategy, the launch review must cover remaining slot capacity, unreadable valuation as a branch-level incident, a reviewed recovery/escalation procedure, and external alert delivery to the responsible operators. Disabling allocation alone does not remove the valuation dependency. These operational gates remain open wherever supporting evidence is missing.

    Follow-up verification (2026-09-17): four existing regressions pass for allocation stopping on unreadable valuation, removal remaining blocked with zero principal and unavailable valuation, writeoff not restoring pricing, and treasury transfer recovery after valuation recovers. The incident runbook contains preflight, escalation and recovery-probe requirements. Fresh read-only AWS inspection found the production private-monitor schedule DISABLED, no replacement PrivateMonitor ECS service in that stack, and P0 still including the staging Slack topic. Thus the production monitoring/delivery gate is not ready; this is more specific than merely missing evidence. Deployment/routing and an actual valuation-incident delivery/recovery drill remain required (upstream https://github.com/deltaforesight/jpydf-v2/issues/2030). No infrastructure change or notification was sent; no sunset upgrade is claimed.

    Verification evidence and focused tests: https://github.com/deltaforesight/jpydf-audit/pull/128 (evidence follow-up; no production code fix).

  7. L-07 Low Morpho Emergency Recovery Can Incur A Penalty Without Recovering Funds OOS - MEV Resolved
    Location
    source-snapshot/contracts/src/CollateralVault.sol:709; source-snapshot/contracts/src/Strategies/MorphoV2Strategy.sol:351; source-snapshot/contracts/src/Strategies/MorphoV2Strategy.sol:295; source-snapshot/contracts/script/PrepareDFGovernanceHandover.s.sol:328
    Round
    Main Review

    Description

    When the Morpho Vault V2’s normal withdrawal route lacks liquidity but another adapter can release assets, recovery requires separate deallocation and withdrawal calls. CollateralVault.forceDeallocateMorphoV2 releases liquidity while charging a penalty against the Strategy’s Morpho shares. A subsequent emergencyWithdrawFromMorphoV2 or sendToVault call retrieves the funds.

    Morpho’s forceDeallocate places the released assets in the vault’s shared idle balance, without reserving them for the Strategy. Another eligible shareholder can withdraw this liquidity before the Strategy’s recovery call, without paying the deallocation penalty.

    forceDeallocateMorphoV2 requires WRITEOFF_ROLE, while recovery requires either the Strategy owner through emergencyWithdrawFromMorphoV2 or ALLOCATOR_ROLE through sendToVault. The governance handover script requires the Strategy owner to be the Guardian and enforces distinct Guardian, Allocator, and Writeoff addresses. Under this role separation, a single role holder cannot atomically batch deallocation and recovery on its own.

    The recovery path provides no combined entry point that makes deallocation conditional on successful withdrawal. Consequently, the subsequent recovery can fail while the penalty share burn remains committed, leaving the Strategy with fewer shares without recovering the intended funds.

    Recommendation

    Consider adding a function that deallocates assets and withdraws them to CollateralVault in the same transaction, reverting if the minimum required recovery amount is not received.

    Resolution

    DeltaForesight Team: We made Morpho force-deallocation and recovery to CollateralVault atomic under WRITEOFF_ROLE. The incident call requires a positive minimum receipt, measures the Vault's actual underlying-token balance increase, and reverts the entire transaction if recovery does not meet that minimum. Penalty burns, share/principal/cache accounting and pause changes therefore roll back with a failed recovery. No separate role holder or later transaction is needed to secure the released liquidity. Tests cover failure rollback, separated roles, receipt mismatches, cache accounting and both reentrancy guards. Existing deployments require paired Vault/Strategy upgrades in one reviewed batch and updated calldata; no production upgrade has been performed.

  8. L-08 Low Nonzero Strategy valuation failure pauses a fully backed branch OOS - denial-of-service Resolved
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/CollateralVault.sol:_totalUnderlyingWithAvailability():L834-L843
    Round
    Main Review

    Description

    CollateralVault propagates any registered Strategy valuation failure as global backing unavailability before checking whether already-known raw assets independently cover all liabilities. This remains true for a live Strategy with nonzero tracked principal. DF price feeds convert the unavailable backing result into source failure, and PriceFeedProxy latches the recoverable oracle pause.

    Impact: After the bounded valuation cache expires, failure of a live Strategy's read-only valuation endpoints can pause borrowing, risk-increasing operations, and normal redemption even though raw Vault custody alone fully backs every dToken and queued claim. The pause persists until the dependency or privileged incident handling restores valid oracle paths.

    Recommendation

    In backingRatioForPricing, return (1e18,true) as soon as accumulated known lower-bound assets cover liabilities. Propagate unavailable Strategy valuation only when the unknown contribution is needed to establish the backing ratio.

    Resolution

    DeltaForesight Team: We changed backing valuation to return a fully covered ratio when known conservative assets already cover all dToken and queued-claim liabilities, even if another Strategy's valuation is unavailable. Unknown assets are not assigned an invented value: if they are needed to establish full coverage, valuation remains unavailable. Known assets include the protected backstop reserve for solvency; this does not make that reserve user-redeemable buffer liquidity. Regression tests cover both sufficient and insufficient known backing.

  9. L-09 Low Stale Zero Strategy Cache Can Misprice a Solvent Branch During Sky Preview Outage oracle accounting Resolved
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/CollateralVault.sol:receiveFromStrategy():L404-L423
    Round
    Main Review

    Description

    CollateralVault.receiveFromStrategy reduces a Strategy valuation cache when Underlying is returned to the Vault. If the returned amount is greater than or equal to the cached value, the cache is set to zero but remains initialized with its existing timestamp.

    This can misprice a Strategy after a narrow Sky converter sequence. First, the Sky USDS to USDC converter must quote a low recoverable value, and that low Strategy value must be cached. Then the converter must recover to normal pricing before the allocator recalls more than the stale cached value, while assets still remain deployed in the Strategy. If the recalled buffer is redeemed and the Sky preview path later reverts before the cache expires, the Vault cannot refresh to the recovered live value and instead treats the zero cache as available.

    At that point, the price feed reports a severe backing haircut instead of unavailable pricing, even though the Strategy may still hold recoverable assets. Borrowing, liquidation, redemption, and branch shutdown logic can then use the false price. The attack path depends on external Sky converter state changes and allocator timing, so likelihood is extremley low, but the stale zero cache can still create incorrect oracle driven outcomes while it remains fresh.

    Recommendation

    Refresh the Strategy valuation after a return and before reducing the cache when possible. If the refresh fails, invalidate the cache whenever the returned amount exhausts or exceeds the cached value, so an arithmetic zero is not treated as a live available zero.

    Resolution

    DeltaForesight Team: We invalidate a historical Strategy valuation cache when principal deductions exhaust it, rather than treating the resulting zero as a fresh measured valuation. Partial deductions preserve the original cache timestamp. A subsequent live valuation can restore the cache after the Strategy's accounting settles; the receive callback does not refresh it prematurely. Tests cover exhaustion during preview unavailability, recovery, partial-cache age and fuzzed exhaustion. A genuinely measured live zero remains distinct from an exhausted historical cache.

  10. L-10 Low Zapper-only manager cannot perform Core's incident-safe close logic / denial of service Resolved
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/Zappers/CollateralYieldZapper.sol:_openTroveWithDTokenCollateral():L523-L564
    Round
    Main Review

    Description

    CollateralYieldZapper opens Core Troves with the zapper itself as the Core remove manager and receiver, then stores the user’s chosen remove manager only in the zapper’s local manager mapping. As a result, the configured manager can call zapper close flows, but cannot call BorrowerOperations.closeTrove directly.

    This matters during a Vault redemption incident. CollateralYieldZapper.closeTroveToUnderlying first closes the Trove in Core, then immediately redeems the returned dToken through CollateralVault.redeem. If that redemption reverts or is paused, the whole transaction rolls back and the Trove remains open. The owner can still bypass the zapper by calling Core directly and receiving dToken, but the configured manager cannot split the rescue into “close now, redeem later.”

    If the owner is unavailable, a funded emergency manager may be unable to close a risky Trove during a Vault incident. The position can then be liquidated even though Core’s dToken-returning close path would have allowed a safe exit.

    Recommendation

    Add an incident-safe zapper close path that lets the zapper-level remove manager close the Trove and forward dToken plus gas compensation to the configured receiver when Underlying redemption is unavailable.

    Resolution

    DeltaForesight Team: We added a manager-authorized close-to-dToken path to CollateralYieldZapper. It respects Core's owner/remove-manager authorization and configured receiver, forwards the close proceeds and gas compensation, and avoids any dependency on Vault redemption. Tests cover incident-time closure, receiver accounting and isolation of unrelated donated balances. Core close restrictions remain: before permanent shutdown, closing still requires a valid Core price, including the separate 30-hour JPY-age restriction. This path does not bypass those checks.

  11. I-01 Informational Source switch event mislabels cached prices Events Resolved
    Location
    https://github.com/GuardianOrg/mirror-deltaforesight-jpydf-audit-01a06231/blob/d59437beed41da49ff53c6796d2e3a09337af046/source-snapshot/contracts/src/PriceFeeds/PriceFeedProxy.sol#L430-L464
    Round
    Main Review

    Description

    The SourceSwitchValidated event documentation states that oldPrice and oldRedemptionPrice represent live old source prices when oldSourceHealthy is true, and cached references if false.

    However, _readSourceIfHealthy sets healthy to true when all three source pricing methods succeed, even when the JPY provenance is aged. In this case, redemptionPriceCacheable is false, so _confirmSource selects the cached redemption reference.

    uint256 referenceRedemptionPrice =
        oldRead.healthy && oldRead.redemptionPriceCacheable ? oldRead.redemptionPrice : _lastGoodRedemptionPrice;
    

    The event subsequently emits this cached value as oldRedemptionPrice with oldSourceHealthy == true. Consequently, the flag does not reliably distinguish live from cached redemption references as documented.

    Recommendation

    Change the comment to clarify that oldRedemptionPrice may be cached even when oldSourceHealthy is true if the JPY/USD round is at least 30 hours old or consider adding a separate flag to identify cached references.

    Resolution

    DeltaForesight Team: We corrected the source-switch event documentation to describe the prices as validation references that may come from cached values. In particular, aged or invalid JPY provenance can cause use of a cached redemption reference even when the source health flag is otherwise healthy. The event ABI and runtime behavior are unchanged.

  12. I-02 Informational Truncation docs overstate redeemable amount Documentation Resolved
    Location
    https://github.com/GuardianOrg/mirror-deltaforesight-jpydf-audit-01a06231/blob/d59437beed41da49ff53c6796d2e3a09337af046/source-snapshot/contracts/src/RedemptionHelper.sol#L130-L142
    Round
    Main Review

    Description

    The specification describes truncateRedemption as returning the maximum JPYdf amount that can be fully redeemed within the given iteration limit. However, the updated handling of unavailable redemption prices allows truncatedJpydf to exceed the expected amount actually redeemed.

    When a branch passes the initial eligibility checks but its redemption price is unavailable, simulateRedemption keeps its allocation weight in totalProportions while excluding it from the simulated redemption. Consequently, available branches receive only their original proportional shares, and the unavailable branch’s share remains unfilled.

    For example, a request for 100 JPYdf is split equally between two branches. If one branch’s redemption price is unavailable, the other can redeem only its 50 JPYdf share. Nevertheless, the helper calculates:

    if (branch[i].redeemable && branch[i].proportion > 0) {
        // Extrapolate how much the entire redeemed JPYDF would
        // have been if this branch was redeemed proportionally.
        uint256 extrapolatedJpydf = branch[i].redeemedJpydf * totalProportions / branch[i].proportion;
    

    This produces 50 * 2,000 / 1,000 = 100, so truncatedJpydf remains 100 even though the detailed quote estimates that only 50 JPYdf will be redeemed.

    The partial allocation is intentional, and the detailed quotes correctly reflect the expected redemption. However, the documented guarantee of full redemption is inaccurate.

    Integrators relying on the documentation may display truncatedJpydf as the expected amount redeemed, even when part of it will remain unspent.

    Recommendation

    Update the specification and interface comments to clarify that truncatedJpydf is the request amount associated with the quote and may be partially filled when branches are unavailable.

    Resolution

    DeltaForesight Team: We corrected the interface and supporting documentation to distinguish the requested redemption amount from the expected executable fill. Unavailable-branch shares are intentionally not reallocated, and the documentation no longer represents the requested amount as guaranteed redeemable output. Runtime behavior is unchanged.

  13. I-03 Informational Oracle pause blocks management fee reductions Business logic errors Resolved
    Location
    https://github.com/GuardianOrg/mirror-deltaforesight-jpydf-audit-01a06231/blob/d59437beed41da49ff53c6796d2e3a09337af046/source-snapshot/contracts/src/BorrowerOperations.sol#L894-L896
    Round
    Main Review

    Description

    In BorrowerOperations, lowerBatchManagementFee invokes _requireIsNotShutDown, which rejects calls during both permanent shutdown and a recoverable oracle pause.

    Previously, oracle failure triggered permanent shutdown and stopped accrual. The new implementation preserves accrual but blocks the fee reductions. shutdownFromOracleFailure only sets isOracleFailureShutdown, leaving TroveManager.shutdownTime and the ActivePool shutdown state unchanged. Consequently, management fees continue accruing at the existing annual rate throughout the pause.

    As a result, borrowers continue accruing management fees that their batch manager may wish to reduce or waive until the branch is resumed.

    Recommendation

    Consider allowing management fee reductions during recoverable oracle pauses.

    Resolution

    DeltaForesight Team: We allow the registered interest batch manager to reduce its management fee during a recoverable oracle pause. Authorization and the permanent-shutdown restriction remain in force, and the existing debt-accrual and fee-accounting path is preserved. Regression tests cover fee reduction during pause, accrued-fee treatment and permanent-shutdown rejection.

  14. I-04 Informational Incorrect NatSpec For emergencyDisableStrategy Function OOS - Documentation Resolved
    Location
    https://github.com/GuardianOrg/mirror-deltaforesight-jpydf-audit-01a06231/blob/2725216e0407a0ef4599e359a04094ae5f322624/source-snapshot/contracts/src/CollateralVault.sol#L643-L649
    Round
    Main Review

    Description

    The @dev block above emergencyDisableStrategy incorrectly states that a strategy must have zero principal and be drained or written off first. These requirements belong to removeStrategy; emergencyDisableStrategy allows outstanding principal.

    This documentation could mislead operators into delaying emergency disabling until funds have been recovered. The issue affects documentation only, with no runtime impact.

    Recommendation

    Move the block above removeStrategy and clarify that both principal and live estimated assets must be readable and zero.

    Resolution

    DeltaForesight Team: We corrected the NatSpec for emergencyDisableStrategy. Disabling a Strategy is allowed while principal or assets remain; the zero-principal and zero-assets requirements apply to removal. This is a documentation correction with no runtime behavior change.

  15. I-05 Informational Incorrect NatSpec For Strategy Emergency Withdrawal Functions OOS - Documentation Resolved
    Location
    source-snapshot/contracts/src/Strategies/AaveV3Strategy.sol:291-292; source-snapshot/contracts/src/Strategies/ERC4626Strategy.sol:145-146; source-snapshot/contracts/src/Strategies/MorphoV2Strategy.sol:290-291
    Round
    Main Review

    Description

    The emergency withdrawal comments in AaveV3Strategy.sol:291, ERC4626Strategy.sol:145, and MorphoV2Strategy.sol:290 direct GOV to call CollateralVault.writeoffStrategyPrincipal for residual losses.

    However, this function requires WRITEOFF_ROLE, which is separate from GOV_ROLE. If these roles are assigned to different accounts, following the documented instructions results in a reverted call and could delay loss recognition during incident response.

    Recommendation

    Update all three comments to specify that an account holding the vault’s WRITEOFF_ROLE must call writeoffStrategyPrincipal.

    Resolution

    DeltaForesight Team: We corrected the Strategy emergency-withdrawal NatSpec to identify WRITEOFF_ROLE, rather than GOV, as the authority for residual principal writeoff. This is a documentation correction with no runtime behavior change.

  16. I-06 Informational Inconsistent registry auth errors Informational Resolved
    Location
    source-snapshot/contracts/src/TroveManager.sol:230
    Round
    Main Review

    Description

    BorrowerOperations.syncRiskParams reverts with the custom CallerNotAddressesRegistry error when called by any address other than the registry, but TroveManager.syncRiskParams uses a bare require for the same authorization check. As a result, unauthorized calls to TroveManager.syncRiskParams revert with zero-length return data, making the two registry-only sync paths inconsistent.

    Recommendation

    Replace the bare require in TroveManager.syncRiskParams with a CallerNotAddressesRegistry custom error, declared locally or shared through a common interface.

    Resolution

    DeltaForesight Team: We made BorrowerOperations and TroveManager consistently use the registry-authorization custom error when a risk-parameter synchronization call is not from the registered AddressesRegistry. Tests cover the authorization checks. The authorization boundary itself is unchanged.

  17. I-07 Informational Standard ERC4626 ceil-withdraw rounding can transfer protocol principal to external shareholders OOS - economic exploit / accounting Acknowledged
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/Strategies/ERC4626Strategy.sol:_doWithdraw():L93-L118
    Round
    Main Review

    Description

    ERC4626Strategy computes withdrawal assets with floor-rounded convertToAssets but invokes ERC4626 withdraw, whose standard ceiling conversion can burn an entire tracked share for a one-unit request. In a donation-inflated public venue, an honest allocator harvest/recall therefore transfers the strategy's principal-bearing share value to an external shareholder while only the requested dust reaches the Vault.

    Impact: A permissionless shareholder can donate to inflate exchange rate, then redeem the surviving share after an expected allocator call, recovering the donation plus roughly the protocol principal. The strategy is left at zero NAV against unchanged principal, creating a real backing deficit and potentially blocking solvency-gated Vault operations.

    Recommendation

    Document this as an ERC4626 venue selection requirement. Approved vaults should have donation inflation protection or otherwise bounded share rounding behavior, and operators should monitor exchange rate inflation so sendToVault is not called with dust asset amounts when one share is worth significant principal.

    Resolution

    DeltaForesight Team: We acknowledge principal loss from rounding withdrawal shares upward. For a compliant venue, the rounding increment is less than one smallest share unit; its asset value determines exposure, and a large withdrawal amount does not remove the issue. Automatically calculated harvest amounts can also be affected.

    We defer a generic adapter change for the current launch. Venue-specific partial/full withdrawal and harvest tests, inflation protection and a bound on value per smallest share unit are required before activation. The Presto USDC Prime readback at Ethereum block 25,992,608 (2026-09-16 21:04:59 UTC) found 18 share decimals, virtualShares of 10^12 and a dead-address seed of 10^18 share units. These observations support conditional venue admission but do not prove future precision bounds or actual withdrawal behavior. Any generic ERC4626 venue with material value per smallest share unit requires a separately reviewed rounding guard before use. Emergency recovery must remain possible after actual losses.

    The production Day-1 policy excludes generic ERC4626 slots. The Morpho candidate must pass the venue-specific tests and precision review above before activation; this acknowledgement does not certify those gates as complete.

    Follow-up verification (2026-09-17): at Ethereum block 25,995,374 (06:19:59 UTC), the smallest share unit is approximately 1.005135e-18 USDC. Three pinned-fork tests pass with the unchanged candidate MorphoV2Strategy and real Presto/USDC, including 64 partial-withdrawal fuzz cases, full withdrawal, owner share-dust cleanup and nonzero harvest after one simulated day. Checked valuation-rounding differences are bounded by one USDC base unit (0.000001 USDC). Partial then full withdrawal leaves one base unit of principal; emergency cleanup removes all shares. Harvest returns 14.444787 USDC with principal and remaining valuation both 100,000 USDC. These tests use a Vault role/receipt harness and local funding/time fixtures. They satisfy the focused I-07 withdrawal/harvest check at this state, not the complete production deployment, liquidity-stress/force-deallocation package or future precision bound. Remaining venue configuration and monitoring gates still apply.

    Verification evidence and focused tests: https://github.com/deltaforesight/jpydf-audit/pull/128 (evidence follow-up; no production code fix).

  18. I-08 Informational VaultV2 fee semantics charge recovered losses if performance fees are activated OOS - economic / integration risk Acknowledged
    Location
    packages/onchain-ethereum-type4/src/__onchain/vaultv2-8c106eedad96553e/src/VaultV2.sol:accrueInterestView():L652-L680
    Round
    Main Review

    Description

    VaultV2 calculates performance fees on positive growth from the previously recorded _totalAssets, without a historical high-water mark. After a recorded loss lowers that baseline, subsequent recovery can incur fees even before assets exceed their pre-loss value. This requires a nonzero performance fee when recovery is recognized. Fee activation settles existing accrual under the old rate, so it does not retroactively charge recovery already recognized. If performance fees are enabled, recovery can mint fee shares and dilute MorphoV2Strategy’s holdings despite no net gain over the pre-loss value. This mechanism causes no performance-fee dilution while performanceFee == 0.

    Recommendation

    Check the vault’s fees before allocating funds, monitor proposed fee changes, and withdraw before an unacceptable change takes effect.

    Resolution

    DeltaForesight Team: We acknowledge that external performance fees can charge a recovery of previous losses without a high-water mark, and that management fees can accrue independently of positive yield. We propose a conditional non-code treatment for the current launch, subject to venue admission and fee-configuration review.

    For Presto USDC Prime (0x133614490896bc02C774bc3399E4Db1B6D05a2CA), the read-only observation at Ethereum block 25,992,608 (2026-09-16 21:04:59 UTC) found both fees at zero, but both fee-setting selectors mutable with zero timelock. A three-day performance-fee delay increase was still pending at that block; passing its execution time does not apply it. The management-fee recipient was zero, so enabling nonzero management fees would also require a valid recipient. Monitoring cannot guarantee an exit window with zero-delay setters. Recheck executed and pending configuration changes and record the accepted settings before final venue freeze; zero observed fees are not a permanent property.

    Acceptance of zero delays for management-fee or allocator changes does not establish acceptance of a zero performance-fee delay. Final venue admission requires explicit risk-owner review of the effective performance-fee delay and outstanding changes; an unexecuted delay proposal cannot satisfy that review. This acknowledgement does not approve activation while that decision remains open.

    Follow-up verification (2026-09-17): fresh readback at Ethereum block 25,995,374 (06:19:59 UTC) confirms both fees and both fee-setting delays remain zero. Two delay-increase proposals remain pending, including the three-day setPerformanceFee delay. All previously submitted calldata were rechecked; scanning subsequent Submit logs found no new submissions. This is now a confirmed incomplete configuration condition, not an unperformed readback. Upstream issue https://github.com/deltaforesight/jpydf-v2/issues/1468 requires post-execution readback with zero pending configuration before final freeze. A further pinned-fork test confirms that execution of both matured curator proposals is permissionless: an ordinary caller can increase the performance-fee and force-deallocation-penalty change delays to three days. Both proposals are consumed, replay fails, and fees, recipients, roles, assets and the current penalty stay unchanged. An unsigned two-call Safe batch is prepared in PR #128. The client selected execution by Presto. The two-call package and transaction-hash request were posted to the existing Biz contact in upstream issue #1468: https://github.com/deltaforesight/jpydf-v2/issues/1468#issuecomment-5710153803. Receipt by Presto and execution are not yet confirmed. Fresh post-execution readback remains required; no production transaction was sent by this agent.

    Verification evidence and focused tests: https://github.com/deltaforesight/jpydf-audit/pull/128 (evidence follow-up; no production code fix).

  19. I-09 Informational Risk finalization omits the documented redistribution-penalty/MCR invariant economic Resolved
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/AddressesRegistry.sol:_requireFinalizedRiskParams():L234-L245
    Round
    Main Review

    Description

    The collateral policy states that both liquidation penalties must be payable from collateral at MCR. However, the authoritative Parameter Catalog and finalization checks require this only for the Stability Pool penalty. The authorized finalizer can therefore approve MCR=105%, SP penalty=5%, and redistribution penalty=20%, assuming the remaining checks pass. This satisfies the implemented rules but conflicts with the broader policy.

    Consequently, a future branch could receive permanent parameters that cannot support the full configured redistribution penalty near MCR. Liquidation remains capped at available collateral, and current Day-1 parameters satisfy both bounds.

    Recommendation

    Clarify whether MCR must cover both liquidation penalties, and if so, enforce this during finalization and deployment.

    Resolution

    DeltaForesight Team: We added the documented requirement that MCR covers the configured redistribution liquidation penalty, alongside the separate Stability Pool compensation check. The invariant is enforced during initial configuration and reserved-branch risk finalization. Tests cover rejection solely for insufficient redistribution coverage and acceptance at the exact boundary.

Remediation Review

2 findings · September 18 to 22, 2026
  1. L-01 Low Merkl Campaign Collisions Can Strand Pre-Funded Incentives OOS - denial of service Resolved
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/Initiatives/UniV4MerklInitiative.sol:createCampaign():L99-L132
    Round
    Remediation Review

    Description

    Merkl campaign IDs omit the campaign amount and actual caller, while allowing callers to name another address as creator. An attacker can therefore create a minimum-funded campaign using the ID expected by UniV4MerklInitiative, causing the official createCampaign call to revert with CampaignAlreadyExists.

    Because PILAllocator.distribute funds the initiative before campaign creation, the JPYdf remains inside the immutable initiative. It can roll into a later epoch, so sustaining the denial requires repeatedly squatting new campaign IDs. However, the initiative provides no recovery path if governance retires it while it holds funds.

    Recommendation

    Keep the assets in PILAllocator until campaign creation. Atomically check that the campaign ID is unused, transfer the funds, and create the campaign so any failure rolls back the transfer.

  2. L-02 Low Nested strategy OOG can permissionlessly relatch a healthy branch's oracle-failure pause OOS - gas griefing / denial of service Resolved
    Location
    packages/jpydf-audit/source-snapshot/contracts/src/CollateralVault.sol:_strategyConservativeValueWithAvailability():L1047-L1056
    Round
    Remediation Review

    Description

    CollateralVault catches every revert from the Strategy valuation probes and converts it into an unavailable valuation. Every other external call on the pricing path guards against this: MainnetPriceFeedBase at line 116 and JpyUsdRateProvider at lines 132 and 148 revert InsufficientGasForExternalCall when gasleft falls below one sixty-fourth of the gas supplied. The two Strategy probes carry no such check.

    When the valuation cache is stale, an attacker can call PriceFeedProxy.fetchPrice with calibrated gas so a nested Morpho valuation runs out of gas while the outer call retains enough to continue. The Vault swallows the starvation and returns (0, false), so no gas error is ever seen. PriceFeedProxy treats this as a genuine oracle failure and pauses a healthy branch, provided raw assets do not already cover liabilities.

    The proof of concept demonstrates a repeatable gas interval and relatches the pause immediately after owner recovery, blocking normal redemption and risk increasing operations. Anyone can call refreshStrategyValuation to repopulate the cache and close the window, but that is reactive and the window reopens each time the cache expires.

    Recommendation

    Apply the same gasleft() <= gasBefore / 64 check used in MainnetPriceFeedBase to both Strategy valuation catches and propagate InsufficientGasForExternalCall. Only ordinary Strategy reverts should enter the oracle-failure path.

Put your code through the same review.

This review started with a conversation about scope. Tell us what you are building and we will plan yours with you.

Get a quote