SanctionsCompliance

Git Source

Author: transientlabs.xyz

Abstract contract to comply with U.S. sanctioned addresses

Uses the Chainalysis Sanctions Oracle for checking sanctions

State Variables

oracle

IChainalysisSanctionsOracle public oracle;

Functions

constructor

constructor(address initOracle);

_updateSanctionsOracle

Internal function to change the sanctions oracle

function _updateSanctionsOracle(address newOracle) internal;

Parameters

NameTypeDescription
newOracleaddressThe new sanctions oracle address

_isSanctioned

Internal function to check the sanctions oracle for an address

Disable sanction checking by setting the oracle to the zero address

function _isSanctioned(address sender, bool shouldRevertIfSanctioned) internal view returns (bool isSanctioned);

Parameters

NameTypeDescription
senderaddressThe address that is trying to send money
shouldRevertIfSanctionedboolA flag indicating if the call should revert if the sender is sanctioned. Set to false if wanting to get a result.

Returns

NameTypeDescription
isSanctionedboolBoolean indicating if the sender is sanctioned

Events

SanctionsOracleUpdated

event SanctionsOracleUpdated(address indexed prevOracle, address indexed newOracle);

Errors

SanctionedAddress

Sanctioned address by OFAC

error SanctionedAddress();