DexLyn Disclosed Report

Potential DoS from integer overflow in voting power calculation

Company
Created date
Nov 07 2025

Target

https://github.com/hackenproof-public/tokenomics_contract

Vulnerability Details

Summary

There exists a low severity issue in sources/voting_escrow.move. The voting power bias calculation in check_point_internal() can overflow for users attempting to lock extremely large amounts of DXLYN tokens (≥50M DXLYN), causing transaction failures and preventing whale participants from using the voting escrow system.

Finding Description

The voting power calculation system uses bias and slope values to track voting power decay over time. The bias represents the current voting power, while slope represents the rate of decay. These calculations involve multiplying large token amounts by scaling factors and time differences:

// Lines 1447-1450 & 1453-1456 in check_point_internal()
if (old_locked.end > current_time && old_locked.amount > 0) {
    u_old.slope = (old_locked.amount * AMOUNT_SCALE) / MAXTIME; // @audit Potential overflow
    u_old.bias = u_old.slope * (old_locked.end - current_time);
};

if (new_locked.end > current_time && new_locked.amount > 0) {
    u_new.slope = (new_locked.amount * AMOUNT_SCALE) / MAXTIME; // @audit Potential overflow
    u_new.bias = u_new.slope * (new_locked.end - current_time); 
};

The overflow occurs in the slope calculation: u_new.slope = (new_locked.amount * AMOUNT_SCALE) / MAXTIME;

  • AMOUNT_SCALE: 10^4 (scaling factor for precision)
  • u64::MAX: 1.84*10^19
  • INITIAL_SUPPLY: 10^16 (100 Million with 10^8 decimals)

Large token amounts can cause the intermediate calculations to exceed u64 limits. In fact, when locked.amount = 1.84*10^19 / 10^4 = 1.84*10^15 (which is 18,400,000 DXLYN), the slope calculation overflows. This is around 18.4% of the total supply, making it feasible for large stakeholders to hit this limit.

Impact

This overflow issue has the following impacts:

  • Transaction failures: Users attempting to lock very large amounts (≥18.5M DXLYN) will experience transaction aborts
  • Whale exclusion: Large stakeholders cannot participate in the voting escrow system

The issue is classified as low severity because:

  • It requires large individual locks (>18.4% of the total supply)
  • The failure is "safe" (transaction abort rather than permanent fund loss)

Proof of Concept

As demonstrated above, when locked.amount = 1.84*10^19 / 10^4 = 1.84*10^15, the slope calculation overflows.

Recommendation

Cast to u256 for intermediate calculations to prevent overflow.

Validation steps

See above

Attachments

hidden
CommentsReport History
Comments on this report are hidden
Details
Statedisclosed
Severity
Low
Bounty$1,500
Visibilitypartially
VulnerabilityBlockchain
Participants (4)
company admin
author