Implement whitelist mode for farming pool contract#53
Open
Jonbaz32 wants to merge 2 commits into
Open
Conversation
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.
Closes #38
Description
This pull request implements the opt-in whitelist mode for the
farming-poolcontract, enabling pool admins to restrict stakes and lockups to pre-approved addresses (e.g., for invite-only campaigns or KYC compliance).Key Features Implemented:
PoolErrordefinitions: Combined the duplicatedPoolErrordefinitions intypes.rsinto a single clean enum, addingNotWhitelisted = 15.WhitelistEnabledandWhitelisted(Address)variants toDataKeyintypes.rs.enable_whitelist,disable_whitelist,add_to_whitelist,remove_from_whitelist, andbatch_add_to_whitelist(with a size check of max 50 addresses per call). All admin methods require admin authentication.stakeandlock_assetsto reject non-whitelisted transactions when the whitelist mode is active.Whitelisted(Address)records when queried or added.test.rsvalidating default behavior (open pool), enabling/disabling, single user whitelisting/removal, batch whitelisting, and the batch limit boundary check.