Skip to content

New release#688

Merged
fred-venus merged 222 commits into
mainfrom
develop
Jul 3, 2026
Merged

New release#688
fred-venus merged 222 commits into
mainfrom
develop

Conversation

GitGuru7 and others added 30 commits September 24, 2025 12:28
chore: fix some minor issues in the comments
[VPD-404]: Add PT-clisBNB-25JUN2026 market on BNB Chain Core pool
## 10.2.0-dev.1 (2026-01-21)

* Merge branch 'develop' into feat/vpd-404 ([2e1f342](2e1f342))
* Merge pull request #643 from goldlinker/develop ([ff2d7cf](ff2d7cf)), closes [#643](#643)
* Merge pull request #656 from VenusProtocol/feat/vpd-404 ([01414e3](01414e3)), closes [#656](#656)
* Merge pull request #660 from VenusProtocol/main ([24b52b8](24b52b8)), closes [#660](#660)
* fix: initial supply value ([3c3abf6](3c3abf6))
* feat: add mainnet deployments for PT-clisBNB-25JUN2026 market ([0bb1d96](0bb1d96))
* feat: add testnet deployment for PT-slisBNBx-24JUN2026 market ([84a199d](84a199d))
* feat: redeploy market for bsctestnet ([39dab7d](39dab7d))
* feat: updating deployment files ([eb1ee25](eb1ee25))
* feat: updating deployment files ([178b03a](178b03a))
* chore: fix some minor issues in the comments ([1784726](1784726))
- Add IPrimeLeaderboard interface with structs, events, and errors
- Add PrimeLeaderboardStorage with LIFO deposit stack structure
- Implement PrimeLeaderboard with:
  - Per-deposit timestamp tracking for LIFO withdrawals
  - Time-weighted multiplier tiers (1.0x to 2.0x based on deposit age)
  - Epoch-based processing with off-chain ranking verification
  - Participant management with 500 XVS minimum stake
  - Withdrawn score locking until epoch ends
- Test initialization and default multiplier tiers
- Test deposit recording and participant management
- Test LIFO withdrawal processing
- Test effective stake calculation with time-weighted multipliers
- Test epoch processing and finalization
- Test admin functions (setEpochDuration, setPrimeSlots, etc.)
- Test pause functionality
- 46 passing tests
…cking

- Add IPrimeLeaderboard interface (Solidity 0.5.16 compatible)
- Add primeLeaderboard storage variable to XVSVaultStorage
- Add setPrimeLeaderboard() setter function
- Call recordDeposit() on XVS deposits to prime pool
- Call recordWithdrawal() on withdrawal requests from prime pool
- Reduce storage gap from 46 to 45 for new variable
…bution

PrimeV2 replaces the self-claim model with a leaderboard-driven Prime
token system powered by PrimeLeaderboard.
Comprehensive unit tests using smock mocks for all external dependencies
(XVSVault, Oracle, PrimeLeaderboard, PrimeLiquidityProvider).
Remove recordDeposit/recordWithdrawal callbacks added in 20adb68.
The new approach uses the existing primeToken.xvsUpdated() callback
instead — zero vault code changes needed. Governance repoints
primeToken to PrimeLeaderboard via setPrimeToken().
1. Remove on-chain epoch processing — replace finalizeEpoch(),
   revokePrimeStatus(), hasPrime, userRank, primeSlots, epochDuration
   with simple currentRound + advanceRound(). Admin calls
   PrimeV2.issue()/burn() directly based on off-chain ranking.

2. Keep XVSVault unchanged — replace recordDeposit/recordWithdrawal
   with xvsUpdated(user) that reads vault balance via getUserInfo(),
   diffs against _lastKnownStake, and infers deposit/withdrawal.
