fix: vaults decimals#5669
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 3b0756e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Greptile SummaryThis PR fixes a decimals mismatch in the Pendle vault's post-maturity withdraw flow: full redeems now pass the user's actual vToken balance (fetched via
Confidence Score: 5/5Safe to merge — the logic change is narrowly scoped to the post-maturity redeem path and directly mirrors the already-working Market page withdraw flow. The fix is correct and well-targeted: full redeems use the on-chain vToken balance to avoid mantissa mismatches, partial redeems switch to underlying token decimals as the contract expects, and the loading guard prevents premature submission. The test update confirms the new expected value. The only nit is in the changeset, which does not affect runtime behavior. .changeset/cruel-carrots-sit.md — wrong bump level (major instead of patch) and a typo in the description. Important Files Changed
Reviews (2): Last reviewed commit: "fix: add loading" | Re-trigger Greptile |
| if (!withdrawAmountMantissa) { | ||
| throw new VError({ | ||
| type: 'unexpected', | ||
| code: 'somethingWentWrong', | ||
| }); | ||
| } |
There was a problem hiding this comment.
Submit blocked by unloaded vToken balance
When hasMatured and withdrawFull is true, the guard if (!withdrawAmountMantissa) will throw a VError whenever the useGetVTokenBalance query has not yet returned — meaning a user who submits the form while that request is still in-flight will see a generic "something went wrong" error with no explanation. The submit button is not wired to the loading state of that query, so it's fully clickable the moment the form is valid. Consider passing the loading state of getVTokenBalanceData into the isLoading prop of TransactionForm so the button stays disabled until the balance is available when hasMatured is true.
therealemjy
left a comment
There was a problem hiding this comment.
Looks good to me. Greptile's comment is relevant, the fix is to link the loading state of the submit button to the loading state of the vToken balance
|
@greptile review again |
Coverage Report for ./apps/evm
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Jira ticket(s)
VEN-XXX
Changes