The SimpleAccount.sol is an sample contract that was audited and shipped along with the main ERC-4337 protocol. It was developed by the Ethereum Foundation and its simplicity makes it an excellent first step for developers that are just getting started with account abstraction.
For developers building production grade apps that require more flexibility, we recommend checking out ZeroDev Kernel.
For details on the supported
yarn run simpleAccount -h
Not using a paymaster?
Make sure to also have enough ETH or native gas tokens to pay for the transaction fees.
SimpleAccount addresses can be deterministically generated. Use this command to get your account address based on the
signingKey set in your
The account will be automatically deployed on the first transaction.
yarn run simpleAccount address
Before executing a transfer, make sure to deposit some ETH to the address generated by the
simpleAccount address command.
yarn run simpleAccount transfer --to <address> --amount <eth>
Make sure the address generated by
simpleAccount address has enough specified tokens to execute the transfer.
yarn run simpleAccount erc20Transfer --token <address> --to <address> --amount <decimal>
This command allows you to run an ERC-20 approval transaction for your account. Its particularly useful for testing out an ERC-20 paymaster.
yarn run simpleAccount erc20Approve --token <address> --spender <address> --amount <decimal>
This command allows you to do multiple atomic contract interactions in a single transaction. The example shows us how with an ERC-20 token.
# recipient addresses is comma separated. # e.g. 0x123..abc,0x456...def yarn run simpleAccount batchErc20Transfer --token <address> --to <addresses> --amount <decimal>
Updated 4 months ago