Home

Awesome

AA Benchmark

A benchmark for AA (ERC-4337) smart contract accounts.

All accounts use single-ECDSA signatures. We plan on expanding to other signing schemes in the future (multisig, RSA, etc.).

Note that these numbers are most relevant for L1s like Ethereum/Polygon. For L2s (e.g. Arbitrum/Optimism/Base), there's a L1 data cost that's not measured.

Results (as of February 24, 2024)

Disclaimer the numbers are obtained from local simulations. On-chain numbers might differ slightly.

Since these are gas numbers, lower is better.

CreationNative transferERC20 transferTotal
SimpleAccount38321810131990907575444
Biconomy27001310440893730468151
Etherspot27921910371993324476262
Kernel v2.033988211001899622549522
Kernel v2.126521510646096038467713
Kernel v2.1-lite23096810100290321422291
Solady ERC433721226210014989532401943
SoulWalletCore27652910116290466468157
Safe 4337401848115469105089622406
LightAccount27982010091090411471141
ERC7579 reference28943810381193213486462
Alchemy ModularAccount827723106630964381030791

How to add your implementation

  1. Fork this repo.
  2. Add your test file to ./test/; create a folder if needed.
  3. Inherit src/TestBase.sol and override getSignature(), fillData(), createAccount(), getAccountAddr(), getInitCode().
    • getSignature(): should return appropriate signature based on _op (e.g. should return ECDSA signature).
    • fillData(): should return appropriate data for userOp.callData.
    • createAccount(): should create the wallet. Skip this if your factory only allows for creation through the EntryPoint.
    • getAccountAddr(): should return the counterfactual address for the given _owner.
    • getInitCode(): should return userOp.initCode.
  4. Write setUp() function to set the initial test condition. For instance, it might deploy the factory and the implementation contract. NOTICE since we don't want this repo to have too many dependencies, please use vm.etch and use your predicted address & bytecode to deploy the contract instead of importing your whole code. This will also make it easy to test without compiler setup fiasco.
  5. Run WRITE_GAS_PROFILE=true forge test -vv this will show you the results of the benchmark and also output the result as a JSON file to results/.
  6. Make a PR to this repository.

TODO