This is the implementation of Allowlist Paymaster, a paymaster that allows a list of UserOperation senders to be sponsored by the paymaster
Clone the repo
git clone https://github.com/celo-academy/allowlist-paymaster-dapp.git
Install dependencies
yarn install
- 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 variableENTRYPOINT_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
- Copy the paymaster address that you get in the terminal, this is the value for
ALLOWLIST_PAYMASTER_ADDRESS
inpackages/react-app/paymaster/index.js
- Create a
.env
file inpackages/react-app
and copy the contents of.env.example
inpackages/react-app
into it - Get
NEXT_PUBLIC_THIRDWEB_API_KEY
from the ThirdWeb Dashboard - Place the key in
.env
file inpackages/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
inpackages/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
- Customize the
allowList
inindex.js
inpackages/react-app/paymaster
to allow sponsorship of smart accounts by the paymaster
Join Office Hours in Celo discord