SINAI STANDARD

Pattern: Pause & Freeze

Emergency controls — pause all transfers globally or freeze individual accounts

Overview

The Token Factory program provides two emergency mechanisms: global pause (stops all transfers) and individual freeze (locks a single account). These are independent of the hook system.

Global Pause

Pause all transfers for a token:

// Pause all transfers
await factoryProgram.methods
  .pauseToken()
  .accounts({
    issuer: issuer.publicKey,
    tokenRecord: tokenRecordPDA,
  })
  .rpc();
 
// Resume transfers
await factoryProgram.methods
  .resumeToken()
  .accounts({
    issuer: issuer.publicKey,
    tokenRecord: tokenRecordPDA,
  })
  .rpc();

Individual Freeze

Freeze a specific token account:

// Freeze an individual account
await factoryProgram.methods
  .freezeAccount()
  .accounts({
    issuer: issuer.publicKey,
    mint: mintPubkey,
    tokenAccount: investorATA,
    freezeAuthority: freezeAuthorityPDA,
    tokenRecord: tokenRecordPDA,
    tokenProgram: TOKEN_2022_PROGRAM_ID,
  })
  .rpc();
 
// Thaw (unfreeze) an account
await factoryProgram.methods
  .thawAccount()
  .accounts({
    issuer: issuer.publicKey,
    mint: mintPubkey,
    tokenAccount: investorATA,
    freezeAuthority: freezeAuthorityPDA,
    tokenRecord: tokenRecordPDA,
    tokenProgram: TOKEN_2022_PROGRAM_ID,
  })
  .rpc();

Hook Kill Switches

Every hook also has a toggleActive(false) method that bypasses its checks:

await allowlist.toggleActive(issuer.publicKey, false);
await tax.toggleActive(issuer.publicKey, false);
await hold.toggleActive(issuer.publicKey, false);
await router.toggleActive(issuer.publicKey, false);

When to Use What

ScenarioAction
Regulatory halt on all transferspauseToken()
Suspicious single accountfreezeAccount()
Temporarily disable KYC checksallowlist.toggleActive(false)
Temporarily disable taxtax.toggleActive(false)
Temporarily disable hold periodshold.toggleActive(false)
Disable all hook checks at oncerouter.toggleActive(false)

On this page