Admin now calls issue()/burn() directly based on off-chain leaderboard
ranking. No need for pull-based status sync from PrimeLeaderboard.
Replace all epoch-based and recordDeposit/recordWithdrawal tests with
xvsUpdated + advanceRound pattern. Use smock FakeContract<IXVSVault>
mock instead of Signer for vault interaction. Update effective stake
assertions to include hold_duration in formula (amount × multiplier ×
min(holdDays, 90)). Add tests for advanceRound, setXVSVaultPoolConfig,
setXVSVault, getDeposits, getTotalStaked, and ACM access control.
Comprehensive integration test suite covering the full PrimeV2 +
PrimeLeaderboard lifecycle with mock contracts:
- Full E2E flow: deposit → issue → accrue → claim
- LIFO withdrawal mechanics preserving oldest deposits
- Time-weighted multiplier tier progression (1.0x → 2.0x)
- Round-based withdrawn score tracking and reset
- Batch score updates after alpha/multiplier changes
- Deposit compaction at 100-deposit limit
- Participant threshold boundary behavior
- Pause/unpause and admin operations
Validates the full PrimeV2 + PrimeLeaderboard system on a mainnet fork
using real XVSVault, Comptroller, Oracle, and PrimeLiquidityProvider.
Keeper helper that batches score updates and accrues interest across
all Prime markets.
- Fix inverted condition in _updateRoundAfterTokenBurned
- Add partial claim with remainder tracking in _claimInterest
- Use SafeCast for uint128/uint64 casts in PrimeLeaderboard
- Enforce xvsVault caller check on xvsUpdated
- Add getPendingRewardsStatic view function
- Remove dead poolRegistry storage and setPoolRegistry
- Enforce batchSize in PrimeV2Keeper.processScoreUpdates
- Add _ensureMaxLoops in _burn and _initializeMarkets
- Emit IncompleteRoundDiscarded on unfinished round overwrite
- Validate non-zero multipliers in addMarket
- Remove setPoolRegistry tests (function removed from PrimeV2)
- Update xvsUpdated calls to go through xvsVault (M-01 access control)
- Flip unrestricted xvsUpdated test to expect OnlyXVSVaultAllowed revert
- Fund smock FakeContract wallets with ETH for gas via setBalance
- Add xvsVaultSigner via initMainnetUser in fork tests
- Remove PrimeV2Integration test suite (will be re-integrated later)
Debugger022 and others added 27 commits June 10, 2026 20:44
[VPD-1292] PrimeV2 Sherlock Audit
[VPD-1247]: Hashdit Audit Mitigations for PrimeV2
Deploy a legacy JumpRateModel (300% flat below the 45% kink, 500% max)
for the BNB Core pool's Phase-4 market deprecation. A separate legacy
contract is required because the isolated-pools JumpRateModelV2 uses a
badDebt-aware getBorrowRate/getSupplyRate ABI that legacy VBep20 markets
cannot call. The downstream VIP repoints the deprecated markets via
_setInterestRateModel.
[VPD-1341]: Deploy New BStock Markets vTSLAB, vNVDAB and vSPCXB
## 10.2.0-dev.8 (2026-06-17)

* Merge pull request #675 from caltechustc/develop ([b531da6](b531da6)), closes [#675](#675)
* Merge pull request #679 from VenusProtocol/feat/vpd-1341 ([1bbfe13](1bbfe13)), closes [#679](#679)
* feat: deploy new core markets for bscmainnet and bsctestnet ([9e2811d](9e2811d))
* feat: deploy new markets on testnet ([54e5255](54e5255))
* feat: deploy SPCXB market on bnb chain ([019f60f](019f60f))
* feat: updating deployment files ([48184e0](48184e0))
* feat: updating deployment files ([bbd4545](bbd4545))
* feat: updating deployment files ([ac0e1ce](ac0e1ce))
* fix(deployments): rename PT-USDe-30Oct2025 testnet artifacts to canonical 30OCT2025 casing ([99357f7](99357f7))
* chore: fix wrong path in comment ([95faa37](95faa37))
Standalone view-only contract that reads PrimeV2 state via its public
mappings. Replaces V1's removed 'calculateAPR' / 'estimateAPR' /
'incomeDistributionYearly' helpers without growing PrimeV2 past the 24KB
EVM size limit. Adds 'APRInfo' and 'Capital' structs to 'IPrimeV2'.
Resolve vBNB→WBNB in PrimeLens._getUnderlying so APR queries on the
native market hit PLP correctly. Add hardhat-deploy script for
PrimeLens, fork test, and a bsctestnet chain hardhat hardfork-history
entry so the lens fork suite can run.
[VPD-1313] PrimeV2 deployments for BSC
[VPD-1168]: Add BNB Core deprecation interest rate model
## 10.2.0-dev.9 (2026-06-29)

