Buying memecoins or swapping assets directly from chat applications (Twitter, Discord, etc.) is cumbersome and error-prone.
Leverage ERC-7710 & ERC-7715 to delegate spending permissions to an on-chain Delegate Locker contract.
The contract may spend a user's funds only when presented with a valid zkTLS proof that the user actually posted the required chat message.
The current demo:
- Network: Sepolia
- Flow: Buy any token with ETH through CoW Swap
- User opens the site; prompted to install MetaMask Flask if needed.
- User connects to Twitter with OAuth.
- The UI shows the Delegator/Gator smart-account address — user funds it with ETH.
- A UserOperation creates an ERC-7715 delegation that allows Text Swap's Delegate/session account to spend up to a defined limit.
- A background service watches Twitter for messages of the form:
@locker_money buy token: 0xTokenAddress amount: 1 - When a matching tweet is found, Reclaim Protocol is used to generate a zkTLS proof of the tweet's existence.
- The proof is submitted (via another UserOperation) to the Delegate/session account which, after verification, swaps the user's ETH for the requested token on CoW Swap (Sepolia).
- The purchased tokens are transferred back to the user's Delegator/Gator account.
- OAuth flow for Twitter and Discord.
- Integrate zkTLS prover service.
- Support arbitrary ERC-20 amounts & decimals.
- Extend beyond ETH→Token swaps.
- Production deploy & audits.
pnpm i
pnpm dev
- Set
.env.localwith:NEXT_PUBLIC_BASE_URL=https://<your-ngrok>.ngrok.app NEXT_PUBLIC_TWITTER_CLIENT_ID=... TWITTER_CLIENT_SECRET=... - Run an ngrok tunnel to expose port 3000.
- Configure the same callback URL in the Twitter Developer Portal.