Some basic scripts for testing smart account and paymaster on Cronos zkEVM Sepolia Testnet, based on matter-labs/tutorials, added some additional configurations and updated some scripts to make it easier to use.
yarn install
yarn compile
Create .env
file in the project root, fill WALLET_PRIVATE_KEY
in .env
file, this will be used to deploy the smart contract, and make sure there are enough funds in the wallet(several baseToken).
yarn deploy:aa-factory
- This script will,
- Deploy the smart account factory contract
- Generate a radnom key as the owner key of the smart account, this key will be used to sign transactions for the smart account
- Use the factory contract to deploy a smart account, set the smart account's owner to the generated key's address
- Transfer some tokens to the smart account
Use the random generated key on the last step to sign a transaciton for smart account to transfer tokens to it self
yarn use:aa
yarn deploy:paymaster
- Deploy the ERC20 token contract
- Deploy an
approvalBased
flow paymaster contract - Fund the paymaster contract with some baseTokens
yarn use:paymaster
- Account make a transaction with
paymasterParams
set - Paymaster will help the account to pay the gas fee with the equal amount of ERC20 token