Conversation
Upgrade VBep20Delegate for all core pool markets on BSC testnet to cap repayment amounts to actual borrow balance
Upgrade VBep20Delegate for all core pool markets on BSC mainnet to cap repayment amounts to actual borrow balance
Reassign VIP number from 596 to 610 for the vToken implementation upgrade proposal, updating directory names and import paths.
GitGuru7
left a comment
There was a problem hiding this comment.
overall LGTM, I think we should also upgrade vXAUM on mainnet. The VIP is currently in the queue, we can still include this upgrade and avoid creating an additional VIP for it later.
simulations/vip-610/bsctestnet.ts
Outdated
| // TODO: Set the correct block number | ||
| const BLOCK_NUMBER = 92753245; |
There was a problem hiding this comment.
| // TODO: Set the correct block number | |
| const BLOCK_NUMBER = 92753245; | |
| const BLOCK_NUMBER = 93334375; |
Add vXAUM underlying address, reorder all core pool markets alphabetically in both mainnet and testnet VIP definitions, and update all references from vip596 to vip610.
vips/vip-610/bscmainnet.ts
Outdated
| import { ProposalType } from "src/types"; | ||
| import { makeProposal } from "src/utils"; | ||
|
|
||
| export const NEW_VBEP20_DELEGATE_IMPL = "0x469E286EA3a0A38358004AADbD54E52097aeD9B3"; |
There was a problem hiding this comment.
from claude code
VIP description does not disclose flash loan removal. The new implementation completely removes all flash loan infrastructure (~6 functions including transferOutUnderlyingFlashLoan, setFlashLoanEnabled, calculateFlashLoanFee, etc). Flash loans are currently enabled (isFlashLoanEnabled=true) on at least vUSDT, vUSDC, vBTC, vETH, vXVS. Although flashLoanFeeMantissa=0 suggests limited active use, this is a material behavioral change that must be disclosed. Additional undisclosed changes: borrowFresh simplified (removed shouldTransfer param), event emission ordering fixed in _setComptrollerFresh/_setInterestRateModelFresh.
Point to the latest deployed implementations and update simulation fork blocks to match the new deployment state.
- Rename vip610 to vip597 in VIP and simulation files - Update title to "VIP-597 [BNB Chain] VToken Repayment Logic Improvement" - Replace description with content from Notion community post (Context, Proposed Change, Impact, Scope, Summary sections) - Keep Security, Deployed contracts, and References sections Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ibility - Remove inline code backticks and code blocks that don't render in the governance UI - Remove Proposed Change and Scope sections (code-heavy) - Link to community post for technical details - Add community post to References Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
venus.io#/governance/proposal/597?chainId=56 |


VIP-597: VToken Repayment Logic Improvement
Description
This proposal updates the repayment logic in VToken to automatically cap repayments at the borrower's outstanding debt. The change improves safety, simplifies repayment flows, and prevents unintended over-repayment.
Context
Currently, only a repayment of
type(uint256).maxis treated as a full repayment. All other over-estimates are processed as-is, which can cause wasteful transactions and requires users to calculate exact debt amounts.This update generalises the logic so that any repayment exceeding the borrower's debt is capped, improving safety and user experience across repayment and liquidation scenarios.
Proposed Change
Update in
VToken.sol(repayBorrowFresh):Before:
After:
Impact
repayBorrowandrepayBorrowBehalfRepayBorrowevents now reflect the actual repaid amountScope
repayBorrowFreshSummary
If approved, this VIP will: