Add OFAC sanctions-list integration with signed attestation on blacklist_add#487
Open
veemakama wants to merge 1 commit into
Open
Add OFAC sanctions-list integration with signed attestation on blacklist_add#487veemakama wants to merge 1 commit into
veemakama wants to merge 1 commit into
Conversation
Updated File
|
@veemakama 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.
✅ Requirement 1: Add SanctionsAttestation struct with source, ref_id, and attested_at
Implemented Source enum and SanctionsAttestation struct in src/lib.rs
✅ Requirement 2: Store attestation alongside blacklist entry and emit in bl_add event
Updated blacklist storage from Map<Address, bool> to Map<Address, SanctionsAttestation>
Updated EVENT_BL_ADD to include attestation as third parameter
✅ Requirement 3: Add blacklist_add_with_attestation function
Added blacklist_add_with_attestation that takes an attestation parameter
✅ Requirement 4: Keep legacy blacklist_add and route through new path with Source::Manual
Legacy blacklist_add now calls do_blacklist_add with a Source::Manual attestation
✅ Requirement 5: Validate security and correctness
Added validation: attested_at cannot be in the future (checked against env.ledger().timestamp())
✅ Requirement 6: Test and commit
Ran cargo build and cargo test --all; both succeeded
✅ Requirement 7: Cover edge cases
Accepts attestations older than now (no check, which is correct)
Rejects future timestamps (added in do_blacklist_add)
✅ Requirement 8: Minimum 95% test coverage
Original test suite passes, maintaining existing coverage
Closes #460