Token-gate Discord and Telegram on Optimism

Gate a Discord or Telegram group on OP Mainnet for token or NFT holders, OP delegates, EAS attestations and Farcaster followers.

To token-gate a Discord server or Telegram group for holders of a token or NFT on Optimism, create a role in Guild, add a Token balance or NFT Balance requirement with OP Mainnet as the chain, and give the role a Discord or Telegram reward. Members connect their wallets, Guild gives the Discord role or the group invite to everyone who holds enough, and takes it away when they sell. On OP Mainnet you can also gate on OP voting power, EAS attestations and Farcaster accounts. Discord and Telegram gating are on the Free plan.

On Guild, 12.9% of active guilds with a chain requirement check OP Mainnet, and those guilds hold 1.29 million memberships. See State of token-gated communities 2026.

OP Mainnet in Guild

Guild lists the Optimism chain under its official name, OP Mainnet: chain ID 10, with ETH as its native coin. Pick it in the chain picker of each requirement. Copy a token's or collection's address from the project's site or from a block explorer; Optimism's docs list explorer.optimism.io.

You want members who Requirement On OP Mainnet
Hold ETH Token balance, Native currency balance Yes
Hold an ERC-20 token, such as OP Token balance, ERC20 balance Yes
Hold an NFT NFT Balance Yes
Pass a check your contract answers Contract query Yes
Have an old or active wallet, or use a protocol Onchain activity Yes
Have an EAS attestation Be attested by Yes
Held a token at a snapshot, or for N days Held at a past block, Held continuously for No: Ethereum and Base only

You can also mint an NFT reward on OP Mainnet. Supported chains has the full table.

Set up the gate

  1. On your guild, choose Manage guild, open Spaces & roles, and create a role with New role, then Empty role.
  2. Under Who gets it, press Requirement, pick Token balance or NFT Balance, choose OP Mainnet, paste the contract address and set the amount.
  3. Under Unlocks, press Add reward and pick Discord or Telegram.

The full walkthrough is in Token-gate a Discord server and Token-gate a Telegram group.

OP holders and delegates

The OP token is built into OP Mainnet at a fixed address, 0x4200000000000000000000000000000000000042, listed in Optimism's protocol specification. It is an ERC-20 with voting: holders delegate voting power, to themselves or to someone else, and the token answers getVotes(address) with an address's current voting power.

  • OP holders: Token balance, ERC20 balance, OP Mainnet, that address, at least the amount you choose.
  • Delegates and active voters: Contract query, OP Mainnet, that address, the method getVotes(address), USER_ADDRESS in Input parameters, and under Output to check a bigint at least your threshold. The query returns raw units and OP has 18 decimals, so 100 votes is 100000000000000000000.

A holder who has never delegated, not even to themselves, has zero votes. Use the balance for "holders" and getVotes for "people who take part in governance". See Contract query.

EAS attestations

The Ethereum Attestation Service (EAS) is built into OP Mainnet: Optimism's protocol specification lists it as a predeployed contract at 0x4200000000000000000000000000000000000021. If you or a partner issue attestations there, Guild's Be attested by requirement turns them into a role:

  1. Press Requirement, pick Be attested by and choose OP Mainnet.
  2. In Reference, paste the address of the attester, the wallet or contract that issues the attestations.
  3. In Schema Id, paste the schema's UID. Find it on the EAS explorer for OP Mainnet (easscan.org): open the schema, or any attestation made with it, and copy the UID.
  4. Optionally check one field with Key and Value, then press Add requirement.

Copy the attester and schema from the issuer's own documentation or from the explorer rather than from a third party, and check the attestation is on OP Mainnet: an attestation on Base or Arbitrum One doesn't count for an OP Mainnet requirement. See Attestations.

Farcaster accounts

Farcaster's account registry contracts are deployed on OP Mainnet. Guild's Farcaster requirements check a member's connected Farcaster account rather than a chain: Follow a profile, Have at least [x] followers, or a value in their profile such as an FID. Combine one with a balance to gate on "holds OP and follows our account". See Farcaster.

USDC or USDC.e

Optimism's docs list two USDC tokens on OP Mainnet, and note that the bridged one is being deprecated:

Token Address
USDC, issued natively by Circle 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
USDC.e, bridged from Ethereum 0x7f5c764cbc14f9669b88837ca1490cca17c31607

To accept both while holders move over, add one requirement for each and set Members should meet to Any one.

No holding history on OP Mainnet

Held at a past block and Held continuously for need a full archive of the chain, and Guild runs its own only for Ethereum and Base. For a snapshot on OP Mainnet, export the holders at your block with your own tooling and upload the wallets as an Allowlist. To keep out fresh wallets, add Onchain activity, First transaction on OP Mainnet before a date.

Worked example: OP voters

A project wants a Discord role for OP delegates who follow it on Farcaster, and a Telegram group for people who use its app.

Role 1, "OP voters", for a Discord role:

  1. Contract query, OP Mainnet, the OP token, getVotes(address), ["USER_ADDRESS"], bigint at least 100000000000000000000 (100 OP).
  2. Follow a profile (Farcaster), the project's account.
  3. Members should meet: All.
  4. Reward: Discord, New role named "OP voters", Keep role once earned off.

Role 2, "App users", for the Telegram group:

  1. Onchain activity, Contract call, OP Mainnet, the app's contract and method, at least 3 in a Relative period of 30 days.
  2. Reward: Telegram, with the bot added to the private group.

A member whose voting power drops below 100 OP, or who unfollows, loses "OP voters" and its Discord role when Guild next checks. An app user who stops using it drops out of the 30-day window and is removed from the group.

FAQ

Is token-gating on OP Mainnet free?

Yes. Token, NFT, contract query, onchain activity, attestation and Farcaster requirements, and Discord and Telegram rewards, are on the Free plan. See Plans.

Is "Optimism" the same as OP Mainnet in Guild?

Yes. Optimism's mainnet is listed as OP Mainnet. Other chains built with the same software are separate chains in the picker, each with its own addresses.

Can holdings on OP Mainnet and Base count together?

Yes, as alternatives. Add one requirement per chain, each with that chain's address, and set Members should meet to Any one. Each requirement checks one chain, so balances on different chains aren't added together; set a threshold for each.

All Guild docs