A paymaster that sponsors 5 transactions if you tweet about it, built using Alchemy Gas Manager
Clone the repository
git clone https://github.com/therealharpaljadeja/tweet-paymaster.git
Install Dependencies
yarn install
Create a .env
file for environment variables
Get TWITTER_CLIENT_ID
and TWITTER_CLIENT_SECRET
from Twitter Developer Dashboard
Get ALCHEMY_BEARER_TOKEN
from Alchemy Dashboard
Get GAS_POLICY_ID
from Alchemy Gas Manager Dashboard
GET NEXT_PUBLIC_RPC_URL
from Alchemy
Start the app
yarn run dev
Once the app has started, first thing to do is to make the user tweet something and pin the tweet (pinning is required because Twitter free API only lets you access pinned tweets)
The process of tweeting and pinning MUST be done before Login With Twitter
step in the app, pinned tweet is fetched during the auth process
Second step is to connect the wallet where the associated Smart Account
will be offered 5 free transactions
Third step is to Login with Twitter
and Verify
, once done 5 free transactions/UserOperations will be allowed and you can test it
-
Change Tweet Content
You can change the content of the tweet by change the following code in file
index.js
<Link href={`https://twitter.com/intent/tweet?text=Got%20free%20UserOperations%0A%0A%40harpaljadeja11%20is%20the%20best!`} target="_blank" > <Button borderRadius={"20"} colorScheme="twitter"> Tweet </Button> </Link>
Change the
href
attribute, specifically the text param withURLEncoded
version of the text you want to be tweeted by the user -
More Free UserOperations
If you want to offer more free UserOperations then make that change in your Alchemy Gas Policy
Open for contributions!
Harpalsinh Jadeja - Email - Twitter - Telegram
Create Issue