Skip to content

Commit a6b450d

Browse files
fred-venusclaude
andcommitted
chore: prepare VIP-597 for proposal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4f84e4d commit a6b450d

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

simulations/vip-597/bsctestnet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ethers } from "hardhat";
44
import { expectEvents } from "src/utils";
55
import { forking, testVip } from "src/vip-framework";
66

7-
import vip610Testnet, { CORE_MARKETS, NEW_VBEP20_DELEGATE_IMPL } from "../../vips/vip-597/bsctestnet";
7+
import vip597Testnet, { CORE_MARKETS, NEW_VBEP20_DELEGATE_IMPL } from "../../vips/vip-597/bsctestnet";
88
import VBEP20_DELEGATOR_ABI from "./abi/VBep20Delegator.json";
99

1010
const BLOCK_NUMBER = 93362756;
@@ -20,7 +20,7 @@ forking(BLOCK_NUMBER, async () => {
2020
});
2121
});
2222

23-
testVip("VIP-610 testnet", await vip610Testnet(), {
23+
testVip("VIP-597 testnet", await vip597Testnet(), {
2424
callbackAfterExecution: async (txResponse: TransactionResponse) => {
2525
const totalMarkets = CORE_MARKETS.length;
2626
await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets]);

vips/vip-597/bscmainnet.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ Currently, only a repayment of type(uint256).max is treated as a full repayment.
233233
234234
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.
235235
236+
#### Proposed Change
237+
238+
**Update in VToken.sol (repayBorrowFresh):**
239+
236240
The technical details of the proposed change (including before/after code diff) can be found in the [community post](https://community.venus.io/t/proposal-vtoken-repayment-logic-improvement/5688).
237241
238242
#### Impact
@@ -242,6 +246,13 @@ The technical details of the proposed change (including before/after code diff)
242246
- **Events**: RepayBorrow events now reflect the actual repaid amount
243247
- **Math Safety**: Prevents underflow in repayment calculations
244248
249+
#### Scope
250+
251+
- **Contract:** VToken
252+
- **Function:** repayBorrowFresh
253+
- **Change Type:** Single-line logic update
254+
- **Code Impact:** Minimal (2 additions, 6 deletions)
255+
245256
#### Summary
246257
247258
If approved, this VIP will:

vips/vip-597/bsctestnet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ export const CORE_MARKETS = [
158158
},
159159
];
160160

161-
const vip610Testnet = () => {
161+
const vip597Testnet = () => {
162162
const meta = {
163163
version: "v2",
164-
title: "VIP-610 [BNB Chain] Repay Logic Improvement - VToken Implementation Upgrade",
164+
title: "VIP-597 [BNB Chain] VToken Repayment Logic Improvement",
165165
description: `This VIP upgrades the VBep20Delegate implementation for all core pool markets on BNB Chain testnet to include the repay logic improvement.
166166
167167
The updated implementation caps the repayment amount to the borrower's actual outstanding debt, preventing over-repayment scenarios. Previously, only \`type(uint256).max\` was treated as "repay full balance". Now, any amount exceeding the actual borrow balance is automatically capped.
@@ -188,4 +188,4 @@ The updated implementation caps the repayment amount to the borrower's actual ou
188188
);
189189
};
190190

191-
export default vip610Testnet;
191+
export default vip597Testnet;

0 commit comments

Comments
 (0)