SanctionsComplianceUpgradeable

Git Source

Inherits: Initializable

Author: transientlabs.xyz

Abstract contract to comply with U.S. sanctioned addresses

Uses the Chainalysis Sanctions Oracle for checking sanctions

State Variables

SanctionComplianceStorageLocation

bytes32 private constant SanctionComplianceStorageLocation =
    0xd66684c5a7747baca4a45cbf84c01526f3b53186fc4aea64a4c6e2fa4447c700;

Functions

_getSanctionsComplianceStorage

function _getSanctionsComplianceStorage() private pure returns (SanctionComplianceStorage storage $);

__SanctionsCompliance_init

Function to initialize the contract

function __SanctionsCompliance_init(address initOracle) internal onlyInitializing;

Parameters

NameTypeDescription
initOracleaddressThe initial oracle address

__SanctionsCompliance_init_unchained

unchained function to initialize the contract

function __SanctionsCompliance_init_unchained(address initOracle) internal onlyInitializing;

Parameters

NameTypeDescription
initOracleaddressThe initial oracle address

_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

oracle

Function to get chainalysis oracle

function oracle() public view returns (IChainalysisSanctionsOracle);

Events

SanctionsOracleUpdated

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

Errors

SanctionedAddress

Sanctioned address by OFAC

error SanctionedAddress();

Structs

SanctionComplianceStorage

struct SanctionComplianceStorage {
    IChainalysisSanctionsOracle oracle;
}