Skip to main content

token-gate-ucash

Zero-dependency on-chain token-gating for U.CASH. Verify a wallet holds a minimum amount of UCASH (or any ERC-20, or the native coin) to gate access: memberships, premium tiers, content paywalls, role grants. No keys, no signing, just a read-only RPC balance check.

Install

pip install token-gate-ucash

From source: pip install git+https://github.com/UdotCASH/token-gate-ucash.

Installs a token-gate CLI: token-gate 0xWALLET 100 any returns PASS/FAIL (exit code 0/1). Python and JavaScript, zero dependencies.

Use it to:

  • Gate a Discord role, a membership, or a page by UCASH holdings.
  • Verify any ERC-20 (or native) balance on any EVM chain.
  • Tie into U.CASH's "verify holdings" premium tiers + custom-token gating.

UCASH gating

from token_gate import holds_ucash, holds_ucash_any_chain

ok, balance = holds_ucash("0xWALLET", 100, chain="ethereum")      # one chain
ok, balance, chain = holds_ucash_any_chain("0xWALLET", 100)        # ETH or Polygon or Base
if ok:
    grant_access()
const { holdsUcash, holdsUcashAnyChain } = require('./token-gate.js');
const { ok, balance } = await holdsUcash('0xWALLET', 100, 'base');
const { ok, chain } = await holdsUcashAnyChain('0xWALLET', 100);

CLI: python token_gate.py 0xWALLET 100 anyPASS/FAIL.

Any token / native

holds(rpc_url, wallet, min_amount, token_address="0xTOKEN", decimals=18)
holds(rpc_url, wallet, min_amount)  # native coin (ETH/MATIC/...), 18 decimals

UCASH contracts

Ethereum 0x92e52a1A235d9A103D970901066CE910AAceFD37, Polygon 0xA94880d3A4b39746E90Cdb57f8De3732c984DE14, Base 0x26cf750abAf38aF7109Effdbdf79bA50d2EE09A1 (8 decimals).

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

token_gate_ucash-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

token_gate_ucash-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file token_gate_ucash-0.1.1.tar.gz.

File metadata

  • Download URL: token_gate_ucash-0.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for token_gate_ucash-0.1.1.tar.gz
Algorithm Hash digest
SHA256 451cf8e1dfbb366ab31bbb27b102170c9054e334c506266f2e4d4604e6cd6bb7
MD5 8cdc1af5816759e00618855f9ca50247
BLAKE2b-256 4763a3f39bb6e8809940a032747b4ead238cf28ad87558f67ef4eaf5dda3a47b

See more details on using hashes here.

File details

Details for the file token_gate_ucash-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for token_gate_ucash-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 181f6e2c4287daea00b737d0012d6d787d633bd050721fa08c8f1cd1e5bd55bd
MD5 1a4a1f4b681866095702bc535135e132
BLAKE2b-256 fa0910c8df4c326fec80fee2650f9941063f68a612ec4312074ca6edb5a9f22e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page