- OFAC Sanctions Screening: Prevents transfers to sanctioned addresses
- KYC Access Level Requirement: Ensures recipients have completed appropriate KYC verification

Martian Mining Demo
See the $KRYPT token and Rules Engine in action on the live demo site
Policy Overview
The $KRYPT policy enforces compliance checks on every transfer operation. When a user attempts to transfer tokens, the Rules Engine:- Checks if the recipient is on the OFAC sanctions list
- Verifies the recipient has completed sufficient KYC verification
- Only allows the transfer if both checks pass
Policy Definition
Here’s the complete policy configuration for the $KRYPT token:How the Rules Work
OFAC Sanctions Screening
The OFAC rules query an onchain oracle contract to check if the recipient address is on the sanctions list:- Foreign Call:
isDenied(address)returnstrueif the address is sanctioned - Rule Logic: If
FC:OFACDeniedForTransfer == false, the transfer is blocked - Result: Sanctioned addresses cannot receive $KRYPT tokens
KYC Access Level Requirement
The KYC rules verify that the recipient has completed appropriate identity verification:- Foreign Call:
getAccessLevel(address)returns auint256representing KYC level (0 = no KYC, >0 = KYC completed) - Rule Logic: If
FC:KYCDeniedForTransfer > 0, the wallet has completed KYC - Result: Only KYC-verified wallets can receive $KRYPT tokens
Both rules check the recipient (
to) address, not the sender. This ensures compliance is
maintained for all token holdings, preventing tokens from entering non-compliant wallets
regardless of who initiates the transfer.Contract Integration
TheKryptToken contract integrates with the Rules Engine by inheriting from RulesEngineClientCustom and applying modifiers to the transfer functions:
Rule Execution Flow
When a user attempts to transfer $KRYPT tokens:- User calls
transfer()ortransferFrom(): The transaction is initiated - Rules Engine intercepts: The modifier
checkRulesBeforeTransferorcheckRulesBeforeTransferFromexecutes first - Foreign Calls execute:
OFACDeniedForTransferchecks the recipient against the sanctions listKYCDeniedForTransferchecks the recipient’s KYC status
- Rules evaluate:
- If recipient is sanctioned → transaction reverts
- If recipient lacks KYC → transaction reverts
- If both checks pass → transfer proceeds
- Transfer executes: If all rules pass, the standard ERC-20 transfer completes
Why Both Functions Are Protected
The policy includes rules for bothtransfer and transferFrom to ensure comprehensive coverage:
transfer(): Direct transfers where the sender is the token ownertransferFrom(): Approval-based transfers using allowances
It’s critical to protect both functions to prevent bypassing compliance checks through
allowance-based transfers.
Learn More
- See this implementation live at martianmining.io
- Learn about OFAC Sanctions Screening
- Learn about KYC Gate
- Understand Foreign Contracts for integrating external data sources