Skip to content

Latest commit

 

History

History
86 lines (62 loc) · 2.63 KB

README.md

File metadata and controls

86 lines (62 loc) · 2.63 KB

Celo

Allowlist Paymaster using ThirdWeb SDK

This is the implementation of Allowlist Paymaster, a paymaster that allows a list of UserOperation senders to be sponsored by the paymaster

Table of Contents

Installation

Clone the repo

git clone https://github.com/celo-academy/allowlist-paymaster-dapp.git

Install dependencies

yarn install

Usage

Step 1: Deploy the AllowlistPaymaster

.env setup in packages/hardhat

  • Go to packages/hardhat folder
  • Create a .env file and copy the contents of .env.example into it
  • Get the Private Key of the owner of the Paymaster and place it in the .env file
  • Open the file scripts/deploy.js, Entrypoint are frequently upgraded make sure the variable ENTRYPOINT_ADDRESS has the correct value
  • Run the deploy script to deploy the paymaster using the following command
npx hardhat run scripts/deploy.js --network alfajores

Step 2: Start the App

.env setup in packages/react-app

  • Copy the paymaster address that you get in the terminal, this is the value for ALLOWLIST_PAYMASTER_ADDRESS in packages/react-app/paymaster/index.js
  • Create a .env file in packages/react-app and copy the contents of .env.example in packages/react-app into it
  • Get NEXT_PUBLIC_THIRDWEB_API_KEY from the ThirdWeb Dashboard
  • Place the key in .env file in packages/react-app
  • Get NEXT_PUBLIC_WC_PROJECT_ID from WalletConnect dashboard
  • PAYMASTER_SIGNER_KEY is the same as the private key of the owner that you put in .env in packages/hardhat

To run the app

yarn dev

Optional:

You can verify the paymaster by using your Celoscan key in .env in packages/hardhat folder and use the following command

npx hardhat verify [PAYMASTER_ADDRESS] [ENTRYPOINT_ADDRESS] [PAYMASTER_OWNER_ADDRESS] --network alfajores

Features

  • Customize the allowList in index.js in packages/react-app/paymaster to allow sponsorship of smart accounts by the paymaster

Doubts

Join Office Hours in Celo discord