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/erc-4337-custom-paymaster.git
Install dependencies
yarn install
- 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
- Get
THIRDWEB_API_KEY
from the ThirdWeb Dashboard - Place the key in
.env
file - Replace variables
PAYMASTER_OWNER
(this is the public key corresponding the private key of the paymaster owner), andALLOWLIST_PAYMASTER_ADDRESS
with the values you have
To run the transaction script and perform a UserOperation
use the following command
yarn dev
Optional:
You can verify the paymaster by using your Celoscan key in .env
file and use the following command
npx hardhat verify [PAYMASTER_ADDRESS] [ENTRYPOINT_ADDRESS] [PAYMASTER_OWNER_ADDRESS] --network alfajores
- Customize the
allowList
inindex.js
to allow sponsorship of smart accounts by the paymaster
Join Office Hours in Celo discord