Skip to content

Comments

feat: Implement Platform Fee Configuration#75

Open
7maylord wants to merge 3 commits intoMentoNest:mainfrom
7maylord:feat/platformFees
Open

feat: Implement Platform Fee Configuration#75
7maylord wants to merge 3 commits intoMentoNest:mainfrom
7maylord:feat/platformFees

Conversation

@7maylord
Copy link

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
Contributor

Hii @7maylord Please resolve Conflict

@7maylord
Copy link
Author

@ahmadogo Resolved, please review.

@ahmadogo
Copy link
Contributor

@7maylord One more Conflict

sorry

@7maylord
Copy link
Author

Done @ahmadogo

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