Feat/issue 54 blacklist#283
Merged
chukwudiikeh merged 2 commits intoQuorumCredit:mainfrom Mar 26, 2026
Merged
Conversation
|
@rayeberechi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Overview
This PR implements a blacklisting mechanism to permanently ban addresses from the QuorumCredit protocol. This is a critical security feature to prevent repeat defaulters from accessing new loans.
Changes
DataKey::Blacklisted(Address)to persistent storage to track banned borrowers.pub fn blacklist(env: Env, admin_signers: Vec<Address>, borrower: Address).require_admin_approvallogic.request_loanto include an early-exit check.Err(ContractError::Blacklisted).is_blacklisted(borrower) -> boolto allow off-chain interfaces and users to verify the status of an address.ContractError::Blacklisted = 14.Unit Tests
test_is_blacklisted_defaults_to_false: Ensures new addresses are not banned by default.test_blacklist_prevents_loan_request: Confirms that once an admin blacklists a borrower, all subsequenttry_request_loancalls fail with the correct error.test_non_admin_cannot_blacklist: Verifies that unauthorized addresses cannot trigger a blacklist entry.Build Note
During development, it was confirmed that the repository has 56 pre-existing compile errors (largely related to legacy string encoding and duplicate definitions). A
git stashverification confirmed that this PR introduces zero new errors and follows the established project architecture.Closes #54