* Merge pull request #682 from VenusProtocol/feat/VPD-1168 ([092a43f](092a43f)), closes [#682](#682)
* feat: add BNB Core deprecation interest rate model ([615781b](615781b))
* feat: updating deployment files ([b778211](b778211))
feat(prime): add PrimeV2 and PrimeLeaderboard contracts
## 10.2.0-dev.10 (2026-06-30)

* Merge branch 'feat/VPD-1292' into feat/VPD-1313 ([d1a77fa](d1a77fa))
* Merge branch 'feat/VPD-1292' into feat/VPD-1313 ([789a6eb](789a6eb))
* Merge pull request #670 from VenusProtocol/feat/prime-v2 ([9a71ef5](9a71ef5)), closes [#670](#670)
* Merge pull request #674 from VenusProtocol/feat/VPD-1247 ([d78ca10](d78ca10)), closes [#674](#674)
* Merge pull request #676 from VenusProtocol/feat/VPD-1292 ([4b5866b](4b5866b)), closes [#676](#676)
* Merge pull request #677 from VenusProtocol/feat/VPD-1313 ([17e0340](17e0340)), closes [#677](#677)
* Merge pull request #678 from VenusProtocol/feat/VPD-1366 ([3bc5db6](3bc5db6)), closes [#678](#678)
* test(prime-v2): fork test for WBNB reward distribution on bsctestnet ([818a219](818a219))
* test(prime): add 36 integration tests for PrimeV2 + PrimeLeaderboard ([bf0260c](bf0260c))
* test(prime): add 48 fork tests covering batch ops, market removal, compaction, and migration ([f614ae1](f614ae1))
* test(prime): add deposit compaction and market management tests ([63fcc3f](63fcc3f))
* test(prime): add interest accrual, claiming, and score update tests ([7032cd0](7032cd0))
* test(prime): add PrimeV2 bsctestnet end-to-end fork test ([acfafd3](acfafd3))
* test(prime): add PrimeV2 E2E fork test against BSC mainnet ([455161f](455161f))
* test(prime): add PrimeV2 end-to-end integration tests ([de3373e](de3373e))
* test(prime): add PrimeV2Keeper unit tests and deployment script ([5247e2a](5247e2a))
* test(prime): add unit tests for PrimeLeaderboard ([38b7a24](38b7a24))
* test(prime): add unit tests for PrimeV2 contract ([8c63b19](8c63b19))
* test(prime): align tests with seconds-based scoring and addMarket changes ([406d8dd](406d8dd))
* test(prime): fix fork fixture wiring and pin lens block ([a729326](a729326))
* test(prime): rewrite PrimeLeaderboard unit tests for v2 architecture ([313afc4](313afc4))
* test(prime): update fork tests for backend-driven withdrawn score ([79d7041](79d7041))
* test(prime): update PrimeV2 tests for round-based architecture ([a3a2cb8](a3a2cb8))
* test(prime): update tests for security fix changes ([53d00f9](53d00f9))
* feat: add PrimeV2 and PrimeLeaderboard deployment scripts ([3b5eb36](3b5eb36))
* feat: init ([22b0bfb](22b0bfb))
* feat: updating deployment files ([710d8ef](710d8ef))
* feat: updating deployment files ([b35e769](b35e769))
* feat: updating deployment files ([f179ba2](f179ba2))
* feat(prime-v2): add permissionless claimPrime with epoch threshold gate ([0e03631](0e03631))
* feat(prime-v2): add PrimeLens for off-chain APR queries ([6341f41](6341f41))
* feat(prime-v2): primeLens native market support + deploy script ([284eb8c](284eb8c))
* feat(prime): add burnBatch function to PrimeV2 ([cdacaed](cdacaed))
* feat(prime): add initializeStakers and finalizeInitialization ([821c4da](821c4da))
* feat(prime): add PrimeLeaderboard contract for time-weighted scoring ([9497560](9497560))
* feat(prime): add PrimeV2 contract with leaderboard-based token distribution ([116c0a3](116c0a3))
* feat(prime): add PrimeV2Keeper automation contract ([3a4833b](3a4833b))
* feat(prime): add single issue(address) and rename batch to issueBatch ([8e953d3](8e953d3))
* feat(prime): add tier-based fallback compaction and increase deposit limit to 30 ([3576006](3576006))
* feat(prime): track and reclaim undistributed PLP income via sweep ([b4fca63](b4fca63))
* feat(prime): track lifetime accrued per (market, user) with cycle snapshot anchor ([c3e0866](c3e0866))
* feat(xvsvault): integrate PrimeLeaderboard for deposit/withdrawal tracking ([20adb68](20adb68))
* chore(deploy): add bscmainnet PrimeV2 + PrimeLeaderboard deployments ([81ea8e6](81ea8e6))
* chore(deploy): add bsctestnet PrimeLens deployment ([8a2d7d8](8a2d7d8))
* chore(deploy): add PrimeV2 and PrimeLeaderboard bsctestnet deployments ([ed036db](ed036db))
* chore(deploy): add PrimeV2 impl-only deploy script + bsctestnet impl ([c33d138](c33d138))
* chore(deploy): record PrimeLens deployment on bscmainnet ([bd55802](bd55802))
* chore(deploy): redeploy PrimeLens on bscmainnet ([0b2349f](0b2349f))
* chore(deploy): redeploy PrimeV2 implementation on bscmainnet ([0d7c970](0d7c970))
* chore(deploy): redeploy PrimeV2 on bsctestnet after sweep + carry-forward changes ([bd8f68c](bd8f68c))
* chore(deploy): remove setPrimeLeaderboard wiring from PrimeV2 deploy script ([e52ed46](e52ed46))
* chore(deploy): split PrimeLeaderboard into its own deploy script ([9afff69](9afff69))
* chore(deploy): sync bsctestnet PrimeV2 + PrimeLeaderboard deployments from primev2-testnet ([34cc699](34cc699))
* chore(deploy): transfer PrimeV2/PrimeLeaderboard ownership in deploy scripts ([c0b1d35](c0b1d35))
* fix: [I03] ([7c05ebd](7c05ebd))
* fix: [I04] ([b96facb](b96facb))
* fix: [I05] ([9ad4f33](9ad4f33))
* fix: [I06] ([9456254](9456254))
* fix: [I11] ([f73bf9e](f73bf9e))
* fix: [I13] ([4449a25](4449a25))
* fix: [L02] ([ce7d47e](ce7d47e))
* fix: [L03] ([027abf8](027abf8))
* fix: [L04] ([85b7951](85b7951))
* fix: [M01] ([5fcc3f8](5fcc3f8))
* fix: [M02] ([649c015](649c015))
* fix: [VLP-02] ([3b8b10a](3b8b10a))
* fix: [VLP-05] ([a1fc829](a1fc829))
* fix: carry-forward PLP income when sumOfMembersScore is zero ([61625b1](61625b1))
* fix: ceil weighted timestamp on deposit compaction ([e421dda](e421dda))
* fix(hashdit): [I02] ([434df1e](434df1e))
* fix(prime): accrue interest on XVS stake change via xvsUpdated ([68dda6e](68dda6e))
* fix(prime): add _ensureMaxLoops guard to _accrueInterestAndUpdateScoreWithoutAccrual ([e3f9fbd](e3f9fbd))
* fix(prime): add maxLoops guard, removeMarket, and NatSpec improvements ([b2b5c91](b2b5c91))
* fix(prime): add missing events and fix event indexing in PrimeV2 contracts ([98bc0fd](98bc0fd))
* fix(prime): allow claiming residual interest after market removal ([de8c966](de8c966))
* fix(prime): allow non-holders to claim previously accrued rewards ([2977ecb](2977ecb))
* fix(prime): fix CI/CD issues in deploy scripts and formatting ([77a6f92](77a6f92))
* fix(prime): fix security findings across PrimeV2 contracts ([e2ab7ee](e2ab7ee))
* fix(prime): move isPrimeHolder check from _burnWithoutAccrual to burn, skip in burnBatch ([20fe62f](20fe62f))
* fix(prime): move rewardIndex update inside token holder check ([2b79c49](2b79c49))
* fix(prime): prevent removeMarket when market has active members ([8aacdf0](8aacdf0))
* fix(prime): remove unused errors, redundant check, and fix NatSpec ([7e4fb6f](7e4fb6f))
* fix(prime): subtract pendingWithdrawals in xvsUpdated and remove whenNotPaused ([4dff8b1](4dff8b1))
* fix(prime): use weighted average timestamp in tier compaction ([9161327](9161327))
* docs: add PrimeV2 certik audit report ([4efd603](4efd603))
* docs: add PrimeV2 hashdit audit report ([d8e6f8d](d8e6f8d))
* docs: add PrimeV2 sherlock audit report ([a06660b](a06660b))
* docs(prime): add @Custom:event, @Custom:error, @Custom:access NatSpec tags ([4a3aa4e](4a3aa4e))
* docs(prime): add NatSpec for permissionless claimInterest and oracle calls in _calculateScore ([b2c548e](b2c548e))
* docs(PrimeV2): complete NatSpec coverage and simplify accounting vars ([07a7f09](07a7f09))
* revert: carry-forward PLP income when sumOfMembersScore is zero ([2f809a8](2f809a8))
* revert(xvsvault): remove PrimeLeaderboard integration from XVSVault ([a31b34d](a31b34d))
* refactor(prime-v2): remove MAXIMUM_XVS_CAP from score calculation ([9a6aa2a](9a6aa2a))
* refactor(prime): add MaxLoopsLimitHelper to PrimeLeaderboard and merge setMultiplierTiers loops ([bd06d9d](bd06d9d))
* refactor(prime): address review findings across PrimeV2 and PrimeLeaderboard ([fbdbeff](fbdbeff))
* refactor(prime): address review findings on PrimeLeaderboard ([5f14e94](5f14e94))
* refactor(prime): cleanup PrimeLeaderboard per review findings ([4035faf](4035faf))
* refactor(prime): gas optimizations and storage simplification ([9c37f9d](9c37f9d))
* refactor(prime): hoist accrueAllMarkets out of burnBatch loop ([92dcfe5](92dcfe5))
* refactor(prime): hoist accrueInterest out of per-user loops ([28b7362](28b7362))
* refactor(prime): make vault config immutable and fix compaction timestamp ([daba2b4](daba2b4))
* refactor(prime): make vault config immutable in PrimeV2 ([ce25b09](ce25b09))
* refactor(prime): optimize PrimeLeaderboard storage writes and cleanup ([a5a887d](a5a887d))
* refactor(prime): remove epoch/round management, decouple withdrawn score from effective stake ([c78e817](c78e817))
* refactor(prime): remove irrevocable token type from PrimeV2 ([9c7680c](9c7680c))
* refactor(prime): remove minimumStake variable from PrimeLeaderboard ([a2767ab](a2767ab))
* refactor(prime): remove PrimeV2Keeper contract ([c9f9df9](c9f9df9))
* refactor(prime): remove redundant _lastKnownStake variable ([17083f5](17083f5))
* refactor(prime): remove redundant token.exists check in _mint ([5abf8c2](5abf8c2))
* refactor(prime): remove syncPrimeStatus from PrimeV2 ([e1e4227](e1e4227))
* refactor(prime): remove unused MaxLoopsLimitHelper from PrimeLeaderboard ([fe862d6](fe862d6))
* refactor(prime): remove withdrawn stake tracking from PrimeLeaderboard ([bf7b662](bf7b662))
* refactor(prime): rename withdrawnScore to withdrawnStake ([bf1fc75](bf1fc75))
* refactor(prime): rename withdrawnScoreCurrentRound to withdrawnScore ([d76fbf5](d76fbf5))
* refactor(prime): replace epochs with rounds and xvsUpdated pattern ([3afdfb4](3afdfb4))
* refactor(prime): replace manual resetWithdrawnStake with auto-expiring storage ([b05c425](b05c425))
* refactor(prime): simplify pendingScoreUpdates guard in issue/burn ([56b4158](56b4158))
* refactor(prime): use seconds-based scoring, simplify addMarket, and fix _capitalForScore ([1d6842a](1d6842a))
* refactor(PrimeV2): remove unused primeLeaderboard storage and setter ([2ea0346](2ea0346))
* refactor(test): clean up vague comments and dead code in PrimeV2 tests ([0d0dd31](0d0dd31))
* refactor(test): modularize PrimeV2 and PrimeLeaderboard test suites ([dd05f07](dd05f07))
@Debugger022
Debugger022 marked this pull request as ready for review July 3, 2026 07:15
@fred-venus
fred-venus merged commit 66956de into main Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants