Feature: Participant blacklist and whitelist#347
Merged
Jagadeeshftw merged 3 commits intoJagadeeshftw:masterfrom Jan 31, 2026
Merged
Feature: Participant blacklist and whitelist#347Jagadeeshftw merged 3 commits intoJagadeeshftw:masterfrom
Jagadeeshftw merged 3 commits intoJagadeeshftw:masterfrom
Conversation
- Add participant blacklist/whitelist module to bounty_escrow contract - Persistent storage for blacklisted/whitelisted addresses with reasons - Optional whitelist-only mode for compliance enforcement - Event emission for all blacklist/whitelist modifications - Three public admin functions: set_blacklist, set_whitelist, set_whitelist_mode - Integrate checks in lock_funds (early validation) and release_funds (recipient validation) - New error type: ParticipantNotAllowed (error code 21) - Comprehensive test suite validating blacklist enforcement and whitelist-only mode - All tests passing, build succeeds with 0 errors
|
@Samaro1 is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
LGTM! |
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.
This introduces participant blacklist and whitelist enforcement to the bounty_escrow contract, adding compliance and abuse-prevention controls while preserving existing default behavior. Admins can block sanctioned or malicious addresses, optionally restrict participation to a verified set, and audit every change through emitted events.
The core logic is implemented in
contracts/bounty_escrow/contracts/escrow/src/blacklist.rs and integrated into the main contract.
Key Features
Compliance Controls
Blacklist addresses to prevent them from locking or receiving funds
Optional whitelist-only mode to allow only verified participants
Unified validation via is_participant_allowed() used by core flows
Admin APIs
set_blacklist(env, address, blocked, reason)
set_whitelist(env, address, whitelisted)
set_whitelist_mode(env, enabled)
All modification functions require admin authorization.
Contract Enforcement
lock_funds() rejects blacklisted or non-whitelisted (in whitelist mode) depositors
release_funds() prevents transfers to blocked recipients
New error: ParticipantNotAllowed
Storage and Performance
Persistent maps for blacklist and whitelist data
Optional reason stored for blacklisted entries
Lookup for all checks
Events and Audit Trail
AddressBlacklisted / AddressUnblacklisted
AddressWhitelisted / AddressUnwhitelisted
WhitelistModeToggled
Every compliance action emits an event for traceability.
Backward Compatibility
Feature is opt-in; whitelist mode is disabled by default
Existing flows continue to work unchanged unless an address is explicitly blocked or whitelist mode is enabled
No breaking changes to existing contract state or API
Feature Tests
Dedicated blacklist/whitelist test suite: 2/2 passing
Blacklisted address cannot call lock_funds
Whitelist-only mode blocks non-whitelisted addresses
Core Contract Tests
Core initialization and fund flow tests compile and run successfully alongside the new checks
Integration Points Verified
Early participant validation added to lock_funds
Recipient validation added to release_funds
Both paths return ParticipantNotAllowed on violation
Files Added
contracts/bounty_escrow/contracts/escrow/src/blacklist.rs
contracts/bounty_escrow/contracts/escrow/src/test_blacklist.rs
Files Modified
contracts/bounty_escrow/contracts/escrow/src/lib.rs
Integrated blacklist module
Added participant validation in lock_funds and release_funds
Exposed admin management functions
Added ParticipantNotAllowed error
Closes #307