Feat: add fee distribution contract logic for treasury and rewards#26
Merged
Conversation
Contributor
|
@Jagadeeshftw how long more before thr pr is eday for review? make sure to fix build error. you have till 5pm gmt to fix this |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a fee distribution smart contract for splitting fees between the platform treasury and reward pools. Key changes include:
- Addition of a new fees module in lib.rs.
- Implementation of FeeSplitterContract with configuration, fee distribution logic, event emission, and state tracking.
- Updates in state management and error handling for the fee distribution process.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib.rs | Added the fees module export to integrate the new fee distribution logic. |
| src/fees.rs | Introduced FeeSplitterContract and associated functions for configuration and fee distribution. |
Contributor
Author
|
@portableDD Build error is fixed, let me know if you have any other comments |
…ross the contract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements a fee distribution smart contract (
FeeSplitterContract) for splitting collected fees between the platform treasury and reward pools. The contract supports configuration, immediate allocation, state tracking, and event emission for transparency.Related Issues
Closes #15
Implements requirements from internal issue: Implement fee splitting logic to distribute collected fees between the platform treasury and reward pools.
Changes Made
FeeSplitterContractinsrc/fees.rswith initialization and update functions for configuration (addresses and basis points)src/lib.rsto include the new contract moduleHow to Test
distribute_feeswith a token address, amount, and fee collector address.get_total_distributedto verify the tracking of amounts for each token.Screenshots (if applicable)
N/A
Checklist