Demo pieces for the Tezos X / CRAC XButton flow: EVM deposits, relayer → Tezlink, Michelson game state.
Testnet funds: Hosted faucet for TezosX EVM (USDC / XTZ): https://tezosx-evm-usdc-airdrop.vercel.app/ — use the same wallet you use in the demo frontend.
| Area | Role |
|---|---|
| Frontend | React + Vite: browser wallet, Tezlink polling, USDC to escrow, CRAC calls. |
| Relayer | Node: watches escrow Deposited events, Micheline payload, CRAC callMichelson → record_deposit. |
| Contracts | EVM (xUSDC, xEscrow) under contracts/evm; Tezlink game (LIGO / Michelson) under contracts/tezlink. |
- Connect a wallet in the frontend on the TezosX EVM network.
- Approve/deposit 1 USDC to the configured escrow (pot) address.
- The relayer sees the deposit and forwards it through the CRAC precompile.
- The Michelson contract updates pot, last player (Tezlink identity), and last player EVM bytes (when the on-chain session is active).
- The frontend polls Tezlink and shows live state (EVM last player is read from contract storage).
Point .env at your deployment; defaults in the repo target the public demo RPCs:
- EVM RPC:
https://demo.txpark.nomadic-labs.com/rpc - Tezlink RPC:
https://demo.txpark.nomadic-labs.com/rpc/tezlink - Chain ID:
127124 - Demo USDC / pot /
KT1game contract — see each package’s.env.example; README values can drift.
The EVM RPC exposes tez_getEthereumTezosAddress and tez_getTezosEthereumAddress (chain docs). The relayer uses tez_getEthereumTezosAddress when building record_deposit so Tezlink last_player matches Tezos.get_sender () on claim (NOT_LAST_PLAYER otherwise). The contract also stores the depositor’s raw EVM address in last_player_evm, so the relayer can payout and the frontend can show the winner without reversing KT1 → 0x. mark_paid remains permissionless aside from existing storage guards.
From the root of your clone:
npm install
npm run devThat runs the frontend and relayer together (see root package.json). Configure env files in each app (see their .env.example files).
- Relayer must be running or Tezlink state will not update after deposits.
- An active session on the game contract is required for
record_depositto apply. - Override the default faucet link in the frontend via
VITE_FAUCET_URLif you use another tap. - Start new session / claim / payout flow is documented in
contracts/tezlink/README.md. - Subdirectories include their own READMEs for detail.