Repository navigation
Replace the Whitelist transfer hook with Allow List, and remove Block List - #208
Merged
Merged
Conversation
added 3 commits
November 5, 2026 23:13
…limit The whitelist kept every allowed address in one account, capped at eleven entries and shared by every mint. Its setup instruction used `init_if_needed` and made the caller the list's authority each time, so anyone could take over the list by setting up the hook for a mint of their own. Allow List gives each mint its own allow list account (PDA seeds "allow_list", mint) holding the authority, and each allowed wallet its own account (PDA seeds "allowed_wallet", mint, wallet). `allow_wallet` creates a wallet's account and `disallow_wallet` closes it. Setup now requires the mint authority's signature and uses `init`. The hook's one extra account is derived per transfer from the mint and the destination token account's owner, and a transfer to a wallet without an account fails with `RecipientNotAllowed` instead of panicking. All three variants (Anchor v1, Anchor v2, Quasar) change together, with tests for allowing, disallowing, per-mint scoping, fifty allowed wallets, and the takeover attempts. The lending and managed-fund docs say "allow list" too. Claude-Session: https://claude.ai/code/session_01GZHin7uZN95tCycB2vWhog
Block List was a Pinocchio-only example with no catalog entry. Its one account per blocked wallet is what Allow/Block List does in Block mode, in Anchor v1, Anchor v2 and Quasar, so it duplicated that example. `whitelist/` and `block-list/` each keep a README.md saying where the example went, so old links still land somewhere useful. Claude-Session: https://claude.ai/code/session_01GZHin7uZN95tCycB2vWhog
Resolve CHANGELOG.md (keep both new entries, this one dated 2026-11-07 on top) and README.md (keep main's new NFTs section, drop the Whitelist entry this branch replaces). Use 'anchor program deploy' in the Allow List READMEs, matching main's change to every other Anchor README. Claude-Session: https://claude.ai/code/session_01GZHin7uZN95tCycB2vWhog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Whitelist transfer hook had four problems:
max_len(11).seeds = [b"white_list"]).initialize_extra_account_meta_listopened the list withinit_if_neededand setauthority = payeron every call, so setting up the hook for any mint of your own made you the authority of everyone's list.panic!.Block List was a Pinocchio-only example with no catalogue entry. Its design, one account per blocked wallet, is what Allow/Block List already does in Block mode, in Anchor v1, Anchor v2 and Quasar.
Changes
Whitelist becomes Allow List (
tokens/token-extensions/transfer-hook/allow-list/). All three variants (Anchor v1, Anchor v2, Quasar) change together, and the program ID is unchanged."allow_list"and the mint. It holds the list'sauthority."allowed_wallet", the mint and the wallet. If the account exists, the wallet is allowed, so the list has no size limit.add_to_whitelistis replaced byallow_wallet. The newdisallow_walletcloses a wallet's account and returns its rent.initialize_extra_account_meta_listrequires the mint authority's signature and usesinit, so only the issuer can set up a mint's list.RecipientNotAllowed(in Quasar, custom error 6000).Block List removed.
tokens/token-extensions/transfer-hook/block-list/is deleted.Notices.
whitelist/README.mdandblock-list/README.mdremain in the old paths, saying where each example went.Docs. The root README catalogue, the root
Cargo.tomlworkspace member,Cargo.lock,scripts/generate-quasar-readmes.mjsandCHANGELOG.mdare updated. The lending and managed-fund docs now say "allow list" instead of "whitelist".Tests
The tests cover:
cargo fmt --checkandcargo clippy -p transfer-hook-allow-list -- -D warningsare clean.The Quasar program was compiled with
cargo-build-sbfand tested from that build.quasar build, which also generates the IDL and clients, wasn't run locally, so CI is its first run.Generated by Claude Code