> For the complete documentation index, see [llms.txt](https://spree-finance.gitbook.io/spreefinance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spree-finance.gitbook.io/spreefinance/developer-guides/stable-points-sp/whitelist-management.md).

# Whitelist Management

Spree uses whitelists to control token transfers at the contract level. Three separate whitelists exist across two contracts.

### SP Transfer Whitelist (Points Contract)

SP tokens restrict transfers to whitelisted addresses. Both sender and receiver must be whitelisted, or the transfer reverts.

#### Add to Whitelist

```typescript
import { Points } from '@spree-finance/spree-evm-sdk';

const points = new Points(config);

const addTx = await points.addToTransferWhitelist('0xNewAddress');
```

#### Remove from Whitelist

```typescript
const removeTx = await points.removeFromTransferWhitelist('0xAddress');
```

#### Check Whitelist Status

```typescript
const isWhitelisted = await points.readIsTransferWhitelisted('0xAddress');
// or
const isOnList = await points.readTransferWhitelist('0xAddress');
```

### Factory Mint/Redeem Whitelists

The Factory contract maintains separate whitelists for minting and redeeming operations.

#### Mint Whitelist

```typescript
import { Factory } from '@spree-finance/spree-evm-sdk';

const factory = new Factory(config);

// Add address to mint whitelist
const addMintTx = await factory.addToMintWhitelist('0xAddress');

// Remove from mint whitelist
const removeMintTx = await factory.removeFromMintWhitelist('0xAddress');

// Check status
const canMint = await factory.readMintWhitelist('0xAddress');
```

#### Redeem Whitelist

```typescript
// Add address to redeem whitelist
const addRedeemTx = await factory.addToRedeemWhitelist('0xAddress');

// Remove from redeem whitelist
const removeRedeemTx = await factory.removeFromRedeemWhitelist('0xAddress');

// Check status
const canRedeem = await factory.readRedeemWhitelist('0xAddress');
```

### SpreeVault4626 Transfer Whitelist

The yield vault has its own transfer whitelist, separate from the Points whitelist.

```typescript
import { SpreeVault4626 } from '@spree-finance/spree-evm-sdk';

const vault = new SpreeVault4626(config);

// Set whitelist status (true = allowed, false = blocked)
const setTx = await vault.setTransferWhitelist('0xAddress', true);

// Check status
const allowed = await vault.readTransferWhitelist('0xAddress');
```

### pSP Transfer Whitelist (PendingSPVault)

pSP transfers are campaign-scoped. Use `transferWithCampaign` for pSP transfers between users. The campaign admin controls who can transfer via the campaign's admin settings.

```typescript
import { PendingSPVault } from '@spree-finance/spree-evm-sdk';

const psp = new PendingSPVault(config);

// Transfer pSP within a campaign
const transferTx = await psp.transferWithCampaign(
  1n,              // campaignId
  '0xFrom',
  '0xTo',
  100_000_000_000_000_000_000n,
);
```

### Required Roles

| Operation                | Contract       | Required Role        |
| ------------------------ | -------------- | -------------------- |
| SP transfer whitelist    | Points         | DEFAULT\_ADMIN\_ROLE |
| Mint whitelist           | Factory        | MANAGER\_ROLE        |
| Redeem whitelist         | Factory        | MANAGER\_ROLE        |
| Vault transfer whitelist | SpreeVault4626 | DEFAULT\_ADMIN\_ROLE |
| pSP campaign admin       | PendingSPVault | CAMPAIGN\_ADMIN      |
