Swap tokens securely by sending a tweet, tg message, or any other post on any platform. Powered by MM Delegation Toolkit.
Most alpha about new tokens emerges from X, Discord, Telegram, or some other social media site. But it's notoriously hard to execute crypto transansactions from these platforms. Some solutions like Farcaster Frames exist, but they aren't compatible with existing websites.
With Text Swap, you can trade directly from your favorite social media app by simply posting a message like:
buy token: 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 ethAmount: 0.001 @locker_money
Under the hood, Text Swap uses ERC-7510/7515 delegations and zkTLS to securely trade on your behalf. The full flow is as follows:
Visit text-swap.vercel.app.
Install MetaMask Gator Permissions snap.
Text Swap requests permission to spend your funds via 7515. But the Text Swap session account is a forked version of HybridDeleGator. It is unable to redeem delegations unless a valid zkTLS proof is provided confirming your tweet.
Post a tweet in the correct format "buy token: 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 ethAmount: 0.001 @locker_money".
Text Swap detects tweet and redeems delegation via 7510.
Within same tx, ETH is sent to Text Swap session account, then swapped into the desired token and returned to you.
Although this demo was made with Twitter, any social media platform available over TLS can be easily incorporated.
Frontend: https://github.com/locker-labs/text-swap
Contracts: https://github.com/locker-labs/delegation-framework
Session account: https://sepolia.etherscan.io/address/0xee567fe1712faf6149d80da1e6934e354124cfe3
All code was written from scratch during the course of this hackathon. 1)Frontend scaffold created with `create-gator-app`. 2) zkFetch (https://zkfetch.com/) from Reclaim is used for generating zk proofs from Twitter. We had problems getting Reclaim to build in NextJS. Standalone scripts for Reclaim here: https://github.com/locker-labs/text-swap/blob/cd536b312bd0b076a2d9748c1d2d6a776ab03f19/scripts/create-session-account.ts#L9 3) MetaMask's delegation-framework was forked and DeleGatorCore was modified to include a new `redeemDelegationsWithText` method. It works just like `redeemDelegations`, except it checks that a valid Tweet is being consumed before allowing a delegation to be redeemed.
Please contact us or donate: 0x1ECF3f51A771983C150b3cB4A2162E89c0A046Fc