SINAI STANDARD

Pattern: Denylist (Sanctions)

Block specific wallets from transferring tokens — sanctions compliance

Overview

The denylist pattern is the inverse of the allowlist: all wallets can transfer except those explicitly blocked. Useful for OFAC sanctions compliance or blocking bad actors.

Implementation

import { AllowlistManager } from "@sinai-standard/sdk";
 
const allowlist = new AllowlistManager(allowlistProgram, token.mint);
await allowlist.initialize(issuer.publicKey, "denylist");
await allowlist.initializeExtraAccountMetas(issuer.publicKey);
 
// Block sanctioned addresses
await allowlist.addWallets(issuer.publicKey, [
  sanctionedAddress1,
  sanctionedAddress2,
]);
 
// All wallets can transfer EXCEPT those on the denylist

Key Points

  • Uses the same AllowlistManager class — just pass "denylist" as the mode
  • addWallets() blocks wallets in denylist mode
  • removeWallets() unblocks wallets
  • The issuer does not need to be added to the list (they're allowed by default)
  • Can be combined with other hooks via the Router

On this page