Skip to content

feat: add pool configuration limits and default settings - #748

Merged
ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
balisdev:fix/issues-682-683-685-686
Nov 23, 2026
Merged

ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
balisdev:fix/issues-682-683-685-686

Conversation

@balisdev

Copy link
Copy Markdown
Contributor

Description

This PR addresses issues #682, #683, #685, and #686 by implementing pool configuration limits validation and default settings functionality.

Changes

Issue #683 - Factory: Pool Configuration Limits

  • Added MAX_REWARD_RATE constant (10,000) to prevent invalid configurations
  • Added validation in create_pool_inner to check if reward_rate exceeds the limit
  • Added InvalidConfig error type to FactoryError enum

Issue #686 - Factory: Default Pool Configuration

  • Added DefaultPoolConfig storage type with fields for default configuration
  • Added DefaultPoolConfig storage key
  • Implemented set_default_config function (admin-only) to store default configuration
  • Implemented get_default_config function to retrieve stored default configuration
  • Added validation matching create_pool requirements

Issue #682 - Farming Pool: Multiplier Limits Query

  • The get_multiplier_limits function already exists and returns (1u32, MAX_GLOBAL_MULTIPLIER)
  • This issue was already resolved in a previous update

Issue #685 - Farming Pool: Default Multiplier

  • Added DefaultMultiplier storage key
  • Implemented set_default_multiplier function (admin-only) to store default multiplier
  • Implemented get_default_multiplier function to retrieve stored default multiplier
  • Added validation to ensure multiplier is within bounds (1 to MAX_GLOBAL_MULTIPLIER)

Testing

  • Successfully built both factory and farming-pool contracts with wasm32v1-none target
  • No compilation errors or warnings

Impact

  • Invalid configs: Prevented by MAX_REWARD_RATE validation
  • Broken pools: Prevented by enforcing configuration limits
  • Poor integrity: Improved with default configuration management
  • Hardcoded defaults: Eliminated with configurable default settings
  • Poor flexibility: Enhanced with admin-controlled defaults
  • Limited customization: Resolved with default config functions

Closes #682, Closes #683, Closes #685, Closes #686

- Add MAX_REWARD_RATE constant and validation in factory
- Add set_default_config and get_default_config functions in factory
- Add set_default_multiplier and get_default_multiplier functions in farming-pool
- Add InvalidConfig error type to FactoryError
- Add DefaultPoolConfig storage type
- Add DefaultMultiplier storage key

Closes SmartDropLabs#682, Closes SmartDropLabs#683, Closes SmartDropLabs#685, Closes SmartDropLabs#686
@netlify

netlify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

👷 Deploy request for sdcontracts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 305ef0b

@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@balisdev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ritaifeoluwa
ritaifeoluwa merged commit 5215419 into SmartDropLabs:main Nov 23, 2026
1 of 2 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

2 participants