Skip to content

feat: Implement Platform Fee Configuration#75

Merged
ahmadogo merged 3 commits intoMentoNest:mainfrom
7maylord:feat/platformFees
Feb 24, 2026
Merged

feat: Implement Platform Fee Configuration#75
ahmadogo merged 3 commits intoMentoNest:mainfrom
7maylord:feat/platformFees

Conversation

@7maylord
Copy link
Copy Markdown
Contributor

Summary
This PR adds the get_platform_fee_bps and set_platform_fee_bps feature and resolves a significant number of pre-existing bugs that prevented the contract from compiling and the test suite from running correctly.

New Feature:

  • get_platform_fee_bps(env) -> u32 — reads the platform fee (in basis points) from instance storage; defaults to 0 if unset.
  • set_platform_fee_bps(env, new_bps: u32) -> Result<(), Error> — updates the fee; restricted to the admin via require_auth(), validates the range, and emits a PlatformFeeUpdated(old, new) event.
  • validate_platform_fee_bps(bps) helper — rejects any value above PLATFORM_FEE_MAX_BPS = 1000 (10%) with Error::InvalidFeeBps.
  • init() now validates platform_fee_bps at initialization time using the same helper.
  • Added 9 New Tests for the Platform Fee getter?setter

closes #46

@ahmadogo
Copy link
Copy Markdown
Contributor

Hii @7maylord Please resolve Conflict

@7maylord
Copy link
Copy Markdown
Contributor Author

@ahmadogo Resolved, please review.

@ahmadogo
Copy link
Copy Markdown
Contributor

@7maylord One more Conflict

sorry

@7maylord
Copy link
Copy Markdown
Contributor Author

Done @ahmadogo

@7maylord
Copy link
Copy Markdown
Contributor Author

Hi @ahmadogo any updates on merge??

@ahmadogo
Copy link
Copy Markdown
Contributor

Hi @ahmadogo any updates on merge??

Sorry Boss

will merge NOW

@ahmadogo ahmadogo merged commit 0bd9b2a into MentoNest:main Feb 24, 2026
1 check failed
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.

Platform Fee Configuration

2 participants