Sweepr
← All guides

Set up token gating

Require NFT or token ownership to enter. · 4 min read

Two places you can gate

A campaign-wide gate blocks entry entirely unless the wallet holds the token. Use this when the whole giveaway is for holders.

A per-action gate makes one entry method holder-only while the rest of the campaign stays open. Use this when you want holders to get extra tickets rather than exclusive access.

What you need

The chain, the contract address, and the standard — ERC-721, ERC-1155, ERC-20, or Solana SPL. For ERC-1155 you also need the token id; for fungible tokens you can set a minimum balance in whole tokens.

Solana works the same way: set the chain to Solana and use the token mint address. Fungible SPL tokens and NFTs both work.

How the check works

The entrant signs a message with their wallet, which proves they control it. We then read the balance on-chain over a public RPC. Neither half can be faked from the browser — the signature proves ownership of the address, and the balance comes from the chain rather than from anything the client sent.

Every check is logged with the balance found and whether it passed, so you can show the gate was actually applied.

Rate limits

Public RPCs are fine for modest traffic and will throttle under load. If you expect a busy campaign, set the RPC environment variable for your chain to a dedicated endpoint (Alchemy, Helius, or your own node).

next

Embed on your website

Add the campaign widget to any page.