How does it work?
By hooking thetransfer and transferFrom functions of the ERC-20 contract into the Rules Engine with a policy that checks if the receiving wallet is on the OFAC sanctions list before allowing the transfer to complete.
Let’s break that down further.
The Office of Foreign Assets Control (OFAC) maintains a list of Specially Designated Nationals (SDN) and blocked addresses that U.S. persons are prohibited from transacting with. When a token transfer is initiated, the Rules Engine queries an onchain sanctions screening contract (such as Chainalysis’s Oracle) to check if the recipient address is sanctioned. If the recipient is on the sanctions list, the transaction reverts immediately, preventing any transfer of value to that address. This happens before any tokens move, ensuring full compliance. This is essential for:- Regulatory compliance: Meet U.S. sanctions requirements for digital assets
- Risk management: Protect your protocol from association with sanctioned entities
- Institutional adoption: Demonstrate robust compliance controls to institutional users
Implementation
The most common approach is to check against an OFAC sanctions list maintained by Chainalysis, which automatically updates the list for many popular EVM networks. If you’re project is on a different network or you’re still in testnet you’ll need to deploy a mock version of the contract to test against. The policy uses Foreign Calls to query the sanctions screening contract. You’ll need to:- Deploy or integrate with a sanctions screening oracle (e.g., Chainalysis)
- Update the
Addressfield in the Foreign Calls to point to your oracle adapter contract - Ensure the oracle contract implements the
isSanctioned(addr)function
Policy JSON
The policy example above is using the Chainalysis maintained OFAC list on Ethereum
(
0x40C57923924B5c5c5455c48D93317139ADDaC8fb). You can find the oracle address for other networks
here: Chainalysis maintained OFAC
oracles.It’s critical that you add the rule to both the
transfer and transferFrom functions to ensure
sanctioned addresses cannot receive tokens through any transfer method.