This is a starter kit that implements the Biconomy SDK into a basic React application built with Vite. This Kit comes with everything you need for social login and for making gasless transactions to a contract with the Biconomy SDK.
Navigate to this directory in your terminal and then
cd smartContract
You can use npm to install but for these instructions I will be using yarn. It will work the same way with npm or pnpm.
yarn
Once dependencies are installed run the following command:
cp .env.example .env;
You will need to update the newly created .env file with your wallet's PRIVATE_KEY. Make sure to get API keys from Etherscan or PolygonScan. Create an account to get your API keys, these are free.
Run the command below to deploy your contract to the Polygon Mumbai Network. Make sure the wallet you got your private key from has a small amount of test matic for deployment. You can get test matic here.
npx hardhat run scripts/deploy.ts --network mumbai
Once deployed copy the contract address on the terminal and run the command below:
npx hardhat verify --network mumbai <your-contract-address>
This will verify your contract on Polygonscan and give you a link to your code on Polygonscan!
Now head over to the Biconomy SDK Dashboard
Follow the instructionso on the docs here to register your contract, load your gas tank, and grab your api key.
In your terminal navigate to the root folder of the project and install dependencies and configure the frontend variables as we did for the contract folder.
yarn
cp .env.example .env;
Add your Biconomy API Key and your contract address in the .env file, and use the dev script to run:
yarn dev
You should now be all set to try out the starter kit and begin making changes for your own project!
Have any improvements to be made? Feel free to make a Pull Request!