Closed PavelInjective closed 1 month ago
The changes introduce an OfacChecker
to the chainClient
, enhancing its functionality to verify addresses against the OFAC blacklist. The NewChainClient
function is updated to check if an address is blacklisted upon initialization. Modifications are made to the BuildGenericAuthz
and BuildExchangeAuthz
methods to include checks for the granter's address. A new test function, TestOfacList
, is added to validate the OFAC list handling. Additionally, an example program for downloading the OFAC list is introduced, along with a new JSON file containing blacklisted addresses.
Files | Change Summary |
---|---|
client/chain/chain.go , client/chain/ofac.go |
Introduced OfacChecker struct and integrated OFAC checks into chainClient methods and initialization logic. |
client/chain/chain_test.go |
Added OfacTestSuite with TestOfacList to validate OFAC list handling and ensure proper error handling for blacklisted addresses. |
examples/chain/ofac/1_DownloadOfacList/example.go |
Created a Go program to download the OFAC list using the chainclient module. |
client/metadata/ofac.json |
Added a JSON file containing blacklisted Ethereum addresses for compliance checks. |
sequenceDiagram
participant User
participant ChainClient
participant OfacChecker
User->>ChainClient: Initialize with address
ChainClient->>OfacChecker: Check if address is blacklisted
OfacChecker-->>ChainClient: Return blacklist status
ChainClient-->>User: Proceed or return error
🐇 In the code we trust,
With checks that are a must,
OFAC's list we now embrace,
Ensuring compliance in our space.
With each address we verify,
No blacklisted ones slip by!
Hooray for security, hip-hip-hooray! 🎉
client/chain/chain.go (1)
`324-324`: **LGTM!** The changes to initialize the `ofacChecker` and check if the account's address is blacklisted in the `NewChainClient` function are approved. This enhances the security by preventing the creation of a chain client for blacklisted addresses. Also applies to: 445-459
Summary by CodeRabbit
New Features
OfacChecker
to manage and verify addresses against the OFAC blacklist.Bug Fixes
Tests
Documentation