Skip to content

fix: withdraw flow of Pendle vault#5614

Merged
therealemjy merged 1 commit into
mainfrom
fix/pendle-withdraw
Jun 4, 2026
Merged

fix: withdraw flow of Pendle vault#5614
therealemjy merged 1 commit into
mainfrom
fix/pendle-withdraw

Conversation

@therealemjy
Copy link
Copy Markdown
Member

@therealemjy therealemjy commented Jun 3, 2026

Changes

  • fix withdraw flow of Pendle vault by making sure user has delegated their withdraw power to the Comptroller contract

@therealemjy therealemjy requested a review from cuzz-venus June 3, 2026 14:14
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 3, 2026

🦋 Changeset detected

Latest commit: cd9e63b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jun 4, 2026 7:03am
dapp-testnet Ready Ready Preview Jun 4, 2026 7:03am
venus.io Ready Ready Preview Jun 4, 2026 7:03am

Request Review

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jun 3, 2026

Greptile Summary

This PR fixes the Pendle vault withdraw flow by ensuring the user has delegated their withdraw authority to the PendlePtVault contract before proceeding, and by using the vault's own poolComptrollerContractAddress as the comptroller target (instead of the chain's core-pool comptroller).

  • TransactionForm gains delegateeAddress and vaultPoolComptrollerContractAddress props; the approval logic is refactored into an if/else-if that emits either a token or delegate approval object, with the delegate branch guarded by both props being present.
  • WithdrawForm resolves PendlePtVault via useGetContractAddress and feeds both the vault address and the vault's pool comptroller into TransactionForm, wiring the delegation step unconditionally for both the pre-maturity and post-maturity redeem paths (as confirmed intentional by the team).
  • handleError receives a minor type-import cleanup (import type { BaseError }).

Confidence Score: 5/5

Safe to merge — the delegation gate is correctly wired through the vault's own pool comptroller, and both maturity paths are intentionally covered.

The changes are well-scoped: a new if/else-if approval branch in TransactionForm, prop threading in WithdrawForm, and a type-import cleanup. The delegate approval is guarded by both delegateeAddress and vaultPoolComptrollerContractAddress being present, and the SubmitButton only surfaces the step when the form is valid. Tests cover the positive and the missing-comptroller-address edge cases.

No files require special attention.

Important Files Changed

Filename Overview
apps/evm/src/containers/VaultCard/TransactionForm/index.tsx Adds delegate approval flow via new delegateeAddress and vaultPoolComptrollerContractAddress props; restructures approval logic into an if/else-if block.
apps/evm/src/containers/VaultCard/PendleVaultModal/PositionTab/WithdrawForm/index.tsx Retrieves PendlePtVault address via useGetContractAddress and passes it as delegateeAddress alongside vault.poolComptrollerContractAddress to TransactionForm, wiring in the new delegation gate.
apps/evm/src/containers/VaultCard/TransactionForm/tests/index.spec.tsx Adds tests covering delegate approval display when delegation is required, and skipping it when the comptroller address is absent.
apps/evm/src/libs/errors/handleError/index.ts Converts BaseError import to a type-only import; correct since it is only used as a type cast in this file.
.changeset/wet-impalas-dance.md Patch-level changeset entry for the Pendle vault withdraw fix.

Reviews (3): Last reviewed commit: "fix: withdraw flow of Pendle vault" | Re-trigger Greptile

Comment thread apps/evm/src/containers/VaultCard/TransactionForm/index.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.32% 45822 / 56347
🔵 Statements 81.32% 45822 / 56347
🔵 Functions 62.21% 647 / 1040
🔵 Branches 72.3% 5163 / 7141
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/containers/VaultCard/PendleVaultModal/PositionTab/WithdrawForm/index.tsx 96.15% 63.63% 100% 96.15% 86, 122-127
apps/evm/src/containers/VaultCard/TransactionForm/index.tsx 93.84% 88.57% 75% 93.84% 171-180, 187, 204-205
apps/evm/src/libs/errors/handleError/index.ts 92.1% 33.33% 100% 92.1% 3, 32-33
Generated in workflow #13562 for commit cd9e63b by the Vitest Coverage Report Action

@therealemjy therealemjy force-pushed the fix/pendle-withdraw branch from 19746d8 to cac98d4 Compare June 3, 2026 15:03
@therealemjy
Copy link
Copy Markdown
Member Author

@greptile

@therealemjy therealemjy force-pushed the fix/pendle-withdraw branch from cac98d4 to cd9e63b Compare June 4, 2026 07:01
@therealemjy
Copy link
Copy Markdown
Member Author

@greptile

Copy link
Copy Markdown
Contributor

@cuzz-venus cuzz-venus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@therealemjy therealemjy merged commit de4762d into main Jun 4, 2026
5 checks passed
@therealemjy therealemjy deleted the fix/pendle-withdraw branch June 4, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants