A full stack monorepo with
- React Native
- Nextjs
- Web3Auth
- Solidity
- Chainlink VRF
- Filecoin NFT.storage
built under The Chainlink 2022 Hackathon https://devpost.com/software/kudos-bzion8
Test Net Deploy:
Mobile: https://exp.host/@jongan69/kudos
Web: https://kudos-taupe.vercel.app/sign-in
- Create Web3Auth.io Account at https://dashboard.web3auth.io/
- Copy into credentials .env and constant.js
Note:
WEB_API_ROUTES
would be the URL of the deployed nextjs app ie: vercel - yarn install inside the root and web directories
- Receive Test Link from https://faucets.chain.link/
- Create and Fund a VRF Subscription at https://vrf.chain.link/
- Deploy the
contracts/KudosToken.sol
via https://remix.ethereum.org/ with a Total Token Supply - Copy Token Contract Address
- Deploy the
contracts/FavorsV2.sol
via https://remix.ethereum.org/ with subscription ID and Token Contract Address - Add Favor Contract Address to .env file
yarn ios
- Run iOS App
yarn android
- Run Android App
yarn web
- Start Nextjs app
- Built using Web3auth
- Has nhost for Graph QL DB if needed
- Has Nextjs App for API
- File Reading Functions
- Has Smart Contract for Favor Posting, Retrieving, Completing, and payment
in a new .env
backendUrl: "YOUR_NHOST_BACKEND_URL",
in App.js
clientStorageType: "expo-secure-storage",
To Run Nextjs App:
yarn web
in root directory
- Expo React Native App
- Nextjs App
- Web3Auth - React Native SDK
- Thirdwebjs Auth - Nextjs SDK
- ERC20 Contract
- Chainlink VRF
- FavorsV2 Contract
- Mobile App Smart Contract Function Integration: 1. Post Button => postFavor(text) 2. Refresh Favors Button => getAllIncompleteFavors() 3. Offers Tab => getMyFavors() 4. Accept Button => acceptFavor 5. Mark Completed Button => completeFavor(favorId)
- Fix Nextjs App (Connect to Deployed Contract)
- User Profile Contract / nHost
- Use React-Native-Async-Storage for Persistent Login State and Data
- Review +/- Test
Message Signing
const signMessage = async () => { try { setConsole("Signing message"); const ethersProvider = ethers.getDefaultProvider(providerUrl); const wallet = new ethers.Wallet(key, ethersProvider); const originalMessage = "YOUR_MESSAGE"; // Sign the message const signedMessage = await wallet.signMessage(originalMessage); console.log(signedMessage) } catch (e) { console.log(e) } };
Transaction Sending
const sendTransaction = async () => { try { setConsole("Sending transaction"); const ethersProvider = ethers.getDefaultProvider(providerUrl); const wallet = new ethers.Wallet(key, ethersProvider); const destination = "0x40e1c367Eca34250cAF1bc8330E9EddfD403fC56"; // Convert 1 ether to wei const amount = ethers.utils.parseEther("0.001"); // Submit transaction to the blockchain const tx = await wallet.sendTransaction({ to: destination, value: amount, maxPriorityFeePerGas: "5000000000", // Max priority fee per gas maxFeePerGas: "6000000000000", // Max fee per gas }); console.log(tx) } catch (e) { console.log(e) } };