Skip to content

Feat/issue 54 blacklist#283

Merged
chukwudiikeh merged 2 commits intoQuorumCredit:mainfrom
rayeberechi:feat/issue-54-blacklist
Mar 26, 2026
Merged

Feat/issue 54 blacklist#283
chukwudiikeh merged 2 commits intoQuorumCredit:mainfrom
rayeberechi:feat/issue-54-blacklist

Conversation

@rayeberechi
Copy link
Copy Markdown
Contributor

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

  • New Storage Key: Added DataKey::Blacklisted(Address) to persistent storage to track banned borrowers.
  • Admin Function:
    • Implemented pub fn blacklist(env: Env, admin_signers: Vec<Address>, borrower: Address).
    • Secured with the existing multi-sig require_admin_approval logic.
  • Borrowing Restriction:
    • Modified request_loan to include an early-exit check.
    • If a borrower is blacklisted, the contract now returns Err(ContractError::Blacklisted).
  • View Function: Added is_blacklisted(borrower) -> bool to allow off-chain interfaces and users to verify the status of an address.
  • Error Handling: Introduced 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 subsequent try_request_loan calls 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 stash verification confirmed that this PR introduces zero new errors and follows the established project architecture.

Closes #54

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@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! 🚀

Learn more about application limits

@chukwudiikeh chukwudiikeh merged commit 3a8b732 into QuorumCredit:main Mar 26, 2026
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.

Issue 54 Implement blacklist Function for Repeat Defaulters

2 participants