Skip to content

fix(#165): Prevent minStakeAmount DoS vulnerability#244

Merged
dDevAhmed merged 1 commit into
DigiNodes:mainfrom
okechukwuchisomjoy-cloud:fix/issue-165-min-stake-dos
Jun 26, 2026
Merged

fix(#165): Prevent minStakeAmount DoS vulnerability#244
dDevAhmed merged 1 commit into
DigiNodes:mainfrom
okechukwuchisomjoy-cloud:fix/issue-165-min-stake-dos

Conversation

@okechukwuchisomjoy-cloud

Copy link
Copy Markdown

Closes #165

  • Add validation to setMinStakeAmount() in TruthBountyWeighted.sol to prevent setting minStakeAmount >= token supply
  • Add validation to setMinStakeAmount() in TruthBounty.sol to prevent DoS
  • Add unit tests to verify DoS prevention:
    • Test that amounts exceeding token supply are rejected
    • Test that amount equal to token supply is rejected
    • Test that amount below token supply is accepted

This fix prevents the Denial of Service vulnerability where an admin could set minStakeAmount higher than the token supply, locking out all users from staking.

Issue: #165
References: CO-165

- Add validation to setMinStakeAmount() in TruthBountyWeighted.sol to prevent setting minStakeAmount >= token supply
- Add validation to setMinStakeAmount() in TruthBounty.sol to prevent DoS
- Add unit tests to verify DoS prevention:
  * Test that amounts exceeding token supply are rejected
  * Test that amount equal to token supply is rejected
  * Test that amount below token supply is accepted

This fix prevents the Denial of Service vulnerability where an admin could set minStakeAmount higher than the token supply, locking out all users from staking.

Issue: DigiNodes#165
References: CO-165
@dDevAhmed dDevAhmed merged commit adf4d38 into DigiNodes:main Jun 26, 2026
4 of 8 checks passed
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.

minStakeAmount Denial of Service

2 participants